[PATCH] D89525: [amdgpu] Enhance AMDGPU AA.

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 13:58:20 PDT 2020


yaxunl added a comment.

In D89525#2335972 <https://reviews.llvm.org/D89525#2335972>, @rampitec wrote:

> In D89525#2335949 <https://reviews.llvm.org/D89525#2335949>, @yaxunl wrote:
>
>> I think they are correct for OpenCL, since in OpenCL shared var can only be declared in kernel function or passed by kernel arg.
>>
>> However I am not sure whether a constant pointer can pointer to shared memory, i.e, whether the address of a shared variable is compile time constant, or whether the following is valid code:
>>
>>   __shared__ int a;
>>   
>>   __constant__ int *b = &a;
>>
>> Currently clang allows it but nvcc does not https://godbolt.org/z/9W8vee
>>
>> I tends to agree with nvcc's treatment since this allows more flexible way of implementing shared variable supports in backend. @tra for advice
>
> But you are not checking for a constant pointer here!

In HIP `__constant__` is a variable attribute, not the address space of the pointee. `__constant__ int *` means a pointer itself in constant address space and pointing to generic/flat address space.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89525



More information about the llvm-commits mailing list