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

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D117243
This commit is contained in:
Venkata Ramanaiah Nalamothu 2022-01-14 02:56:51 +05:30
parent bef3eb8344
commit 0bcd9f60cd
1 changed files with 26 additions and 0 deletions

View File

@ -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 }