[llvm-commits] cxa_guard elimination

Chris Lattner clattner at apple.com
Wed Feb 1 19:39:01 PST 2012


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?  It already has "simulation" logic that could be reusable, and doing this early means that you can optimize for the common case, where inlining hasn't happened yet.  It seems like it would eliminate some of the dominator requirements, and wouldn't prevent merging simplifylibcalls into instcombine in the future.

-Chris



More information about the llvm-commits mailing list