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

Jun Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 10:24:42 PST 2023


jwanggit86 wrote:

Here is the machine code of the caller in z_return.ll at the beginning of SILowerI1Copies:
```assembly
bb.0 (%ir-block.0):
  ADJCALLSTACKUP 0, 0, implicit-def dead $scc
  %0:sreg_64 = SI_PC_ADD_REL_OFFSET target-flags(amdgpu-gotprel32-lo) @i1_func_void, target-flags(amdgpu-gotprel32-hi) @i1_func_void, implicit-def dead $scc
  %1:sreg_64_xexec = S_LOAD_DWORDX2_IMM killed %0:sreg_64, 0, 0 :: (dereferenceable invariant load (s64) from got, addrspace 4)
  %2:sgpr_128 = COPY $sgpr0_sgpr1_sgpr2_sgpr3
  $sgpr0_sgpr1_sgpr2_sgpr3 = COPY %2:sgpr_128
  SI_CALL_ISEL killed %1:sreg_64_xexec, @i1_func_void, , implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit-def $sgpr0_sgpr1
  ADJCALLSTACKDOWN 0, 0, implicit-def dead $scc
  **%3:vreg_1 = COPY $sgpr0_sgpr1**
  %5:sreg_64_xexec = COPY %3:vreg_1
  %4:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, %5:sreg_64_xexec, implicit $exec
  %6:sreg_64 = IMPLICIT_DEF
  %7:vreg_64 = COPY %6:sreg_64
  GLOBAL_STORE_BYTE killed %7:vreg_64, killed %4:vgpr_32, 0, 0, implicit $exec :: (volatile store (s8) into `ptr addrspace(1) undef`, addrspace 1)
  SI_RETURN
```
The insn starting with %3 would trigger the assert were it not for the new lines of code.

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


More information about the llvm-commits mailing list