[llvm-commits] cxa_guard elimination

Nick Lewycky nicholas at mxc.ca
Thu Feb 9 10:21:57 PST 2012


On 02/09/2012 12:56 AM, Nick Lewycky wrote:
> Nick Lewycky wrote:
>> Chris Lattner wrote:
>>> On Jan 28, 2012, at 11:50 PM, Nick Lewycky wrote:
>>>>> The good news is that we already have a valid DomTree by the time
>>>>> simplify-libcalls runs, so we're good to request one here.
>>>>>
>>>>> The updated patch is barely more complicated, there's just an
>>>>> additional
>>>>> check to see whether there's a single predecessor block that's testing
>>>>> the guard variable, and an additional domtree BB test (so, no linear
>>>>> time) on each StoreInst. No sweat!
>>>>>
>>>>> Please review! I'd like to land this patch and then start working on
>>>>> some of its deficiencies in follow-up patches.
>>>>
>>>> Uh... I mailed out the entirely wrong patch.
>>>>
>>>> Correct patch attached!
>>>
>>> Hi Nick,
>>>
>>> Did you consider doing this as part of globalopt?
>>
>> Yes, that was the next thing in my email :) However, consider that:
>>
>> - I'd like it to run *after* the inliner so that I don't get fouled up
>> by constructor calls
>
> Of course GlobalOpt is interprocedural, since it already has to not be
> fouled up by constructor calls.
>
> Updated patch attached, including more bugfixes than ever before! Please
> review!

Updated patch again, now without memory corruption. Also slightly more 
aggressive by ignoring AllocaTmps when scanning through ReadMemory and 
MutatedMemory.

It turns out that llvm-test is not a good test suite for this particular 
change.

Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: globalopt-cxa_guard-2.patch
Type: text/x-diff
Size: 38329 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120209/62783ed5/attachment.patch>


More information about the llvm-commits mailing list