Deal with cases when MMI is not requested.
authorJim Laskey <jlaskey@mac.com>
Sat, 24 Feb 2007 09:45:44 +0000 (09:45 +0000)
committerJim Laskey <jlaskey@mac.com>
Sat, 24 Feb 2007 09:45:44 +0000 (09:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34556 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index c35f02a06ca117c14a2b299264396c951a00f2ec..99136ec160e593c76a0449b106c980a9cd208cbe 100644 (file)
@@ -2101,6 +2101,12 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
       SDOperand Op = DAG.getNode(ISD::EXCEPTIONADDR, VTs, Ops, 1);
       setValue(&I, Op);
       DAG.setRoot(Op.getValue(1));
+    } else {
+      SDOperand Op = DAG.getNode(ISD::MERGE_VALUES, TLI.getPointerTy(),
+                                 DAG.getConstant(0, TLI.getPointerTy()),
+                                 DAG.getRoot());
+      setValue(&I, Op);
+      DAG.setRoot(Op.getValue(1));
     }
     return 0;
   }
@@ -2145,6 +2151,12 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
       SDOperand Op = DAG.getNode(ISD::EHSELECTION, VTs, Ops, 2);
       setValue(&I, Op);
       DAG.setRoot(Op.getValue(1));
+    } else {
+      SDOperand Op = DAG.getNode(ISD::MERGE_VALUES, TLI.getPointerTy(),
+                                 DAG.getConstant(0, TLI.getPointerTy()),
+                                 getValue(I.getOperand(1)));
+      setValue(&I, Op);
+      DAG.setRoot(Op.getValue(1));
     }
     
     return 0;
@@ -2169,6 +2181,8 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
       
       unsigned TypeID = MMI->getTypeIDFor(GV);
       setValue(&I, DAG.getConstant(TypeID, MVT::i32));
+    } else {
+      setValue(&I, DAG.getConstant(0, MVT::i32));
     }
 
     return 0;