KhronosGroup / KhronosGroup/SPIRV-Tools
Collect element extracting from matrix into vector extracting
Open
component:optimization
enhancement
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 709
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 28
Description
For example, the following SPIR-V code
```llvm
[[mat:%\d+]] = OpLoad %mat2v4float %mat9
[[mat00:%\d+]] = OpCompositeExtract %float [[mat]] 0 0
[[mat01:%\d+]] = OpCompositeExtract %float [[mat]] 0 1
[[mat02:%\d+]] = OpCompositeExtract %float [[mat]] 0 2
[[mat03:%\d+]] = OpCompositeExtract %float [[mat]] 0 3
[[cc:%\d+]] = OpCompositeConstruct %v4float [[mat00]] [[mat01]] [[mat02]] [[mat03]]
```
Can be turned into
```llvm
[[mat:%\d+]] = OpLoad %mat2v4float %mat9
[[cc:%\d+]] = OpCompositeExtract %v4float [[mat]] 0
```
Contributor guide
Assessment
This issue has not been assessed yet.