Skip to content

Commit b6cddea

Browse files
committed
[AIE2PS] Fixup L spill test to not use CSR register for return
The test was using CSR registers for function returns which led to the reload happening before the PseudoRET where it would have to be afterwards for a normal use. We ended up returning the l register that was saved from the caller function instead of the one defined inside the function. This fixes the test to show realistic MIR where the register is used by a KILL instruction instead of the PseudoRET, now the reload happens after the KILL and right before the return restoring the CSR value coming from the caller.
1 parent 0310752 commit b6cddea

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

llvm/test/CodeGen/AIE/aie2ps/spill/spill-reload-l.mir

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@ body: |
3636
; CHECK-NEXT: ST_dms_sts_scalar_spill killed $r3, -48, implicit $sp :: (store (s32) into %stack.0)
3737
; CHECK-NEXT: renamable $l7 = COPY $l0
3838
; CHECK-NEXT: PseudoJL 32, csr_aie2ps, implicit-def $lr
39-
; CHECK-NEXT: $r1 = LDA_dms_lda_scalar_spill -48, implicit $sp :: (load (s32) from %stack.0)
39+
; CHECK-NEXT: renamable $l0 = KILL killed renamable $l7, implicit $l4, implicit $r11, implicit $l5, implicit $l6
40+
; CHECK-NEXT: $r3 = LDA_dms_lda_scalar_spill -48, implicit $sp :: (load (s32) from %stack.0)
4041
; CHECK-NEXT: $l7 = LDA_dml_lda_scalar_L_spill -56, implicit $sp :: (load (s64) from %stack.2)
4142
; CHECK-NEXT: $lr = LDA_dms_lda_scalar_spill -44, implicit $sp :: (load (s32) from %stack.1)
4243
; CHECK-NEXT: frame-destroy PADDXM_pstm_sp_imm -64, implicit-def $sp, implicit $sp
43-
; CHECK-NEXT: PseudoRET implicit $lr, implicit killed renamable $r1, implicit killed renamable $l7, implicit $l4, implicit $r11, implicit $l5, implicit $l6
44+
; CHECK-NEXT: PseudoRET implicit $lr, implicit killed renamable $r3, implicit killed renamable $l0
4445
%0:er = LDA_dms_lda_scalar_spill %fixed-stack.0, implicit $sp
4546
%1:el = COPY $l0
4647
PseudoJL 32, csr_aie2ps, implicit-def $lr
47-
PseudoRET implicit $lr, implicit %0, implicit %1, implicit $l4, implicit $r11, implicit $l5, implicit $l6
48+
%2:el = KILL %1, implicit $l4, implicit $r11, implicit $l5, implicit $l6
49+
PseudoRET implicit $lr, implicit %0, implicit %2
4850
...
4951

5052

0 commit comments

Comments
 (0)