[llvm-commits] PATCH: Move the global-copy-to-alloca optimization to InstCombine

Chandler Carruth chandlerc at gmail.com
Tue Aug 21 01:43:57 PDT 2012


On Mon, Aug 20, 2012 at 9:48 AM, Chris Lattner <clattner at apple.com> wrote:

>
> On Aug 20, 2012, at 2:27 AM, Chandler Carruth <chandlerc at gmail.com> wrote:
>
> > Hello,
> >
> > I've been hacking on SROA a lot (email coming up on that front..) and
> one of the oddities is that SROA is doing a very instcombine-like
> optimization. I was able to move it over to InstCombine w/o touching any
> other aspect of SROA. It simplifies the model of SROA a bit, and also the
> optimization works much better in the instcombine framework: this is about
> nuking one instruction, and replacing it with another.
>
> Makes sense to me.


Thanks, r162271.


> Can pointsToConstantGlobal be simplified with Value::stripInBoundsOffsets ?
>

It's not clear to me that this would be an improvement...
pointsToConstantGlobal get's to cheat pretty spectacularly by only ever
handling constant expressions. It's also pretty simple. Any particular
reason to write it using the more general value stripping? We'd still have
almost as much code in order to assert that it was still a constant
expression.


>
> -Chris
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120821/cebc713f/attachment.html>


More information about the llvm-commits mailing list