From 9166ce86e83900d2671b66707461d05e7bf9739a Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 28 Jul 2017 15:52:08 +0000 Subject: AMDGPU: Annotate implicitarg.ptr usage We need to pass something to functions for this to work. It isn't derivable just from the kernarg segment pointer because the implicit arguments are placed after the kernel arguments. Also fixes missing test for the intrinsic. llvm-svn: 309398 --- .../AMDGPU/annotate-kernel-features-hsa-call.ll | 30 ++++++++++++++-------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll') diff --git a/llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll b/llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll index e9797eff712..51cd6c43e03 100644 --- a/llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll +++ b/llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll @@ -237,52 +237,59 @@ define void @func_indirect_use_kernarg_segment_ptr() #1 { ret void } -; HSA: define void @use_implicitarg_ptr() #14 { +; HSA: define amdgpu_kernel void @kern_use_implicitarg_ptr() #15 { +define amdgpu_kernel void @kern_use_implicitarg_ptr() #1 { + %implicitarg.ptr = call i8 addrspace(2)* @llvm.amdgcn.implicitarg.ptr() + store volatile i8 addrspace(2)* %implicitarg.ptr, i8 addrspace(2)* addrspace(1)* undef + ret void +} + +; HSA: define void @use_implicitarg_ptr() #15 { define void @use_implicitarg_ptr() #1 { %implicitarg.ptr = call i8 addrspace(2)* @llvm.amdgcn.implicitarg.ptr() store volatile i8 addrspace(2)* %implicitarg.ptr, i8 addrspace(2)* addrspace(1)* undef ret void } -; HSA: define void @func_indirect_use_implicitarg_ptr() #14 { +; HSA: define void @func_indirect_use_implicitarg_ptr() #15 { define void @func_indirect_use_implicitarg_ptr() #1 { call void @use_implicitarg_ptr() ret void } -; HSA: declare void @external.func() #15 +; HSA: declare void @external.func() #16 declare void @external.func() #3 -; HSA: define internal void @defined.func() #15 { +; HSA: define internal void @defined.func() #16 { define internal void @defined.func() #3 { ret void } -; HSA: define void @func_call_external() #15 { +; HSA: define void @func_call_external() #16 { define void @func_call_external() #3 { call void @external.func() ret void } -; HSA: define void @func_call_defined() #15 { +; HSA: define void @func_call_defined() #16 { define void @func_call_defined() #3 { call void @defined.func() ret void } -; HSA: define void @func_call_asm() #15 { +; HSA: define void @func_call_asm() #16 { define void @func_call_asm() #3 { call void asm sideeffect "", ""() #3 ret void } -; HSA: define amdgpu_kernel void @kern_call_external() #16 { +; HSA: define amdgpu_kernel void @kern_call_external() #17 { define amdgpu_kernel void @kern_call_external() #3 { call void @external.func() ret void } -; HSA: define amdgpu_kernel void @func_kern_defined() #16 { +; HSA: define amdgpu_kernel void @func_kern_defined() #17 { define amdgpu_kernel void @func_kern_defined() #3 { call void @defined.func() ret void @@ -308,5 +315,6 @@ attributes #3 = { nounwind } ; HSA: attributes #12 = { nounwind "target-cpu"="gfx900" } ; HSA: attributes #13 = { nounwind "amdgpu-queue-ptr" "target-cpu"="gfx900" } ; HSA: attributes #14 = { nounwind "amdgpu-kernarg-segment-ptr" "target-cpu"="fiji" } -; HSA: attributes #15 = { nounwind } -; HSA: attributes #16 = { nounwind "amdgpu-flat-scratch" } +; HSA: attributes #15 = { nounwind "amdgpu-implicitarg-ptr" "target-cpu"="fiji" } +; HSA: attributes #16 = { nounwind } +; HSA: attributes #17 = { nounwind "amdgpu-flat-scratch" } -- cgit v1.2.3