[PATCH] D124787: [NVPTX] Implement NVPTX AliasAnalysis
Andrew Savonichev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 12 07:39:49 PST 2022
asavonic added inline comments.
================
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
----------------
tra wrote:
> 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
>
Hmm.. this is unfortunate. If `param` is a subset of `global`, then it also cannot be treated as constant memory. I'll update `alias` and `getModRefInfoMask` functions to handle this.
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