[llvm] r339757 - [DagCombiner] Don't bother adding to the work list if TLI.BuildSDIVPow2 failed. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 15 03:02:54 PDT 2018
Author: rksimon
Date: Wed Aug 15 03:02:54 2018
New Revision: 339757
URL: http://llvm.org/viewvc/llvm-project?rev=339757&view=rev
Log:
[DagCombiner] Don't bother adding to the work list if TLI.BuildSDIVPow2 failed. NFCI.
Matches the code in BuildSDIV/BuildUDIV
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=339757&r1=339756&r2=339757&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Aug 15 03:02:54 2018
@@ -18089,11 +18089,13 @@ SDValue DAGCombiner::BuildSDIVPow2(SDNod
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
More information about the llvm-commits
mailing list