diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-08-15 10:02:54 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-08-15 10:02:54 +0000 |
| commit | e8a906ba4776f4fe3f0967db002629298ff4a35b (patch) | |
| tree | 0318a07424710437edddc87f5a51cdc186a2ad39 /llvm/lib | |
| parent | a272fa9b0c324e34778d6a4dac7294b57b13f621 (diff) | |
| download | bcm5719-llvm-e8a906ba4776f4fe3f0967db002629298ff4a35b.tar.gz bcm5719-llvm-e8a906ba4776f4fe3f0967db002629298ff4a35b.zip | |
[DagCombiner] Don't bother adding to the work list if TLI.BuildSDIVPow2 failed. NFCI.
Matches the code in BuildSDIV/BuildUDIV
llvm-svn: 339757
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 12a177a343a..a85feff44c0 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -18089,11 +18089,13 @@ SDValue DAGCombiner::BuildSDIVPow2(SDNode *N) { return SDValue(); SmallVector<SDNode *, 8> Built; - SDValue S = TLI.BuildSDIVPow2(N, C->getAPIntValue(), DAG, Built); + if (SDValue S = TLI.BuildSDIVPow2(N, C->getAPIntValue(), DAG, Built)) { + for (SDNode *N : Built) + AddToWorklist(N); + return S; + } - for (SDNode *N : Built) - AddToWorklist(N); - return S; + return SDValue(); } /// Given an ISD::UDIV node expressing a divide by constant, return a DAG |

