[PATCH] D124787: [NVPTX] Implement NVPTX AliasAnalysis

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 11:09:49 PST 2022


tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.

LGTM in general for LLVM as it is now. But...



================
Comment at: llvm/test/CodeGen/NVPTX/nvptx-aa.ll:82
+; CHECK-ALIAS: MayAlias: i8* %gen, i8 addrspace(1)* %global
+; CHECK-ALIAS: NoAlias:  i8 addrspace(1)* %global, i8 addrspace(101)* %param
+; CHECK-ALIAS: MayAlias: i8* %gen, i8 addrspace(101)* %param
----------------
Looks like recently PTX grew ability to convert .param to generic AS:
https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvta

AFAICT, when that happens, the address *may* be converted into a global pointer:
https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#generic-addressing says:

> The Kernel Function Parameters (.param) window is contained within the .global window.

So, technically, a global pointer *may* alias with a param pointer on some GPUs via ASC(param->generic->global).

The good news is that we don't have `cvta.param` implemented yet, so as things stand, there's no aliasing between param and global, but that will likely change in the future. We may want to either conservatively make them "mayAlias" from now on, or keep them as "NoAlias" for now with a TODO to make sure we update it when we get to implement `cvta.param` in lib/Target/NVPTX/NVPTXIntrinsics.td



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124787/new/

https://reviews.llvm.org/D124787



More information about the llvm-commits mailing list