[llvm-commits] [pr12979][patch/rfc] Clear nsw/nuw in gvn

Duncan Sands baldrick at free.fr
Sat Jun 2 01:42:37 PDT 2012


Hi Nuno,

>> Oh, i don't disagree that least common ancestor is correct, it's what
>> we do in GCC.  I'm just pointing out the semantic you are suggesting
>> (loads in two different tbaa trees don't alias) is exactly the
>> opposite of what the semantic the language guide says :)
>>
>> So if we want to go with that, we should update the language guide to
>> state that we don't consider things from two different tbaa trees to
>> alias.
>
> Actually the documentation is correct regarding the implementation. (I just
> checked the TBAA code).
> Dan: is there any reason why pointers with different type roots are
> considered that they may alias?  It probably doesn't happen often anyway..

it happens all the time with dragonegg when doing LTO: since dragonegg gets
its alias information from GCC, and GCC has no way (as far as I know) of
identifying types universally in the sense that the same types in different
compilation units get the same identifier (i.e. same name in the TBAA tree),
each module produced by dragonegg has a TBAA tree with a distinct root node
that won't be merged when linking the modules together (this is achieved by
having the root node be self-referential).  However it may well be that types
from different modules are the same (you just can't tell) thus it is essential
that nodes in different TBAA trees are assumed to alias.

Ciao, Duncan.



More information about the llvm-commits mailing list