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

Eli Friedman eli.friedman at gmail.com
Fri Jun 10 01:28:15 PDT 2011


On Fri, Jun 10, 2011 at 12:45 AM, Duncan Sands <baldrick at free.fr> wrote:
> 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.

You aren't allowed to invoke intrinsics; the verifier enforces this.
Using CallSite is always nice, though.

-Eli




More information about the llvm-commits mailing list