[PATCH] D66659: [DAGCombiner] Add node to the worklist in topological order in parallelizeChainedStores

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 23 08:29:29 PDT 2019


deadalnix created this revision.
deadalnix added reviewers: craig.topper, efriedma, RKSimon, lebedev.ri.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

As per title.


Repository:
  rL LLVM

https://reviews.llvm.org/D66659

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp


Index: lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -20662,11 +20662,11 @@
   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());
   AddToWorklist(TF.getNode());
+  for (const SDValue &Op : TF->ops())
+    AddToWorklist(Op.getNode());
+  AddToWorklist(STChain);
   return true;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66659.216863.patch
Type: text/x-patch
Size: 638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190823/e7c8ad2c/attachment.bin>


More information about the llvm-commits mailing list