[llvm-commits] PATCH: A new SROA implementation

Chandler Carruth chandlerc at gmail.com
Fri Sep 14 02:58:08 PDT 2012


Some responses that I didn't want to lose. By and large, I'm applying the
suggestions. There are many comments that boil down to "this function
should come from LLVM somewhere", and yes I agree. I plan to factor lots of
that out, but haven't gotten to that stage of cleanup. I did look first
though.

On Thu, Sep 13, 2012 at 1:32 PM, Duncan Sands <baldrick at free.fr> wrote:

> Urgh, what is the *U that turns up here?  Seems like breaking the
> abstraction.


It's actually used elsewhere as well. While the visitor is designed to
visit instructions, we actually want to visit the Use structure so we have
access to the used instruction as well as the user. The visitor stashes the
Use in the 'U' member. We use it more heavily in the subclasses, but this
assert helped track down some bugs.


> Above you seem to be assuming that the elements are naturally aligned,
> i.e. have
> alloc size equal to the size in bits.  I'm not sure that is guaranteed.
>

That's exactly what is guaranteed for vectors?


> Shouldn't this be EndOffset - 1?  (In which case it should be <= above).
>

No, we're building an end iterator here. We want to be one-past-the-end.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120914/06a3fe4c/attachment.html>


More information about the llvm-commits mailing list