summaryrefslogtreecommitdiff
path: root/test/CodeGen/NVPTX/ldu-i8.ll
diff options
context:
space:
mode:
authorJustin Holewinski <jholewinski@nvidia.com>2014-06-27 18:35:51 +0000
committerJustin Holewinski <jholewinski@nvidia.com>2014-06-27 18:35:51 +0000
commitcb8f98382be7361c94439f48ec9b297e4d70c49e (patch)
tree6d7106e3c82873d46121fbb09453a5a2fd92c80e /test/CodeGen/NVPTX/ldu-i8.ll
parent899227441241fda27d9c9eaf9143d533fff75559 (diff)
downloadllvm-cb8f98382be7361c94439f48ec9b297e4d70c49e.tar.gz
llvm-cb8f98382be7361c94439f48ec9b297e4d70c49e.tar.bz2
llvm-cb8f98382be7361c94439f48ec9b297e4d70c49e.tar.xz
[NVPTX] Fix handling of ldg/ldu intrinsics.
The address space of the pointer must be global (1) for these intrinsics. There must also be alignment metadata attached to the intrinsic calls, e.g. %val = tail call i32 @llvm.nvvm.ldu.i.global.i32.p1i32(i32 addrspace(1)* %ptr), !align !0 !0 = metadata !{i32 4} git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/NVPTX/ldu-i8.ll')
-rw-r--r--test/CodeGen/NVPTX/ldu-i8.ll6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/CodeGen/NVPTX/ldu-i8.ll b/test/CodeGen/NVPTX/ldu-i8.ll
index 81a82b2c38..9cc6675579 100644
--- a/test/CodeGen/NVPTX/ldu-i8.ll
+++ b/test/CodeGen/NVPTX/ldu-i8.ll
@@ -2,13 +2,15 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
-declare i8 @llvm.nvvm.ldu.global.i.i8(i8*)
+declare i8 @llvm.nvvm.ldu.global.i.i8.p0i8(i8*)
define i8 @foo(i8* %a) {
; Ensure we properly truncate off the high-order 24 bits
; CHECK: ldu.global.u8
; CHECK: cvt.u32.u16
; CHECK: and.b32 %r{{[0-9]+}}, %r{{[0-9]+}}, 255
- %val = tail call i8 @llvm.nvvm.ldu.global.i.i8(i8* %a)
+ %val = tail call i8 @llvm.nvvm.ldu.global.i.i8.p0i8(i8* %a), !align !0
ret i8 %val
}
+
+!0 = metadata !{i32 4}