Skip to content

Commit

Permalink
[RISCV][CFI] update tests after fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dlav-sc committed Oct 16, 2024
1 parent 907fa43 commit 362a051
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 10 deletions.
10 changes: 8 additions & 2 deletions llvm/test/CodeGen/RISCV/GlobalISel/vararg.ll
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ define i32 @va1(ptr %fmt, ...) {
; RV32-WITHFP-NEXT: addi a1, a0, 4
; RV32-WITHFP-NEXT: sw a1, -12(s0)
; RV32-WITHFP-NEXT: lw a0, 0(a0)
; RV32-WITHFP-NEXT: .cfi_def_cfa sp, 48
; RV32-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
; RV32-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
; RV32-WITHFP-NEXT: .cfi_restore ra
Expand Down Expand Up @@ -149,6 +150,7 @@ define i32 @va1(ptr %fmt, ...) {
; RV64-WITHFP-NEXT: sw a1, -24(s0)
; RV64-WITHFP-NEXT: sw a2, -20(s0)
; RV64-WITHFP-NEXT: lw a0, 0(a0)
; RV64-WITHFP-NEXT: .cfi_def_cfa sp, 96
; RV64-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
; RV64-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
; RV64-WITHFP-NEXT: .cfi_restore ra
Expand Down Expand Up @@ -1692,7 +1694,7 @@ define i32 @va_large_stack(ptr %fmt, ...) {
; RV32-WITHFP-NEXT: lui a1, 24414
; RV32-WITHFP-NEXT: addi a1, a1, -1728
; RV32-WITHFP-NEXT: add sp, sp, a1
; RV32-WITHFP-NEXT: .cfi_def_cfa_offset 2032
; RV32-WITHFP-NEXT: .cfi_def_cfa sp, 2032
; RV32-WITHFP-NEXT: lw ra, 1996(sp) # 4-byte Folded Reload
; RV32-WITHFP-NEXT: lw s0, 1992(sp) # 4-byte Folded Reload
; RV32-WITHFP-NEXT: .cfi_restore ra
Expand Down Expand Up @@ -1738,7 +1740,7 @@ define i32 @va_large_stack(ptr %fmt, ...) {
; RV64-WITHFP-NEXT: lui a1, 24414
; RV64-WITHFP-NEXT: addiw a1, a1, -1680
; RV64-WITHFP-NEXT: add sp, sp, a1
; RV64-WITHFP-NEXT: .cfi_def_cfa_offset 2032
; RV64-WITHFP-NEXT: .cfi_def_cfa sp, 2032
; RV64-WITHFP-NEXT: ld ra, 1960(sp) # 8-byte Folded Reload
; RV64-WITHFP-NEXT: ld s0, 1952(sp) # 8-byte Folded Reload
; RV64-WITHFP-NEXT: .cfi_restore ra
Expand Down Expand Up @@ -1811,6 +1813,7 @@ define iXLen @va_vprintf(ptr %fmt, ptr %arg_start) {
; RV32-WITHFP-NEXT: addi a1, a0, 4
; RV32-WITHFP-NEXT: sw a1, -16(s0)
; RV32-WITHFP-NEXT: lw a0, 0(a0)
; RV32-WITHFP-NEXT: .cfi_def_cfa sp, 16
; RV32-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
; RV32-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
; RV32-WITHFP-NEXT: .cfi_restore ra
Expand Down Expand Up @@ -1838,6 +1841,7 @@ define iXLen @va_vprintf(ptr %fmt, ptr %arg_start) {
; RV64-WITHFP-NEXT: addi a1, a0, 8
; RV64-WITHFP-NEXT: sd a1, -32(s0)
; RV64-WITHFP-NEXT: ld a0, 0(a0)
; RV64-WITHFP-NEXT: .cfi_def_cfa sp, 32
; RV64-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
; RV64-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
; RV64-WITHFP-NEXT: .cfi_restore ra
Expand Down Expand Up @@ -1922,6 +1926,7 @@ define i32 @va_printf(ptr %fmt, ...) {
; RV32-WITHFP-NEXT: sw a6, 24(s0)
; RV32-WITHFP-NEXT: sw a7, 28(s0)
; RV32-WITHFP-NEXT: call va_vprintf
; RV32-WITHFP-NEXT: .cfi_def_cfa sp, 48
; RV32-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
; RV32-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
; RV32-WITHFP-NEXT: .cfi_restore ra
Expand Down Expand Up @@ -1951,6 +1956,7 @@ define i32 @va_printf(ptr %fmt, ...) {
; RV64-WITHFP-NEXT: sd a6, 48(s0)
; RV64-WITHFP-NEXT: sd a7, 56(s0)
; RV64-WITHFP-NEXT: call va_vprintf
; RV64-WITHFP-NEXT: .cfi_def_cfa sp, 96
; RV64-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
; RV64-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
; RV64-WITHFP-NEXT: .cfi_restore ra
Expand Down
12 changes: 12 additions & 0 deletions llvm/test/CodeGen/RISCV/callee-saved-gprs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2503,6 +2503,7 @@ define void @foo() {
; RV32I-WITH-FP-NEXT: #APP
; RV32I-WITH-FP-NEXT: li s4, 0
; RV32I-WITH-FP-NEXT: #NO_APP
; RV32I-WITH-FP-NEXT: .cfi_def_cfa sp, 16
; RV32I-WITH-FP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
; RV32I-WITH-FP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
; RV32I-WITH-FP-NEXT: lw s4, 4(sp) # 4-byte Folded Reload
Expand Down Expand Up @@ -2541,6 +2542,7 @@ define void @foo() {
; RV32IZCMP-WITH-FP-NEXT: #APP
; RV32IZCMP-WITH-FP-NEXT: li s4, 0
; RV32IZCMP-WITH-FP-NEXT: #NO_APP
; RV32IZCMP-WITH-FP-NEXT: .cfi_def_cfa sp, 16
; RV32IZCMP-WITH-FP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
; RV32IZCMP-WITH-FP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
; RV32IZCMP-WITH-FP-NEXT: lw s4, 4(sp) # 4-byte Folded Reload
Expand Down Expand Up @@ -2588,6 +2590,7 @@ define void @foo() {
; RV64I-WITH-FP-NEXT: #APP
; RV64I-WITH-FP-NEXT: li s4, 0
; RV64I-WITH-FP-NEXT: #NO_APP
; RV64I-WITH-FP-NEXT: .cfi_def_cfa sp, 32
; RV64I-WITH-FP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
; RV64I-WITH-FP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
; RV64I-WITH-FP-NEXT: ld s4, 8(sp) # 8-byte Folded Reload
Expand Down Expand Up @@ -2626,6 +2629,7 @@ define void @foo() {
; RV64IZCMP-WITH-FP-NEXT: #APP
; RV64IZCMP-WITH-FP-NEXT: li s4, 0
; RV64IZCMP-WITH-FP-NEXT: #NO_APP
; RV64IZCMP-WITH-FP-NEXT: .cfi_def_cfa sp, 32
; RV64IZCMP-WITH-FP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
; RV64IZCMP-WITH-FP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
; RV64IZCMP-WITH-FP-NEXT: ld s4, 8(sp) # 8-byte Folded Reload
Expand Down Expand Up @@ -2679,6 +2683,7 @@ define void @bar() {
; RV32I-WITH-FP-NEXT: #APP
; RV32I-WITH-FP-NEXT: li s11, 0
; RV32I-WITH-FP-NEXT: #NO_APP
; RV32I-WITH-FP-NEXT: .cfi_def_cfa sp, 16
; RV32I-WITH-FP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
; RV32I-WITH-FP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
; RV32I-WITH-FP-NEXT: lw s11, 4(sp) # 4-byte Folded Reload
Expand Down Expand Up @@ -2717,6 +2722,7 @@ define void @bar() {
; RV32IZCMP-WITH-FP-NEXT: #APP
; RV32IZCMP-WITH-FP-NEXT: li s11, 0
; RV32IZCMP-WITH-FP-NEXT: #NO_APP
; RV32IZCMP-WITH-FP-NEXT: .cfi_def_cfa sp, 16
; RV32IZCMP-WITH-FP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
; RV32IZCMP-WITH-FP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
; RV32IZCMP-WITH-FP-NEXT: lw s11, 4(sp) # 4-byte Folded Reload
Expand Down Expand Up @@ -2764,6 +2770,7 @@ define void @bar() {
; RV64I-WITH-FP-NEXT: #APP
; RV64I-WITH-FP-NEXT: li s11, 0
; RV64I-WITH-FP-NEXT: #NO_APP
; RV64I-WITH-FP-NEXT: .cfi_def_cfa sp, 32
; RV64I-WITH-FP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
; RV64I-WITH-FP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
; RV64I-WITH-FP-NEXT: ld s11, 8(sp) # 8-byte Folded Reload
Expand Down Expand Up @@ -2802,6 +2809,7 @@ define void @bar() {
; RV64IZCMP-WITH-FP-NEXT: #APP
; RV64IZCMP-WITH-FP-NEXT: li s11, 0
; RV64IZCMP-WITH-FP-NEXT: #NO_APP
; RV64IZCMP-WITH-FP-NEXT: .cfi_def_cfa sp, 32
; RV64IZCMP-WITH-FP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
; RV64IZCMP-WITH-FP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
; RV64IZCMP-WITH-FP-NEXT: ld s11, 8(sp) # 8-byte Folded Reload
Expand Down Expand Up @@ -2876,6 +2884,7 @@ define void @varargs(...) {
; RV32I-WITH-FP-NEXT: sw a2, 8(s0)
; RV32I-WITH-FP-NEXT: sw a3, 12(s0)
; RV32I-WITH-FP-NEXT: call callee
; RV32I-WITH-FP-NEXT: .cfi_def_cfa sp, 48
; RV32I-WITH-FP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
; RV32I-WITH-FP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
; RV32I-WITH-FP-NEXT: .cfi_restore ra
Expand Down Expand Up @@ -2924,6 +2933,7 @@ define void @varargs(...) {
; RV32IZCMP-WITH-FP-NEXT: sw a2, 8(s0)
; RV32IZCMP-WITH-FP-NEXT: sw a3, 12(s0)
; RV32IZCMP-WITH-FP-NEXT: call callee
; RV32IZCMP-WITH-FP-NEXT: .cfi_def_cfa sp, 48
; RV32IZCMP-WITH-FP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
; RV32IZCMP-WITH-FP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
; RV32IZCMP-WITH-FP-NEXT: .cfi_restore ra
Expand Down Expand Up @@ -2991,6 +3001,7 @@ define void @varargs(...) {
; RV64I-WITH-FP-NEXT: sd a2, 16(s0)
; RV64I-WITH-FP-NEXT: sd a3, 24(s0)
; RV64I-WITH-FP-NEXT: call callee
; RV64I-WITH-FP-NEXT: .cfi_def_cfa sp, 80
; RV64I-WITH-FP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
; RV64I-WITH-FP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
; RV64I-WITH-FP-NEXT: .cfi_restore ra
Expand Down Expand Up @@ -3039,6 +3050,7 @@ define void @varargs(...) {
; RV64IZCMP-WITH-FP-NEXT: sd a2, 16(s0)
; RV64IZCMP-WITH-FP-NEXT: sd a3, 24(s0)
; RV64IZCMP-WITH-FP-NEXT: call callee
; RV64IZCMP-WITH-FP-NEXT: .cfi_def_cfa sp, 80
; RV64IZCMP-WITH-FP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
; RV64IZCMP-WITH-FP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
; RV64IZCMP-WITH-FP-NEXT: .cfi_restore ra
Expand Down
Loading

0 comments on commit 362a051

Please sign in to comment.