diff options
author | Amaury Séchet <deadalnix@gmail.com> | 2019-12-02 18:35:59 +0100 |
---|---|---|
committer | Amaury Séchet <deadalnix@gmail.com> | 2019-12-02 19:12:03 +0100 |
commit | c594d14d40f5c55a839ed51602cea198ff76e8a1 (patch) | |
tree | 5e4e6ec0eeabfca83c9826c3379c8072754e9789 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | bf535ac4a28268e6a481acee5a794ef5deed5018 (diff) | |
download | bcm5719-llvm-c594d14d40f5c55a839ed51602cea198ff76e8a1.tar.gz bcm5719-llvm-c594d14d40f5c55a839ed51602cea198ff76e8a1.zip |
[DAGCombine] Factor oplist operations. NFC
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 42e1376c3f6..2c2f8fea979 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -180,6 +180,12 @@ namespace { AddToWorklist(Node); } + /// Convenient shorthand to add a node and all of its user to the worklist. + void AddToWorklistWithUsers(SDNode *N) { + AddUsersToWorklist(N); + AddToWorklist(N); + } + // Prune potentially dangling nodes. This is called after // any visit to a node, but should also be called during a visit after any // failed combine which may have created a DAG node. @@ -1427,10 +1433,9 @@ void DAGCombiner::Run(CombineLevel AtLevel) { SmallSetVector<SDNode *, 16> UpdatedNodes; bool NIsValid = DAG.LegalizeOp(N, UpdatedNodes); - for (SDNode *LN : UpdatedNodes) { - AddUsersToWorklist(LN); - AddToWorklist(LN); - } + for (SDNode *LN : UpdatedNodes) + AddToWorklistWithUsers(LN); + if (!NIsValid) continue; } @@ -16990,8 +16995,7 @@ SDValue DAGCombiner::scalarizeExtractedVectorLoad(SDNode *EVE, EVT InVecVT, AddToWorklist(EVE); // Since we're explicitly calling ReplaceAllUses, add the new node to the // worklist explicitly as well. - AddUsersToWorklist(Load.getNode()); // Add users too - AddToWorklist(Load.getNode()); + AddToWorklistWithUsers(Load.getNode()); ++OpsNarrowed; return SDValue(EVE, 0); } |