This patch enables combining integer bitcasts of integer build vectors when the new scalar type is legal. I've avoided floating point because the implementation bitcasts float to int along the way and we would need to check the intermediate types for legality.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
10210–10211 ↗ | (On Diff #189074) | Remove the 'Even if' line of the comment now? Add a TODO for FP? |
test/CodeGen/SystemZ/vec-extract-01.ll | ||
9 ↗ | (On Diff #189074) |
test/CodeGen/SystemZ/vec-extract-01.ll | ||
---|---|---|
9 ↗ | (On Diff #189074) | The new code is certainly correct. Performance-wise it's probably a wash: we now need two instructions instead of one, but on the other hand we're avoiding a memory access ... But that's a separate discussion to be had, since if we prefer the constant pool access we should also use it when loading an integer constant to begin with. So this patch, which simply treats integer constant loads and vector constant loads the same here, should be OK in any case. |