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
- 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
- Build Status
Buildable 8656 Build 8656: arc lint + arc unit
Event Timeline
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
15751–15753 | 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). | |
15757 | 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 | ||
---|---|---|
15767 | I think you need to verify that VT and InVecT have the same element type here? |
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
15767 | "VT.getVectorNumElements() != InVecT.getVectorNumElements()" check is redundant. |
LGTM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
15766 | 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. |
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).