[llvm] 0bcd9f6 - [AMDGPU] Ensure return address is save/restored around the call with IPRA enabled/disabled

Venkata Ramanaiah Nalamothu via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 13:39:09 PST 2022


Author: Venkata Ramanaiah Nalamothu
Date: 2022-01-14T03:09:03+05:30
New Revision: 0bcd9f60cd0d6219d5bfa6a0d58d4b5b99f65773

URL: https://github.com/llvm/llvm-project/commit/0bcd9f60cd0d6219d5bfa6a0d58d4b5b99f65773
DIFF: https://github.com/llvm/llvm-project/commit/0bcd9f60cd0d6219d5bfa6a0d58d4b5b99f65773.diff

LOG: [AMDGPU] Ensure return address is save/restored around the call with IPRA enabled/disabled

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D117243

Added: 
    

Modified: 
    llvm/test/CodeGen/AMDGPU/ipra.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/AMDGPU/ipra.ll b/llvm/test/CodeGen/AMDGPU/ipra.ll
index 1466d3b76bec..59ca0d9492ad 100644
--- a/llvm/test/CodeGen/AMDGPU/ipra.ll
+++ b/llvm/test/CodeGen/AMDGPU/ipra.ll
@@ -105,5 +105,31 @@ define void @test_funcx2() #0 {
   ret void
 }
 
+define weak amdgpu_kernel void @wombat(i32* %arg, i32* %arg2) {
+bb:
+  call void @hoge() #0
+  ret void
+}
+
+; Make sure we save/restore the return address around the call.
+; Function Attrs: norecurse
+define internal void @hoge() #2 {
+bb:
+; GCN-LABEL: {{^}}hoge:
+; GCN-DAG: v_writelane_b32 [[CSR_VGPR:v[0-9]+]], s30,
+; GCN-DAG: v_writelane_b32 [[CSR_VGPR]], s31,
+; GCN: s_swappc_b64 s[30:31]
+; GCN-DAG: v_readlane_b32 s4, [[CSR_VGPR]],
+; GCN-DAG: v_readlane_b32 s5, [[CSR_VGPR]],
+; GCN: s_waitcnt vmcnt(0)
+; GCN: s_setpc_b64 s[4:5]
+  call void @eggs()
+  ret void
+}
+
+declare dso_local void @eggs()
+
+
 attributes #0 = { nounwind }
 attributes #1 = { nounwind noinline "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" }
+attributes #2 = { norecurse }


        


More information about the llvm-commits mailing list