[llvm] AMDGPU/GlobalISel: Handle inreg arguments as SGPRs (PR #78123)
Jun Wang via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 15 13:52:18 PST 2024
================
@@ -2777,4 +2777,462 @@ define void @vector_ptr_in_struct_arg({ <2 x ptr addrspace(1)>, <2 x ptr addrspa
ret void
}
+define void @void_func_i1_inreg(i1 inreg %arg0) #0 {
+ ; CHECK-LABEL: name: void_func_i1_inreg
+ ; CHECK: bb.1 (%ir-block.0):
+ ; CHECK-NEXT: liveins: $sgpr0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
+ ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[COPY]](s32)
+ ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(p1) = G_IMPLICIT_DEF
+ ; CHECK-NEXT: G_STORE [[TRUNC]](s1), [[DEF]](p1) :: (store (s1) into `ptr addrspace(1) undef`, addrspace 1)
+ ; CHECK-NEXT: SI_RETURN
+ store i1 %arg0, ptr addrspace(1) undef
+ ret void
+}
+
+define void @void_func_i8_inreg(i8 inreg %arg0) #0 {
+ ; CHECK-LABEL: name: void_func_i8_inreg
+ ; CHECK: bb.1 (%ir-block.0):
+ ; CHECK-NEXT: liveins: $sgpr0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
----------------
jwanggit86 wrote:
For some GPUs, isn't it true that sgpr0-spgr3 are reserved?
https://github.com/llvm/llvm-project/pull/78123
More information about the llvm-commits
mailing list