In visitUREM, arrange for the temporary UDIV node to be
authorDan Gohman <gohman@apple.com>
Mon, 8 Sep 2008 16:59:01 +0000 (16:59 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 8 Sep 2008 16:59:01 +0000 (16:59 +0000)
revisited, consistent with the code in visitSREM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55923 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 2d400bdfb2556064642a6e03c81b470474ce4751..53956afebe48173cdc6a3b93c569b31c9a278818 100644 (file)
@@ -1423,6 +1423,7 @@ SDValue DAGCombiner::visitUREM(SDNode *N) {
   // X%C to the equivalent of X-X/C*C.
   if (N1C && !N1C->isNullValue()) {
     SDValue Div = DAG.getNode(ISD::UDIV, VT, N0, N1);
+    AddToWorkList(Div.getNode());
     SDValue OptimizedDiv = combine(Div.getNode());
     if (OptimizedDiv.getNode() && OptimizedDiv.getNode() != Div.getNode()) {
       SDValue Mul = DAG.getNode(ISD::MUL, VT, OptimizedDiv, N1);