Skip to content

Commit 3129bdc

Browse files
committed
[DAG] visitINSERT_VECTOR_ELT - move mergeInsertEltWithShuffle / combineInsertEltToShuffle folds after canonicalization
Noticed while triaging D127115 regressions - there's no need to attempt these costly folds until after the easy canonicalization cases have been addressed
1 parent 3e4a6f5 commit 3129bdc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20149,12 +20149,6 @@ SDValue DAGCombiner::visitINSERT_VECTOR_ELT(SDNode *N) {
2014920149
// We must know which element is being inserted for folds below here.
2015020150
unsigned Elt = IndexC->getZExtValue();
2015120151

20152-
if (SDValue Shuf = mergeInsertEltWithShuffle(N, Elt))
20153-
return Shuf;
20154-
20155-
if (SDValue Shuf = combineInsertEltToShuffle(N, Elt))
20156-
return Shuf;
20157-
2015820152
// Handle <1 x ???> vector insertion special cases.
2015920153
if (NumElts == 1) {
2016020154
// insert_vector_elt(x, extract_vector_elt(y, 0), 0) -> y
@@ -20184,6 +20178,12 @@ SDValue DAGCombiner::visitINSERT_VECTOR_ELT(SDNode *N) {
2018420178
}
2018520179
}
2018620180

20181+
if (SDValue Shuf = mergeInsertEltWithShuffle(N, Elt))
20182+
return Shuf;
20183+
20184+
if (SDValue Shuf = combineInsertEltToShuffle(N, Elt))
20185+
return Shuf;
20186+
2018720187
// Attempt to convert an insert_vector_elt chain into a legal build_vector.
2018820188
if (!LegalOperations || TLI.isOperationLegal(ISD::BUILD_VECTOR, VT)) {
2018920189
// vXi1 vector - we don't need to recurse.

0 commit comments

Comments
 (0)