Getelementptr has vector type if any of its operands are vectors
(the scalar operands being implicitly broadcast to all vector elements).
Extractelement applied to a vector getelementptr can be folded by
applying the extractelement in turn to all of the vector operands.
Details
Details
Diff Detail
Diff Detail
- Repository
 - rG LLVM Github Monorepo
 
Event Timeline
| llvm/lib/IR/ConstantFold.cpp | ||
|---|---|---|
| 811 | This should probably be ConstantExpr::getExtractElement(), not ConstantFoldExtractElementInstruction. Pushing the extractelement into the operands should always be canonical. Granted, it's hard to come up with an example where that should make a difference.  | |
| llvm/lib/IR/ConstantFold.cpp | ||
|---|---|---|
| 811 | Agreed and fixed in dc63d6175aa.  | |
This should probably be ConstantExpr::getExtractElement(), not ConstantFoldExtractElementInstruction. Pushing the extractelement into the operands should always be canonical. Granted, it's hard to come up with an example where that should make a difference.