[llvm-dev] InstCombine GEP

Daniel Berlin via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 14 07:30:02 PDT 2017


On Thu, Aug 10, 2017 at 10:24 AM, Sanjoy Das via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi Ashutosh,
>
> On Thu, Aug 10, 2017 at 12:22 AM, Nema, Ashutosh via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > I’m not sure how transforming GEP offset to i8 type will help alias
> analysis
> > & SROA for the mentioned test case.
>
> It should neither help nor hinder AA or SROA -- the two GEPs (the
> complex one and the simple one) are equivalent.  Since memory isn't
> typed in LLVM, having the GEP in terms of %struct.ABC does not provide
> any extra information.
>

FWIW: Having memory be untyped strongly hinders field sensitive analysis :)
It's okay for non, obviously.

I also get the desire to avoid bitcasts.
But field-sensitive analysis of any sort requires knowing that memory has
structures and arrays, and we've said "no it doesn't :)

So either you spend all your time trying to recover that based on the
indexing operations you see(at precision loss), provide metadata and base
your analysis on the metadata (which must stay semantically correct, since
you are effectively ignoring the addressing operation), or give up.
(Analyses like DSA attempt to recover it).

We already miss pretty basic field aliasing cases in C++ due to the above :(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170814/bd36a6ee/attachment.html>


More information about the llvm-dev mailing list