[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)
commitbd11ccb2b9c5ff62a37893e47d338d1620f7ba08
tree1bd01291c4cc1ee914776048fc1b7f587e751ce0
parentbe031d9158aa3fbc87a5f9e2c1b4b74a414cd0b6
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243790 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/NVPTX/NVPTXLowerKernelArgs.cpp
test/CodeGen/NVPTX/lower-kernel-ptr-arg.ll