[llvm-commits] [llvm] r132803 - /llvm/trunk/lib/Transforms/IPO/PruneEH.cpp

Duncan Sands baldrick at free.fr
Fri Jun 10 00:45:30 PDT 2011


Hi John,

> When deleting a basic block, remove call edges only for non-intrinsics.
>
>
> Modified:
>      llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
>
> Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=132803&r1=132802&r2=132803&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original)
> +++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Thu Jun  9 15:31:09 2011
> @@ -239,7 +239,7 @@
>     for (BasicBlock::iterator I = BB->end(), E = BB->begin(); I != E; ) {
>       --I;
>       if (CallInst *CI = dyn_cast<CallInst>(I)) {
> -      if (!isa<DbgInfoIntrinsic>(I))
> +      if (!isa<IntrinsicInst>(I))
>           CGN->removeCallEdgeFor(CI);
>       } else if (InvokeInst *II = dyn_cast<InvokeInst>(I))
>         CGN->removeCallEdgeFor(II);

in theory you can have an invoke of an intrinsic I think (not sure), though of
course they tend to quickly be turned into calls because of the nounwind
attribute (but what if someone hand wrote some IR with an invoke of your new
intrinsic that can throw?).  So probably the same thing should be done in the
invoke case.  Maybe the two cases can be unified using a CallSite.

Ciao, Duncan.



More information about the llvm-commits mailing list