[LLVMdev] Alias Analysis Problem in LICM

Dan Gohman gohman at apple.com
Tue Nov 8 16:17:58 PST 2011


On Nov 7, 2011, at 10:17 PM, Gan wrote:

>> Yes.  The current TBAA implementation is conservative, with the idea that it
>> can become more aggressive (and with TBAA, this fundamentally means
>> "more dangerous") with incremental steps.
> 
> Dan,
> 
> Could you disclose more details about how to implement the "incremental steps"
> to handle more complicated alias cases? For example, differentiate
> different pointers
> that point to different types. and use this information to improve
> alias analysis accuracy?

Yes. It's almost all up to the front-end. Find the place in clang
where it emits the "any pointer" metadata, and implement something
better.

> 
>> It's interesting to note that clang's own source code is known to violate the TBAA
>> rules for pointers (it's thought to be unlikely to cause trouble in practice).  There
>> are reasons for caution in this area.
> 
> I don't get your point here. What "TBAA rules" are violated by
> "clang's own source code"?
> Where does this violation happen? and what caution we should have in this area?

Clang frequently casts the addresses of Stmt* objects to Expr**
before dereferencing them. C++'s TBAA rules don't permit this.

Dan




More information about the llvm-dev mailing list