[llvm] [AMDGPU] Allocate i1 argument to SGPRs (PR #72461)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 06:43:19 PDT 2024


================
@@ -0,0 +1,258 @@
+; RUN: llc -global-isel -stop-after=irtranslator -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -o - %s | FileCheck -check-prefixes=GFX9 -enable-var-scope %s
+; RUN: llc -global-isel -stop-after=irtranslator -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs -o - %s | FileCheck -check-prefixes=GFX11 -enable-var-scope %s
+
+define i1 @i1_func_void() {
+; GFX9-LABEL: name: i1_func_void
+; GFX9: bb.1 (%ir-block.0):
+; GFX9-NEXT:    [[DEF:%[0-9]+]]:_(p1) = G_IMPLICIT_DEF
+; GFX9-NEXT:    [[LOAD:%[0-9]+]]:_(s1) = G_LOAD [[DEF]](p1) :: (load (s1) from `ptr addrspace(1) undef`, addrspace 1)
+; GFX9-NEXT:    $sgpr0_sgpr1 = COPY [[LOAD]](s1)
----------------
arsenm wrote:

This looks good, except for the fact that it clobbers the scratch resource descriptor. The return SGPRs need to start beyond that (although really, this should be correct. We should move the SRD to CSR range, which is another ABI TODO).

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


More information about the llvm-commits mailing list