diff options
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll')
-rw-r--r-- | llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll b/llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll index 10dac31fec0..084a6933da2 100644 --- a/llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll +++ b/llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll @@ -164,6 +164,63 @@ define void @use_queue_ptr(i32 addrspace(1)* %ptr) #1 { ret void } +; HSA: define void @use_group_to_flat_addrspacecast(i32 addrspace(3)* %ptr) #11 { +define void @use_group_to_flat_addrspacecast(i32 addrspace(3)* %ptr) #1 { + %stof = addrspacecast i32 addrspace(3)* %ptr to i32 addrspace(4)* + store volatile i32 0, i32 addrspace(4)* %stof + ret void +} + +; HSA: define void @use_private_to_flat_addrspacecast(i32* %ptr) #11 { +define void @use_private_to_flat_addrspacecast(i32* %ptr) #1 { + %stof = addrspacecast i32* %ptr to i32 addrspace(4)* + store volatile i32 0, i32 addrspace(4)* %stof + ret void +} + +; HSA: define void @use_flat_to_group_addrspacecast(i32 addrspace(4)* %ptr) #1 { +define void @use_flat_to_group_addrspacecast(i32 addrspace(4)* %ptr) #1 { + %ftos = addrspacecast i32 addrspace(4)* %ptr to i32 addrspace(3)* + store volatile i32 0, i32 addrspace(3)* %ftos + ret void +} + +; HSA: define void @use_flat_to_private_addrspacecast(i32 addrspace(4)* %ptr) #1 { +define void @use_flat_to_private_addrspacecast(i32 addrspace(4)* %ptr) #1 { + %ftos = addrspacecast i32 addrspace(4)* %ptr to i32* + store volatile i32 0, i32* %ftos + ret void +} + +; No-op addrspacecast should not use queue ptr +; HSA: define void @use_global_to_flat_addrspacecast(i32 addrspace(1)* %ptr) #1 { +define void @use_global_to_flat_addrspacecast(i32 addrspace(1)* %ptr) #1 { + %stof = addrspacecast i32 addrspace(1)* %ptr to i32 addrspace(4)* + store volatile i32 0, i32 addrspace(4)* %stof + ret void +} + +; HSA: define void @use_constant_to_flat_addrspacecast(i32 addrspace(2)* %ptr) #1 { +define void @use_constant_to_flat_addrspacecast(i32 addrspace(2)* %ptr) #1 { + %stof = addrspacecast i32 addrspace(2)* %ptr to i32 addrspace(4)* + %ld = load volatile i32, i32 addrspace(4)* %stof + ret void +} + +; HSA: define void @use_flat_to_global_addrspacecast(i32 addrspace(4)* %ptr) #1 { +define void @use_flat_to_global_addrspacecast(i32 addrspace(4)* %ptr) #1 { + %ftos = addrspacecast i32 addrspace(4)* %ptr to i32 addrspace(1)* + store volatile i32 0, i32 addrspace(1)* %ftos + ret void +} + +; HSA: define void @use_flat_to_constant_addrspacecast(i32 addrspace(4)* %ptr) #1 { +define void @use_flat_to_constant_addrspacecast(i32 addrspace(4)* %ptr) #1 { + %ftos = addrspacecast i32 addrspace(4)* %ptr to i32 addrspace(2)* + %ld = load volatile i32, i32 addrspace(2)* %ftos + ret void +} + attributes #0 = { nounwind readnone } attributes #1 = { nounwind } |