ignore 'invoke new' in isInstructionTriviallyDead, since most callers are not ready...
authorNuno Lopes <nunoplopes@sapo.pt>
Fri, 29 Jun 2012 17:37:07 +0000 (17:37 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Fri, 29 Jun 2012 17:37:07 +0000 (17:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159440 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/Local.cpp

index bed7d72fffc68bdb7de5daf6a17c849ef8c37300..e9097a4053c085bc3abef62d14b235ab45e4086b 100644 (file)
@@ -265,7 +265,8 @@ bool llvm::isInstructionTriviallyDead(Instruction *I) {
       return isa<UndefValue>(II->getArgOperand(1));
   }
 
-  if (isAllocLikeFn(I)) return true;
+  if (isAllocLikeFn(I))
+    return isa<CallInst>(I); // do not mess around with invoke here
 
   if (CallInst *CI = isFreeCall(I))
     if (Constant *C = dyn_cast<Constant>(CI->getArgOperand(0)))