[llvm-commits] [llvm] r159440 -	/llvm/trunk/lib/Transforms/Utils/Local.cpp
    Duncan Sands 
    baldrick at free.fr
       
    Fri Jun 29 14:40:05 PDT 2012
    
    
  
Hi Nuno,
> ignore 'invoke new' in isInstructionTriviallyDead, since most callers are not ready to handle invokes. instcombine will take care of this.
> --- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
> +++ llvm/trunk/lib/Transforms/Utils/Local.cpp Fri Jun 29 12:37:07 2012
> @@ -265,7 +265,8 @@
>         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)))
>
this isn't needed, since isInstructionTriviallyDead bails out on
invokes right at the start:
bool llvm::isInstructionTriviallyDead(Instruction *I) {
   if (!I->use_empty() || isa<TerminatorInst>(I)) return false;
Ciao, Duncan.
    
    
More information about the llvm-commits
mailing list