[NVPTX] kernel pointer arguments point to the global address space
authorJingyue Wu <jingyue@google.com>
Thu, 4 Jun 2015 20:19:38 +0000 (20:19 +0000)
committerJingyue Wu <jingyue@google.com>
Thu, 4 Jun 2015 20:19:38 +0000 (20:19 +0000)
commitf3a8079b75448d7db19a4333c0bc218564ac6556
tree1f31ff8d3d5ae40f4523a13613b5c1d5e058e5c3
parent074da9b5e7201ceaed997a1ff2eab4464b62da4c
[NVPTX] kernel pointer arguments point to the global address space

Summary:
With this patch, NVPTXLowerKernelArgs converts a kernel pointer argument to a
pointer in the global address space. This change, along with
NVPTXFavorNonGenericAddrSpaces, allows the NVPTX backend to emit ld.global.*
and st.global.* for accessing kernel pointer arguments.

Minor changes:
1. refactor: extract function convertToPointerInAddrSpace
2. fix a bug in the test case in bug21465.ll

Test Plan: lower-kernel-ptr-arg.ll

Reviewers: eliben, meheff, jholewinski

Reviewed By: jholewinski

Subscribers: wengxt, jholewinski, llvm-commits

Differential Revision: http://reviews.llvm.org/D10154

llvm-svn: 239082
llvm/lib/Target/NVPTX/CMakeLists.txt
llvm/lib/Target/NVPTX/NVPTX.h
llvm/lib/Target/NVPTX/NVPTXLowerKernelArgs.cpp [new file with mode: 0644]
llvm/lib/Target/NVPTX/NVPTXLowerStructArgs.cpp [deleted file]
llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
llvm/test/CodeGen/NVPTX/bug21465.ll
llvm/test/CodeGen/NVPTX/call-with-alloca-buffer.ll
llvm/test/CodeGen/NVPTX/lower-kernel-ptr-arg.ll [new file with mode: 0644]
llvm/test/CodeGen/NVPTX/pr13291-i1-store.ll
llvm/test/CodeGen/NVPTX/surf-read-cuda.ll
llvm/test/CodeGen/NVPTX/tex-read-cuda.ll