[PATCH] [AsmPrinter] handles addrspacecast in lowerConstant
Jingyue Wu
jingyue at google.com
Thu Apr 16 16:24:58 PDT 2015
Hi eliben, jholewinski,
http://reviews.llvm.org/D9063
Files:
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
test/CodeGen/NVPTX/addrspacecast-gvar.ll
Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp
===================================================================
--- lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1719,6 +1719,7 @@
// blockaddress labels. Since the two labels are in the same function, it
// is reasonable to treat their delta as a 32-bit value.
// FALL THROUGH.
+ case Instruction::AddrSpaceCast:
case Instruction::BitCast:
return lowerConstant(CE->getOperand(0));
Index: test/CodeGen/NVPTX/addrspacecast-gvar.ll
===================================================================
--- test/CodeGen/NVPTX/addrspacecast-gvar.ll
+++ test/CodeGen/NVPTX/addrspacecast-gvar.ll
@@ -3,7 +3,9 @@
; CHECK: .visible .global .align 4 .u32 g = 42;
; CHECK: .visible .global .align 4 .u32 g2 = generic(g);
; CHECK: .visible .global .align 4 .u32 g3 = g;
+; CHECK: .visible .global .align 8 .u32 g4[2] = {0, g+8};
@g = addrspace(1) global i32 42
@g2 = addrspace(1) global i32* addrspacecast (i32 addrspace(1)* @g to i32*)
@g3 = addrspace(1) global i32 addrspace(1)* @g
+ at g4 = constant {i32*, i32*} {i32* null, i32* getelementptr (i32, i32* addrspacecast (i32 addrspace(1)* @g to i32*), i32 2)}
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9063.23888.patch
Type: text/x-patch
Size: 1219 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150416/a147a22f/attachment.bin>
More information about the llvm-commits
mailing list