Fix PR820 and Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll
authorChris Lattner <sabre@nondot.org>
Fri, 7 Jul 2006 21:37:01 +0000 (21:37 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 7 Jul 2006 21:37:01 +0000 (21:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29071 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/GlobalOpt.cpp

index 7c212e7b7a3bd109d487bf12b0d9ac0264c54c55..052177973198212ac40b52e92960fd47734b2e09 100644 (file)
@@ -1450,6 +1450,9 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal,
                                               AI->getName()));
       InstResult = AllocaTmps.back();     
     } else if (CallInst *CI = dyn_cast<CallInst>(CurInst)) {
+      // Cannot handle inline asm.
+      if (isa<InlineAsm>(CI->getOperand(0))) return false;
+
       // Resolve function pointers.
       Function *Callee = dyn_cast<Function>(getVal(Values, CI->getOperand(0)));
       if (!Callee) return false;  // Cannot resolve.