Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dlav-sc committed Oct 30, 2024
1 parent b0227fb commit 255db2d
Show file tree
Hide file tree
Showing 17 changed files with 176 additions and 382 deletions.
32 changes: 8 additions & 24 deletions llvm/test/CodeGen/RISCV/callee-saved-gprs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,7 @@ define void @callee() nounwind {
; RV32IZCMP-NEXT: sw a0, %lo(var+4)(t0)
; RV32IZCMP-NEXT: lw a0, 28(sp) # 4-byte Folded Reload
; RV32IZCMP-NEXT: sw a0, %lo(var)(t0)
; RV32IZCMP-NEXT: cm.pop {ra, s0-s11}, 96
; RV32IZCMP-NEXT: ret
; RV32IZCMP-NEXT: cm.popret {ra, s0-s11}, 96
;
; RV32IZCMP-WITH-FP-LABEL: callee:
; RV32IZCMP-WITH-FP: # %bb.0:
Expand Down Expand Up @@ -942,8 +941,7 @@ define void @callee() nounwind {
; RV64IZCMP-NEXT: sw a0, %lo(var+4)(t0)
; RV64IZCMP-NEXT: ld a0, 40(sp) # 8-byte Folded Reload
; RV64IZCMP-NEXT: sw a0, %lo(var)(t0)
; RV64IZCMP-NEXT: cm.pop {ra, s0-s11}, 160
; RV64IZCMP-NEXT: ret
; RV64IZCMP-NEXT: cm.popret {ra, s0-s11}, 160
;
; RV64IZCMP-WITH-FP-LABEL: callee:
; RV64IZCMP-WITH-FP: # %bb.0:
Expand Down Expand Up @@ -1613,8 +1611,7 @@ define void @caller() nounwind {
; RV32IZCMP-NEXT: lw a0, 92(sp) # 4-byte Folded Reload
; RV32IZCMP-NEXT: sw a0, %lo(var)(s0)
; RV32IZCMP-NEXT: addi sp, sp, 48
; RV32IZCMP-NEXT: cm.pop {ra, s0-s11}, 112
; RV32IZCMP-NEXT: ret
; RV32IZCMP-NEXT: cm.popret {ra, s0-s11}, 112
;
; RV32IZCMP-WITH-FP-LABEL: caller:
; RV32IZCMP-WITH-FP: # %bb.0:
Expand Down Expand Up @@ -2309,8 +2306,7 @@ define void @caller() nounwind {
; RV64IZCMP-NEXT: ld a0, 168(sp) # 8-byte Folded Reload
; RV64IZCMP-NEXT: sw a0, %lo(var)(s0)
; RV64IZCMP-NEXT: addi sp, sp, 128
; RV64IZCMP-NEXT: cm.pop {ra, s0-s11}, 160
; RV64IZCMP-NEXT: ret
; RV64IZCMP-NEXT: cm.popret {ra, s0-s11}, 160
;
; RV64IZCMP-WITH-FP-LABEL: caller:
; RV64IZCMP-WITH-FP: # %bb.0:
Expand Down Expand Up @@ -2522,10 +2518,7 @@ define void @foo() {
; RV32IZCMP-NEXT: #APP
; RV32IZCMP-NEXT: li s4, 0
; RV32IZCMP-NEXT: #NO_APP
; RV32IZCMP-NEXT: cm.pop {ra, s0-s4}, 32
; RV32IZCMP-NEXT: .cfi_def_cfa_offset 0
; RV32IZCMP-NEXT: .cfi_restore s4
; RV32IZCMP-NEXT: ret
; RV32IZCMP-NEXT: cm.popret {ra, s0-s4}, 32
;
; RV32IZCMP-WITH-FP-LABEL: foo:
; RV32IZCMP-WITH-FP: # %bb.0: # %entry
Expand Down Expand Up @@ -2609,10 +2602,7 @@ define void @foo() {
; RV64IZCMP-NEXT: #APP
; RV64IZCMP-NEXT: li s4, 0
; RV64IZCMP-NEXT: #NO_APP
; RV64IZCMP-NEXT: cm.pop {ra, s0-s4}, 48
; RV64IZCMP-NEXT: .cfi_def_cfa_offset 0
; RV64IZCMP-NEXT: .cfi_restore s4
; RV64IZCMP-NEXT: ret
; RV64IZCMP-NEXT: cm.popret {ra, s0-s4}, 48
;
; RV64IZCMP-WITH-FP-LABEL: foo:
; RV64IZCMP-WITH-FP: # %bb.0: # %entry
Expand Down Expand Up @@ -2702,10 +2692,7 @@ define void @bar() {
; RV32IZCMP-NEXT: #APP
; RV32IZCMP-NEXT: li s11, 0
; RV32IZCMP-NEXT: #NO_APP
; RV32IZCMP-NEXT: cm.pop {ra, s0-s11}, 64
; RV32IZCMP-NEXT: .cfi_def_cfa_offset 0
; RV32IZCMP-NEXT: .cfi_restore s11
; RV32IZCMP-NEXT: ret
; RV32IZCMP-NEXT: cm.popret {ra, s0-s11}, 64
;
; RV32IZCMP-WITH-FP-LABEL: bar:
; RV32IZCMP-WITH-FP: # %bb.0: # %entry
Expand Down Expand Up @@ -2789,10 +2776,7 @@ define void @bar() {
; RV64IZCMP-NEXT: #APP
; RV64IZCMP-NEXT: li s11, 0
; RV64IZCMP-NEXT: #NO_APP
; RV64IZCMP-NEXT: cm.pop {ra, s0-s11}, 112
; RV64IZCMP-NEXT: .cfi_def_cfa_offset 0
; RV64IZCMP-NEXT: .cfi_restore s11
; RV64IZCMP-NEXT: ret
; RV64IZCMP-NEXT: cm.popret {ra, s0-s11}, 112
;
; RV64IZCMP-WITH-FP-LABEL: bar:
; RV64IZCMP-WITH-FP: # %bb.0: # %entry
Expand Down
84 changes: 51 additions & 33 deletions llvm/test/CodeGen/RISCV/calling-conv-ilp32e.ll
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,10 @@ define i32 @caller_float_on_stack() {
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: caller_float_on_stack:
; ILP32E-FPELIM-SAVE-RESTORE: # %bb.0:
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: call t0, __riscv_save_0
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -12
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 16
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: lui a1, 264704
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: li a3, 4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: li a0, 1
Expand All @@ -294,10 +295,11 @@ define i32 @caller_float_on_stack() {
; ILP32E-WITHFP-SAVE-RESTORE-LABEL: caller_float_on_stack:
; ILP32E-WITHFP-SAVE-RESTORE: # %bb.0:
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -12
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 20
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -12
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 20
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi s0, sp, 20
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: lui a1, 264704
Expand Down Expand Up @@ -802,10 +804,11 @@ define void @caller_aligned_stack() {
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: caller_aligned_stack:
; ILP32E-FPELIM-SAVE-RESTORE: # %bb.0:
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -56
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 64
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -56
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 64
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi s0, sp, 64
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: andi sp, sp, -16
Expand Down Expand Up @@ -856,10 +859,11 @@ define void @caller_aligned_stack() {
; ILP32E-WITHFP-SAVE-RESTORE-LABEL: caller_aligned_stack:
; ILP32E-WITHFP-SAVE-RESTORE: # %bb.0:
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -56
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 64
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -56
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 64
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi s0, sp, 64
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: andi sp, sp, -16
Expand Down Expand Up @@ -1323,9 +1327,10 @@ define i32 @caller_many_scalars() {
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: caller_many_scalars:
; ILP32E-FPELIM-SAVE-RESTORE: # %bb.0:
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: call t0, __riscv_save_0
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -16
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 20
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: li a4, 8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: li a6, 7
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: li a7, 6
Expand All @@ -1347,10 +1352,11 @@ define i32 @caller_many_scalars() {
; ILP32E-WITHFP-SAVE-RESTORE-LABEL: caller_many_scalars:
; ILP32E-WITHFP-SAVE-RESTORE: # %bb.0:
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -16
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 24
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -16
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 24
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi s0, sp, 24
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: li a4, 8
Expand Down Expand Up @@ -1557,10 +1563,11 @@ define i32 @caller_large_scalars() {
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: caller_large_scalars:
; ILP32E-FPELIM-SAVE-RESTORE: # %bb.0:
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -40
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 48
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -40
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 48
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi s0, sp, 48
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: andi sp, sp, -16
Expand All @@ -1586,10 +1593,11 @@ define i32 @caller_large_scalars() {
; ILP32E-WITHFP-SAVE-RESTORE-LABEL: caller_large_scalars:
; ILP32E-WITHFP-SAVE-RESTORE: # %bb.0:
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -40
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 48
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -40
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 48
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi s0, sp, 48
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: andi sp, sp, -16
Expand Down Expand Up @@ -1831,10 +1839,11 @@ define i32 @caller_large_scalars_exhausted_regs() {
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: caller_large_scalars_exhausted_regs:
; ILP32E-FPELIM-SAVE-RESTORE: # %bb.0:
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -56
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 64
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -56
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 64
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi s0, sp, 64
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: andi sp, sp, -16
Expand Down Expand Up @@ -1872,10 +1881,11 @@ define i32 @caller_large_scalars_exhausted_regs() {
; ILP32E-WITHFP-SAVE-RESTORE-LABEL: caller_large_scalars_exhausted_regs:
; ILP32E-WITHFP-SAVE-RESTORE: # %bb.0:
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -56
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 64
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -56
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 64
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi s0, sp, 64
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: andi sp, sp, -16
Expand Down Expand Up @@ -1973,10 +1983,11 @@ define i32 @caller_mixed_scalar_libcalls(i64 %a) {
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: caller_mixed_scalar_libcalls:
; ILP32E-FPELIM-SAVE-RESTORE: # %bb.0:
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -16
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 24
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -16
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 24
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi s0, sp, 24
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: andi sp, sp, -8
Expand All @@ -1994,10 +2005,11 @@ define i32 @caller_mixed_scalar_libcalls(i64 %a) {
; ILP32E-WITHFP-SAVE-RESTORE-LABEL: caller_mixed_scalar_libcalls:
; ILP32E-WITHFP-SAVE-RESTORE: # %bb.0:
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -16
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 24
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -16
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 24
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi s0, sp, 24
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: andi sp, sp, -8
Expand Down Expand Up @@ -2265,9 +2277,10 @@ define i32 @caller_large_struct() {
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: caller_large_struct:
; ILP32E-FPELIM-SAVE-RESTORE: # %bb.0:
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: call t0, __riscv_save_0
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -32
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 36
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: li a0, 1
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: li a1, 2
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: li a2, 3
Expand All @@ -2289,10 +2302,11 @@ define i32 @caller_large_struct() {
; ILP32E-WITHFP-SAVE-RESTORE-LABEL: caller_large_struct:
; ILP32E-WITHFP-SAVE-RESTORE: # %bb.0:
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -32
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 40
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -32
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 40
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi s0, sp, 40
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: li a0, 1
Expand Down Expand Up @@ -2556,10 +2570,11 @@ define void @caller_large_scalar_ret() {
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: caller_large_scalar_ret:
; ILP32E-FPELIM-SAVE-RESTORE: # %bb.0:
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -24
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 32
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -24
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 32
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi s0, sp, 32
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: andi sp, sp, -16
Expand All @@ -2574,10 +2589,11 @@ define void @caller_large_scalar_ret() {
; ILP32E-WITHFP-SAVE-RESTORE-LABEL: caller_large_scalar_ret:
; ILP32E-WITHFP-SAVE-RESTORE: # %bb.0:
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -24
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 32
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -24
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 32
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi s0, sp, 32
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: andi sp, sp, -16
Expand Down Expand Up @@ -2731,10 +2747,11 @@ define i32 @caller_large_struct_ret() {
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: caller_large_struct_ret:
; ILP32E-FPELIM-SAVE-RESTORE: # %bb.0:
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -16
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 24
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi sp, sp, -16
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 24
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: addi s0, sp, 24
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-FPELIM-SAVE-RESTORE-NEXT: andi sp, sp, -8
Expand All @@ -2752,10 +2769,11 @@ define i32 @caller_large_struct_ret() {
; ILP32E-WITHFP-SAVE-RESTORE-LABEL: caller_large_struct_ret:
; ILP32E-WITHFP-SAVE-RESTORE: # %bb.0:
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: call t0, __riscv_save_1
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -16
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 24
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_offset s0, -8
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi sp, sp, -16
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa_offset 24
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: addi s0, sp, 24
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-SAVE-RESTORE-NEXT: andi sp, sp, -8
Expand Down
12 changes: 4 additions & 8 deletions llvm/test/CodeGen/RISCV/cm_mvas_mvsa.ll
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ define i32 @zcmp_mv(i32 %num, i32 %f) nounwind {
; CHECK32ZCMP-NEXT: cm.mva01s s1, s0
; CHECK32ZCMP-NEXT: call func
; CHECK32ZCMP-NEXT: add a0, s2, s0
; CHECK32ZCMP-NEXT: cm.pop {ra, s0-s2}, 16
; CHECK32ZCMP-NEXT: ret
; CHECK32ZCMP-NEXT: cm.popret {ra, s0-s2}, 16
;
; CHECK64I-LABEL: zcmp_mv:
; CHECK64I: # %bb.0:
Expand Down Expand Up @@ -77,8 +76,7 @@ define i32 @zcmp_mv(i32 %num, i32 %f) nounwind {
; CHECK64ZCMP-NEXT: cm.mva01s s1, s0
; CHECK64ZCMP-NEXT: call func
; CHECK64ZCMP-NEXT: addw a0, s2, s0
; CHECK64ZCMP-NEXT: cm.pop {ra, s0-s2}, 32
; CHECK64ZCMP-NEXT: ret
; CHECK64ZCMP-NEXT: cm.popret {ra, s0-s2}, 32
%call = call i32 @func(i32 %num, i32 %f)
%call1 = call i32 @func(i32 %num, i32 %f)
%res = add i32 %call, %f
Expand Down Expand Up @@ -121,8 +119,7 @@ define i32 @not_zcmp_mv(i32 %num, i32 %f) nounwind {
; CHECK32ZCMP-NEXT: li a0, 1
; CHECK32ZCMP-NEXT: mv a1, s0
; CHECK32ZCMP-NEXT: call func
; CHECK32ZCMP-NEXT: cm.pop {ra, s0-s1}, 16
; CHECK32ZCMP-NEXT: ret
; CHECK32ZCMP-NEXT: cm.popret {ra, s0-s1}, 16
;
; CHECK64I-LABEL: not_zcmp_mv:
; CHECK64I: # %bb.0:
Expand Down Expand Up @@ -159,8 +156,7 @@ define i32 @not_zcmp_mv(i32 %num, i32 %f) nounwind {
; CHECK64ZCMP-NEXT: li a0, 1
; CHECK64ZCMP-NEXT: mv a1, s0
; CHECK64ZCMP-NEXT: call func
; CHECK64ZCMP-NEXT: cm.pop {ra, s0-s1}, 32
; CHECK64ZCMP-NEXT: ret
; CHECK64ZCMP-NEXT: cm.popret {ra, s0-s1}, 32
%call = call i32 @foo(i32 %num)
%call1 = call i32 @foo(i32 %f)
%tmp = call i32 @foo(i32 %call)
Expand Down
2 changes: 0 additions & 2 deletions llvm/test/CodeGen/RISCV/inline-asm-d-constraint-f.ll
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,13 @@ define double @constraint_f_double_abi_name(double %a) nounwind {
define double @constraint_gpr(double %x) {
; RV32F-LABEL: constraint_gpr:
; RV32F: # %bb.0:
; RV32F-NEXT: .cfi_def_cfa_offset 0
; RV32F-NEXT: #APP
; RV32F-NEXT: mv a0, a0
; RV32F-NEXT: #NO_APP
; RV32F-NEXT: ret
;
; RV64F-LABEL: constraint_gpr:
; RV64F: # %bb.0:
; RV64F-NEXT: .cfi_def_cfa_offset 0
; RV64F-NEXT: #APP
; RV64F-NEXT: mv a0, a0
; RV64F-NEXT: #NO_APP
Expand Down
Loading

0 comments on commit 255db2d

Please sign in to comment.