Allow SCALAR_TO_VECTOR of EXTRACT_VECTOR_ELT to reduce to
EXTRACT_SUBVECTOR of vector shuffle when output is smaller. Marginally
improves vector shuffle computations.
Details
Details
- Reviewers
efriedma RKSimon spatel - Commits
- rG3d3bde7682eb: [DAG] Extend visitSCALAR_TO_VECTOR optimization to truncated vector.
rGb5cb48c6ae16: [DAG] Extend visitSCALAR_TO_VECTOR optimization to truncated vector.
rL310256: [DAG] Extend visitSCALAR_TO_VECTOR optimization to truncated vector.
rL309680: [DAG] Extend visitSCALAR_TO_VECTOR optimization to truncated vector.
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
15628 ↗ | (On Diff #107105) | The only way for VT.getScalarType() == InVal.getValueType() to be false is if legalization promoted it to a larger integer type... and I can't why that should block the transform (the extra bits get discarded anyway). |
15635 ↗ | (On Diff #107105) | Do you need to check that the element type matches? And in that case, isn't the "VT.getVectorNumElements() == InVecT.getVectorNumElements()" check redundant (since it implies VT == InVecT)? |
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
15643 ↗ | (On Diff #108086) | I think you need to verify that VT and InVecT have the same element type here? |
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
15767 ↗ | (On Diff #108508) | "VT.getVectorNumElements() != InVecT.getVectorNumElements()" check is redundant. |
Comment Actions
LGTM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
15766 ↗ | (On Diff #108939) | I would probably rearrange this to move the element type check into the outer if statement, for the sake of clarity... but either way is fine, I guess. |