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

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


This revision was automatically updated to reflect the committed changes.
Closed by commit rG0bcd9f60cd0d: [AMDGPU] Ensure return address is save/restored around the call with IPRA… (authored by RamNalamothu).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117243/new/

https://reviews.llvm.org/D117243

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


Index: llvm/test/CodeGen/AMDGPU/ipra.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/ipra.ll
+++ llvm/test/CodeGen/AMDGPU/ipra.ll
@@ -105,5 +105,31 @@
   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 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117243.399775.patch
Type: text/x-patch
Size: 1018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220113/2b62e971/attachment.bin>


More information about the llvm-commits mailing list