Assign node orders to target intrinsics which do not produce results. rdar://11096639
authorEvan Cheng <evan.cheng@apple.com>
Thu, 22 Mar 2012 19:29:09 +0000 (19:29 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 22 Mar 2012 19:29:09 +0000 (19:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153269 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index 2ac9655dd0562cf68580a585b6bfe92eb92b4e64..6ec38c57b18d8b5dba6c44deaa8833a6f5ced9f8 100644 (file)
@@ -3586,6 +3586,12 @@ void SelectionDAGBuilder::visitTargetIntrinsic(const CallInst &I,
     }
 
     setValue(&I, Result);
+  } else {
+    // Assign order to result here. If the intrinsic does not produce a result,
+    // it won't be mapped to a SDNode and visit() will not assign it an order
+    // number.
+    ++SDNodeOrder;
+    AssignOrderingToNode(Result.getNode());
   }
 }