[PATCH] D46147: [NVPTX] Added a feature to use short pointers for const/local/shared AS.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 27 14:34:47 PDT 2018


arsenm added a comment.

In https://reviews.llvm.org/D46147#1081660, @tra wrote:

> In https://reviews.llvm.org/D46147#1081632, @arsenm wrote:
>
> > NVPTX wasn't already doing this? As this is a module property, a subtarget feature can't be used for this. For example what happens for a global value?
>
>
> No, NVPTX is always using 64-bit pointers for all address spaces and that's one of the common situations where it gives NVCC an edge.
>
> It's not clear what concerns you about global values. Could you elaborate or give me an example?


The subtarget is a function level property. The pointer size / datalayout is a module property and can't be different between functions. If you have multiple functions with different pointer sizes in a module (or no functions at all), then what pointer size ends up used for a global? The global itself has a size, and any ConstantExpr pointers in its initializer will also need to have a size.


https://reviews.llvm.org/D46147





More information about the llvm-commits mailing list