[llvm] [AMDGPU] Don't send DEALLOC_VGPRs after calls (PR #77439)

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 10 04:26:24 PST 2024


================
@@ -582,3 +583,19 @@ body:             |
     $sgpr30_sgpr31 = SI_CALL undef renamable $sgpr4_sgpr5, 0, csr_amdgpu
     S_ENDPGM 0
 ...
+
+---
+name:            with_tail_calls
+frameInfo:
+  hasCalls:        true
+body:             |
+  bb.0:
+    ; Make sure we don't send DEALLOC_VGPRS after a tail call, since there might be
+    ; scratch stores still in progress.
+    ; CHECK-LABEL: name: with_tail_calls
+    ; CHECK-NOT: S_SENDMSG 3
+    ; CHECK: S_ENDPGM 0
+    GLOBAL_STORE_DWORD undef renamable $vgpr0_vgpr1, killed renamable $vgpr1, 0, 4, implicit $exec
+    SI_TCRETURN undef renamable $sgpr4_sgpr5, @with_tail_calls, 0, csr_amdgpu
+    S_ENDPGM 0
----------------
rovka wrote:

Oops, I didn't think that through. If there's no S_ENDPGM, we would never try to send DEALLOC_VGPRS in the first place. But I can update the test anyway, just so we can have this case covered for the future.

https://github.com/llvm/llvm-project/pull/77439


More information about the llvm-commits mailing list