[llvm] r211942 - [NVPTX] Add support for .managed variables for UVM
Justin Holewinski
jholewinski at nvidia.com
Fri Jun 27 11:35:59 PDT 2014
Author: jholewinski
Date: Fri Jun 27 13:35:58 2014
New Revision: 211942
URL: http://llvm.org/viewvc/llvm-project?rev=211942&view=rev
Log:
[NVPTX] Add support for .managed variables for UVM
Added:
llvm/trunk/test/CodeGen/NVPTX/managed.ll
Modified:
llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp?rev=211942&r1=211941&r2=211942&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp Fri Jun 27 13:35:58 2014
@@ -1480,6 +1480,11 @@ void NVPTXAsmPrinter::printModuleLevelGV
O << ".";
emitPTXAddressSpace(PTy->getAddressSpace(), O);
+
+ if (isManaged(*GVar)) {
+ O << " .attribute(.managed)";
+ }
+
if (GVar->getAlignment() == 0)
O << " .align " << (int) TD->getPrefTypeAlignment(ETy);
else
Added: llvm/trunk/test/CodeGen/NVPTX/managed.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/managed.ll?rev=211942&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/managed.ll (added)
+++ llvm/trunk/test/CodeGen/NVPTX/managed.ll Fri Jun 27 13:35:58 2014
@@ -0,0 +1,11 @@
+; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
+
+
+; CHECK: .visible .global .align 4 .u32 device_g;
+ at device_g = addrspace(1) global i32 zeroinitializer
+; CHECK: .visible .global .attribute(.managed) .align 4 .u32 managed_g;
+ at managed_g = addrspace(1) global i32 zeroinitializer
+
+
+!nvvm.annotations = !{!0}
+!0 = metadata !{i32 addrspace(1)* @managed_g, metadata !"managed", i32 1}
More information about the llvm-commits
mailing list