Fix handling of inttoptr and ptrtoint when unhandled operands are present.
authorOwen Anderson <resistor@mac.com>
Wed, 27 Aug 2008 00:35:37 +0000 (00:35 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 27 Aug 2008 00:35:37 +0000 (00:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55400 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/FastISel.cpp

index 64843f8b558936e24f459cce1f6f44319114617e..a956f0190b465360458b1d2cb83f3eab3db0f4ff 100644 (file)
@@ -393,8 +393,12 @@ FastISel::SelectInstructions(BasicBlock::iterator Begin,
       MVT SrcVT = TLI.getValueType(I->getOperand(0)->getType());
       MVT DstVT = TLI.getValueType(I->getType());
       if (SrcVT.getSimpleVT() == DstVT.getSimpleVT()) {
-        ValueMap[I] = ValueMap[I->getOperand(0)];
-        break;
+        if (ValueMap[I->getOperand(0)]) {
+          ValueMap[I] = ValueMap[I->getOperand(0)];
+          break;
+        } else
+          // Unhandled operand
+          return I;
       } else if (DstVT.bitsGT(SrcVT)) {
         if (!isa<ConstantInt>(I->getOperand(0))) {
           if (!SelectCast(I, ISD::ZERO_EXTEND, ValueMap)) return I;