OSDN Git Service

[NVPTX] Add NVVMReflect pass to allow compile-time selection of
authorJustin Holewinski <jholewinski@nvidia.com>
Sat, 30 Mar 2013 14:29:25 +0000 (14:29 +0000)
committerJustin Holewinski <jholewinski@nvidia.com>
Sat, 30 Mar 2013 14:29:25 +0000 (14:29 +0000)
commit21fdcb02716f5eae097abfd2f44e40563e90180a
treea22b3d6bd88893175984ae4e699c41b9ccad8b55
parent3639ce2575660a0e6938d2e84e8bd9a738fd7051
[NVPTX] Add NVVMReflect pass to allow compile-time selection of
specific code paths.

This allows us to write code like:

  if (__nvvm_reflect("FOO"))
    // Do something
  else
    // Do something else

and compile into a library, then give "FOO" a value at kernel
compile-time so the check becomes a no-op.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178416 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/NVPTX/CMakeLists.txt
lib/Target/NVPTX/NVPTXTargetMachine.cpp
lib/Target/NVPTX/NVVMReflect.cpp [new file with mode: 0644]
test/CodeGen/NVPTX/nvvm-reflect.ll [new file with mode: 0644]