Aliasing of pointers from different address spaces


Can I configure address spaces aliasing for my specific target?
I found this discussion (!topic/llvm-dev/0ZbzzN6t05o) , where James says “pointers in different address spaces cannot alias”,
but it is not what I see in the code.
I looked for a way to customize address spaces separation in Target, but I can’t find.
Any thoughts?

  • Elena

Hi, Elena,

You’re correct. We do assume that pointers in different address spaces can alias.

Targets can add their own AA pass into the AA query chain, and one of the things such analysis passes can do account for target-specific knowledge of address-space semantics. For example, see lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp


Thank you. That’s, probably, what I was looking for.

In this case


will return the target-configured AAResults, right?

I’m asking, because I want to use this analysis within a standard pass, LICM, for example.