summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2016-06-21 20:46:20 +0000
committerJan Vesely <jan.vesely@rutgers.edu>2016-06-21 20:46:20 +0000
commitfea814d53101d06d6b9dbdba4df8886a4e284461 (patch)
tree58c3f40d885a5799e4e08b8e30ed4e800d4efe5e /llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll
parent78028b84d2293f9400023fce34ad13a5769a82c8 (diff)
downloadbcm5719-llvm-fea814d53101d06d6b9dbdba4df8886a4e284461.tar.gz
bcm5719-llvm-fea814d53101d06d6b9dbdba4df8886a4e284461.zip
AMDGPU: Add implicitarg.ptr intrinsic.
Points to the start of implicit arguments (appended after explicit arguments) Differential Revision: http://reviews.llvm.org/D20297 llvm-svn: 273317
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll')
-rw-r--r--llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll
index eaffe8c4699..07650d990f3 100644
--- a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll
+++ b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll
@@ -15,7 +15,20 @@ define void @test(i32 addrspace(1)* %out) #1 {
ret void
}
+; ALL-LABEL: {{^}}test_implicit:
+; 10 + 9 (36 prepended implicit bytes) + 2(out pointer) = 21 = 0x15
+; MESA: s_load_dword s{{[0-9]+}}, s[0:1], 0x15
+define void @test_implicit(i32 addrspace(1)* %out) #1 {
+ %implicitarg.ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.implicitarg.ptr()
+ %header.ptr = bitcast i8 addrspace(2)* %implicitarg.ptr to i32 addrspace(2)*
+ %gep = getelementptr i32, i32 addrspace(2)* %header.ptr, i64 10
+ %value = load i32, i32 addrspace(2)* %gep
+ store i32 %value, i32 addrspace(1)* %out
+ ret void
+}
+
declare i8 addrspace(2)* @llvm.amdgcn.kernarg.segment.ptr() #0
+declare i8 addrspace(2)* @llvm.amdgcn.implicitarg.ptr() #0
attributes #0 = { nounwind readnone }
attributes #1 = { nounwind }
OpenPOWER on IntegriCloud