From: Amaury Sechet Date: Tue, 27 Aug 2019 13:27:57 +0000 (+0000) Subject: [DAGCombiner] Add node to the worklist in topological order in parallelizeChainedStores X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0fe2f45515df10df4737334b401ecbe3df65c8f;p=llvm [DAGCombiner] Add node to the worklist in topological order in parallelizeChainedStores 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 --- diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 9037adea356..eea22e220f1 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -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; }