[PATCH] D12414: [NVPTX] add an NVPTX-specific alias analysis

Jingyue Wu via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 6 22:14:04 PDT 2015


jingyue added inline comments.

================
Comment at: lib/Target/NVPTX/NVPTXAliasAnalysis.cpp:71
@@ +70,3 @@
+      if (auto A = dyn_cast<Argument>(Obj)) {
+        if (TM && TM->getDrvInterface() == NVPTX::CUDA &&
+            isKernelFunction(*A->getParent()))
----------------
hfinkel wrote:
> Can you please explain why this DvrInterface == CUDA check is necessary? isKernelFunction always checks for NVVM metadata, and lacking that, a specific calling convention. Is that not enough?
> 
Sure. As mentioned in the comment, if `Obj` is a **CUDA** kernel parameter, it must reside in global memory. But if the driver interface is NVCL, for example, a kernel parameter is not guaranteed to point to global memory. 

This is also why we have a similar check in `NVPTXLowerKernelArgs`: https://github.com/llvm-mirror/llvm/blob/master/lib/Target/NVPTX/NVPTXLowerKernelArgs.cpp#L201. 


http://reviews.llvm.org/D12414





More information about the llvm-commits mailing list