[llvm-commits] [llvm] r43083 - in /llvm/trunk: lib/Transforms/IPO/RaiseAllocations.cpp test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll

Chris Lattner clattner at apple.com
Fri Oct 19 08:18:43 PDT 2007


On Oct 19, 2007, at 1:36 AM, Duncan Sands wrote:

> Hi Devang,
>
>>>> Do not raise free() call that is called through invoke instruction.
>>
>>> why not?  As far as I know free cannot raise an exception,
>>
>> If this is guaranteed then raiseallocs needs to do cleanup and break
>> link between bb with inovke .. at free(..) and corresponding unwind  
>> block
>> (remove PHI nodes' incoming edge).
>
> it is not clear to me whether we are allowed to assume that free is  
> the
> standard C free (likewise for malloc).  If we are, then I think it  
> would
> be better to raise calls to them, fixing up the unwind edge if they  
> were
> invokes.

In general, we want to limit this.  However, raiseallocations in  
general assumes that malloc and free are builtins.  Something like - 
fbuiltins should not run the pass.  I think it would be safe for it  
to raise an invoke of malloc or free into a call, simply deleting the  
unwind edge.

-Chris



More information about the llvm-commits mailing list