[PATCH] Skip promotable allocas to improve performance at -O0

Anna Zaks zaks.anna at gmail.com
Wed Feb 25 13:49:23 PST 2015


On Wed, Feb 25, 2015 at 1:04 PM, Chandler Carruth <chandlerc at google.com>
wrote:

>
> On Mon, Feb 23, 2015 at 4:01 PM, Kostya Serebryany <kcc at google.com> wrote:
>
>> Indeed, Chandler, I actually don't see why this could lead to false
>> positives? What do we miss?
>
>
> I didn't realize that Anna was using the literal 'isAllocaPromotable'
> function and nothing else. That much is safe.
>
> That function's name is a bit of a lie, we actually promote wildly more
> than what it accepts. That's what got me confused. Looking at the patch,
> the comments in the code also seemed confused -- it talks about these being
> "unlikely" when it should say "impossible". =]
>
>
Good point. I'll update the comment.


>
> Meta point: I find the 2 separate review threads very frustrating to
> follow at this point though, so if you want further discussion it would be
> much more useful to focus it in a single place.
>
>
> While this patch is a fine initial step, I continue to think that
> refactoring this stuff the way I proposed, and handling bounds checks much
> as discussed by Nuno and others, is the right long term strategy. The
> benefit provided here will be gotten for free as part of that along with
> *many* more benefits. I understand that this is much more work, but I don't
> want people to stop thinking about this because the easy cases at -O0 have
> been handled.
>

I agree with this long term strategy. I propose to continue the discussion
on the other thread. Dmitry is making steps in the right direction.

I'd like to commit this even though it might be obsolete after the more
aggressive analysis make it in since I'd like to have something that has
immediate benefits at -O0 and is on by default. We can re-evaluate having
this after the other patch is more mature.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150225/58f82158/attachment.html>


More information about the llvm-commits mailing list