]> granicus.if.org Git - llvm/commitdiff
[DAGCombiner] Add node to the worklist in topological order in parallelizeChainedStores
authorAmaury Sechet <deadalnix@gmail.com>
Tue, 27 Aug 2019 13:27:57 +0000 (13:27 +0000)
committerAmaury Sechet <deadalnix@gmail.com>
Tue, 27 Aug 2019 13:27:57 +0000 (13:27 +0000)
Summary: As per title.

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

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370056 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 9037adea356ef70e54a8300dbc09467ebddd1503..eea22e220f1f14652e553a5fff35e6df1281f7f3 100644 (file)
@@ -20707,11 +20707,11 @@ bool DAGCombiner::parallelizeChainedStores(StoreSDNode *St) {
   SDValue TF = DAG.getTokenFactor(SDLoc(STChain), TFOps);
   CombineTo(St, TF);
 
-  AddToWorklist(STChain);
-  // Add TF operands worklist in reverse order.
-  for (auto I = TF->getNumOperands(); I;)
-    AddToWorklist(TF->getOperand(--I).getNode());
+  // Add TF and its operands to the worklist.
   AddToWorklist(TF.getNode());
+  for (const SDValue &Op : TF->ops())
+    AddToWorklist(Op.getNode());
+  AddToWorklist(STChain);
   return true;
 }