[LLVMdev] PROPOSAL: struct-access-path aware TBAA

Daniel Berlin dberlin at dberlin.org
Tue Mar 12 18:02:37 PDT 2013

On Tue, Mar 12, 2013 at 5:56 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:
> Maybe I were not clear in my previous mail, or maybe we are talking about
> different topics.
> My point was, if the pair of memory accesses are direct access,  in most
> cases, the base/offset/size
> should be able to sufficient to figure out if they are alias or not.

It's about 60% of cases, the last time I ran the numbers on GCC.
Base + offset isn't as useful as it used to be given how today's
languages are lowered.

>  A
> tricky case would be
> subscripped variables, like a.b[i][j] vs a.c[m][n] where a.c and b.c are
> enclosed in a common union.
>  If mem-dep test failure to figure out if there is dependence, in that case,
> TBAA might help.
>  It seems what we discussing here is somewhat deviating the original
> topic:-)
Yes :)

>>>   If the both memory accesses are direct
>>> load/store,
>>> it dose not even need TBAA, check their base/offset/size is sufficient
>>> for
>>> disambiguation.
>> False, in a lot of cases.  For starters, roughly any union including
>> aggregate, you will have overlaps that can be disambiguated using TBAA
>> but not otherwise.

More information about the llvm-dev mailing list