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

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 27 13:45:39 PDT 2018


tra added inline comments.


================
Comment at: llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp:855
+                           CodeAddrSpace == NVPTX::PTXLdStInstCode::SHARED);
+  unsigned int PointerSize = (!TM.is64Bit() || UseShortPointers) ? 32 : 64;
+
----------------
bkramer wrote:
> There are 4 identical instances of the pointer size computation in this patch, it should really be pulled into its own function.
> 
> You can also consider getting the pointer size from the DataLayout instead. Might be cleaner.
That's indeed the right thing to do here. I've updated the patch to use DataLayout for determining pointer size.


https://reviews.llvm.org/D46147





More information about the llvm-commits mailing list