[NVPTX] convert pointers in byval kernel arguments to global
authorJingyue Wu <jingyue@google.com>
Fri, 31 Jul 2015 21:44:14 +0000 (21:44 +0000)
committerJingyue Wu <jingyue@google.com>
Fri, 31 Jul 2015 21:44:14 +0000 (21:44 +0000)
commitcf70053b2066d0bb647aec91f6fe5934f5b48d5e
treee4d4ccfa6e6d3bc29082c9a88c6cff6fe16240cf
parentc5b53c7819b410a34a9e1559beed4f3d6e54cff4
[NVPTX] convert pointers in byval kernel arguments to global

Summary:
For example, in

  struct S {
    int *x;
    int *y;
  };
  __global__ void foo(S s) {
    int *b = s.y;
    // use b
  }

"b" is guaranteed to point to global. NVPTX should emit ld.global/st.global for
accessing "b".

Reviewers: jholewinski

Subscribers: llvm-commits, jholewinski

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

llvm-svn: 243790
llvm/lib/Target/NVPTX/NVPTXLowerKernelArgs.cpp
llvm/test/CodeGen/NVPTX/lower-kernel-ptr-arg.ll