[LLVMdev] tbaa differences in llvm 3.0

Dan Gohman gohman at apple.com
Mon Jan 30 15:49:28 PST 2012


On Jan 30, 2012, at 11:49 AM, Maurice Marks wrote:

> In our case basicaa alone returns "may alias" on our pointers and we want to override that with tbaa data to "Wont alias" when we know that the pointers will never alias. So its not covered by your case.
> 
> Since the basicaa pass doesnt chain according to the llvm docs, it should have the last chance to affect the aliasing information, and that means it should be added  first. If so the existing code in addInitialAliasAnalysisPasses has them round the wrong way.

Ah, the docs were out of date. Basic-aa does chain now.

> On Sat, Jan 28, 2012 at 10:46 AM, Maurice Marks <maurice.marks at gmail.com> wrote:
> Many of our pointers point into a structure where they could be considered as having the same base address. We use tbaa to indicate which ones could or could not alias because they are pointing into different substructures. This is exactly the sort of requirement that invoked the need for the restrict modifier in g++, c++0x etc. If I understand you correctly that cannot be expressed in llvm ir because it would be overridden by basicaa being conservative, overriding the explicit metadata. Is that true?

Not quite; restrict cannot be represented in LLVM IR outside of
function arguments because LLVM IR has no representation of
scopes that would accurately describe the valid ranges of
restrict-qualified pointers.

Dan




More information about the llvm-dev mailing list