[DAGCombiner] Add node to the worklist in topological order in scalarizeExtractedVect...
authorAmaury Sechet <deadalnix@gmail.com>
Thu, 19 Sep 2019 14:22:11 +0000 (14:22 +0000)
committerAmaury Sechet <deadalnix@gmail.com>
Thu, 19 Sep 2019 14:22:11 +0000 (14:22 +0000)
Summary: As per title.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66661

llvm-svn: 372327

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 9de16e5..2b47407 100644 (file)
@@ -16845,12 +16845,12 @@ SDValue DAGCombiner::scalarizeExtractedVectorLoad(SDNode *EVE, EVT InVecVT,
   SDValue From[] = { SDValue(EVE, 0), SDValue(OriginalLoad, 1) };
   SDValue To[] = { Load, Chain };
   DAG.ReplaceAllUsesOfValuesWith(From, To, 2);
+  // Make sure to revisit this node to clean it up; it will usually be dead.
+  AddToWorklist(EVE);
   // Since we're explicitly calling ReplaceAllUses, add the new node to the
   // worklist explicitly as well.
-  AddToWorklist(Load.getNode());
   AddUsersToWorklist(Load.getNode()); // Add users too
-  // Make sure to revisit this node to clean it up; it will usually be dead.
-  AddToWorklist(EVE);
+  AddToWorklist(Load.getNode());
   ++OpsNarrowed;
   return SDValue(EVE, 0);
 }