diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index c145008852..d404d15ff7 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1261,8 +1261,14 @@ void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I, VTs.push_back(MVT::Other); // Create the node. - SDOperand Result = DAG.getNode(ISD::INTRINSIC, VTs, Ops); - + SDOperand Result; + if (!HasChain) + Result = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, VTs, Ops); + else if (I.getType() != Type::VoidTy) + Result = DAG.getNode(ISD::INTRINSIC_W_CHAIN, VTs, Ops); + else + Result = DAG.getNode(ISD::INTRINSIC_VOID, VTs, Ops); + if (HasChain) DAG.setRoot(Result.getValue(Result.Val->getNumValues()-1)); if (I.getType() != Type::VoidTy) { |