Be smarter about scalarization of extractelement of vectors
- Dominant language
- C++
- Stars
- 3k
- Forks
- 352
- PR merge metrics
- No merged PRs in 30d
Description
As of 0664f5a724bd1611110d67af942c3f28ca332fb3, we try to turn vector expressions where we only need the first element of the vector into the equivalent scalar expressions. This is actually the wrong thing to do in cases where we have to compute the vector anyway for other needs. A better approach would probably be to:
- go back to emitting extractelement %foo, i32 0 for those
- have an additional optimizaiton pass that does a cleanup and looks at extractelement %foo, i32 0 instructions.
*\* Then, we can look and see if %foo has any uses other than in the extractelement. If so, then we leave it alone and otherwise we do the LLVMExtractVectorInts() transformation
Contributor guide
Assessment
This issue has not been assessed yet.