Assign node order numbers to results of call instruction lowering. This should improv...
authorEvan Cheng <evan.cheng@apple.com>
Fri, 1 Apr 2011 19:42:22 +0000 (19:42 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 1 Apr 2011 19:42:22 +0000 (19:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128728 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index 18d5a7a9ee4c2d83335c4f669374fb0726b7a0ac..949235308955c5e86fae8185d83a10fd867a956e 100644 (file)
@@ -4927,15 +4927,19 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
              DAG.getNode(ISD::MERGE_VALUES, getCurDebugLoc(),
                          DAG.getVTList(&RetTys[0], RetTys.size()),
                          &ReturnValues[0], ReturnValues.size()));
-
   }
 
   // As a special case, a null chain means that a tail call has been emitted and
   // the DAG root is already updated.
-  if (Result.second.getNode())
-    DAG.setRoot(Result.second);
-  else
+  if (!Result.second.getNode()) {
     HasTailCall = true;
+    ++SDNodeOrder;
+    AssignOrderingToNode(DAG.getRoot().getNode());
+  } else {
+    DAG.setRoot(Result.second);
+    ++SDNodeOrder;
+    AssignOrderingToNode(Result.second.getNode());
+  }
 
   if (LandingPad) {
     // Insert a label at the end of the invoke call to mark the try range.  This