[llvm] c08b90c - [RISCV] Lower the TransientStackAlignment to the ABI alignment for rv32e/rv64e.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 9 21:48:18 PST 2024
Author: Craig Topper
Date: 2024-02-09T21:48:11-08:00
New Revision: c08b90c50bcac9f3f563c79491c8dbcbe7c3b574
URL: https://github.com/llvm/llvm-project/commit/c08b90c50bcac9f3f563c79491c8dbcbe7c3b574
DIFF: https://github.com/llvm/llvm-project/commit/c08b90c50bcac9f3f563c79491c8dbcbe7c3b574.diff
LOG: [RISCV] Lower the TransientStackAlignment to the ABI alignment for rv32e/rv64e.
I don't think the transient alignment needs to be larger than the
ABI alignment.
Added:
Modified:
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
llvm/test/CodeGen/RISCV/callee-saved-gprs.ll
llvm/test/CodeGen/RISCV/calling-conv-ilp32e.ll
llvm/test/CodeGen/RISCV/rv64-legal-i32/vararg.ll
llvm/test/CodeGen/RISCV/vararg.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
index 60f92af4690e76..0de4785f684107 100644
--- a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
@@ -36,10 +36,10 @@ static Align getABIStackAlignment(RISCVABI::ABI ABI) {
}
RISCVFrameLowering::RISCVFrameLowering(const RISCVSubtarget &STI)
- : TargetFrameLowering(StackGrowsDown,
- getABIStackAlignment(STI.getTargetABI()),
- /*LocalAreaOffset=*/0,
- /*TransientStackAlignment=*/Align(16)),
+ : TargetFrameLowering(
+ StackGrowsDown, getABIStackAlignment(STI.getTargetABI()),
+ /*LocalAreaOffset=*/0,
+ /*TransientStackAlignment=*/getABIStackAlignment(STI.getTargetABI())),
STI(STI) {}
static const MCPhysReg AllPopRegs[] = {
diff --git a/llvm/test/CodeGen/RISCV/callee-saved-gprs.ll b/llvm/test/CodeGen/RISCV/callee-saved-gprs.ll
index 710b602df6d023..5e8ed4509b5357 100644
--- a/llvm/test/CodeGen/RISCV/callee-saved-gprs.ll
+++ b/llvm/test/CodeGen/RISCV/callee-saved-gprs.ll
@@ -150,24 +150,24 @@ define void @callee() nounwind {
;
; RV32I-ILP32E-LABEL: callee:
; RV32I-ILP32E: # %bb.0:
-; RV32I-ILP32E-NEXT: addi sp, sp, -48
-; RV32I-ILP32E-NEXT: sw ra, 44(sp) # 4-byte Folded Spill
-; RV32I-ILP32E-NEXT: sw s0, 40(sp) # 4-byte Folded Spill
-; RV32I-ILP32E-NEXT: sw s1, 36(sp) # 4-byte Folded Spill
+; RV32I-ILP32E-NEXT: addi sp, sp, -36
+; RV32I-ILP32E-NEXT: sw ra, 32(sp) # 4-byte Folded Spill
+; RV32I-ILP32E-NEXT: sw s0, 28(sp) # 4-byte Folded Spill
+; RV32I-ILP32E-NEXT: sw s1, 24(sp) # 4-byte Folded Spill
; RV32I-ILP32E-NEXT: lui a6, %hi(var)
; RV32I-ILP32E-NEXT: lw a0, %lo(var)(a6)
-; RV32I-ILP32E-NEXT: sw a0, 32(sp) # 4-byte Folded Spill
+; RV32I-ILP32E-NEXT: sw a0, 20(sp) # 4-byte Folded Spill
; RV32I-ILP32E-NEXT: lw a0, %lo(var+4)(a6)
-; RV32I-ILP32E-NEXT: sw a0, 28(sp) # 4-byte Folded Spill
+; RV32I-ILP32E-NEXT: sw a0, 16(sp) # 4-byte Folded Spill
; RV32I-ILP32E-NEXT: lw a0, %lo(var+8)(a6)
-; RV32I-ILP32E-NEXT: sw a0, 24(sp) # 4-byte Folded Spill
+; RV32I-ILP32E-NEXT: sw a0, 12(sp) # 4-byte Folded Spill
; RV32I-ILP32E-NEXT: lw a0, %lo(var+12)(a6)
-; RV32I-ILP32E-NEXT: sw a0, 20(sp) # 4-byte Folded Spill
+; RV32I-ILP32E-NEXT: sw a0, 8(sp) # 4-byte Folded Spill
; RV32I-ILP32E-NEXT: addi a5, a6, %lo(var)
; RV32I-ILP32E-NEXT: lw a0, 16(a5)
-; RV32I-ILP32E-NEXT: sw a0, 16(sp) # 4-byte Folded Spill
+; RV32I-ILP32E-NEXT: sw a0, 4(sp) # 4-byte Folded Spill
; RV32I-ILP32E-NEXT: lw a0, 20(a5)
-; RV32I-ILP32E-NEXT: sw a0, 12(sp) # 4-byte Folded Spill
+; RV32I-ILP32E-NEXT: sw a0, 0(sp) # 4-byte Folded Spill
; RV32I-ILP32E-NEXT: lw t0, 24(a5)
; RV32I-ILP32E-NEXT: lw t1, 28(a5)
; RV32I-ILP32E-NEXT: lw t2, 32(a5)
@@ -220,22 +220,22 @@ define void @callee() nounwind {
; RV32I-ILP32E-NEXT: sw t2, 32(a5)
; RV32I-ILP32E-NEXT: sw t1, 28(a5)
; RV32I-ILP32E-NEXT: sw t0, 24(a5)
-; RV32I-ILP32E-NEXT: lw a0, 12(sp) # 4-byte Folded Reload
+; RV32I-ILP32E-NEXT: lw a0, 0(sp) # 4-byte Folded Reload
; RV32I-ILP32E-NEXT: sw a0, 20(a5)
-; RV32I-ILP32E-NEXT: lw a0, 16(sp) # 4-byte Folded Reload
+; RV32I-ILP32E-NEXT: lw a0, 4(sp) # 4-byte Folded Reload
; RV32I-ILP32E-NEXT: sw a0, 16(a5)
-; RV32I-ILP32E-NEXT: lw a0, 20(sp) # 4-byte Folded Reload
+; RV32I-ILP32E-NEXT: lw a0, 8(sp) # 4-byte Folded Reload
; RV32I-ILP32E-NEXT: sw a0, %lo(var+12)(a6)
-; RV32I-ILP32E-NEXT: lw a0, 24(sp) # 4-byte Folded Reload
+; RV32I-ILP32E-NEXT: lw a0, 12(sp) # 4-byte Folded Reload
; RV32I-ILP32E-NEXT: sw a0, %lo(var+8)(a6)
-; RV32I-ILP32E-NEXT: lw a0, 28(sp) # 4-byte Folded Reload
+; RV32I-ILP32E-NEXT: lw a0, 16(sp) # 4-byte Folded Reload
; RV32I-ILP32E-NEXT: sw a0, %lo(var+4)(a6)
-; RV32I-ILP32E-NEXT: lw a0, 32(sp) # 4-byte Folded Reload
+; RV32I-ILP32E-NEXT: lw a0, 20(sp) # 4-byte Folded Reload
; RV32I-ILP32E-NEXT: sw a0, %lo(var)(a6)
-; RV32I-ILP32E-NEXT: lw ra, 44(sp) # 4-byte Folded Reload
-; RV32I-ILP32E-NEXT: lw s0, 40(sp) # 4-byte Folded Reload
-; RV32I-ILP32E-NEXT: lw s1, 36(sp) # 4-byte Folded Reload
-; RV32I-ILP32E-NEXT: addi sp, sp, 48
+; RV32I-ILP32E-NEXT: lw ra, 32(sp) # 4-byte Folded Reload
+; RV32I-ILP32E-NEXT: lw s0, 28(sp) # 4-byte Folded Reload
+; RV32I-ILP32E-NEXT: lw s1, 24(sp) # 4-byte Folded Reload
+; RV32I-ILP32E-NEXT: addi sp, sp, 36
; RV32I-ILP32E-NEXT: ret
;
; RV32I-WITH-FP-LABEL: callee:
@@ -659,24 +659,24 @@ define void @callee() nounwind {
;
; RV64I-LP64E-LABEL: callee:
; RV64I-LP64E: # %bb.0:
-; RV64I-LP64E-NEXT: addi sp, sp, -80
-; RV64I-LP64E-NEXT: sd ra, 72(sp) # 8-byte Folded Spill
-; RV64I-LP64E-NEXT: sd s0, 64(sp) # 8-byte Folded Spill
-; RV64I-LP64E-NEXT: sd s1, 56(sp) # 8-byte Folded Spill
+; RV64I-LP64E-NEXT: addi sp, sp, -72
+; RV64I-LP64E-NEXT: sd ra, 64(sp) # 8-byte Folded Spill
+; RV64I-LP64E-NEXT: sd s0, 56(sp) # 8-byte Folded Spill
+; RV64I-LP64E-NEXT: sd s1, 48(sp) # 8-byte Folded Spill
; RV64I-LP64E-NEXT: lui a6, %hi(var)
; RV64I-LP64E-NEXT: lw a0, %lo(var)(a6)
-; RV64I-LP64E-NEXT: sd a0, 48(sp) # 8-byte Folded Spill
-; RV64I-LP64E-NEXT: lw a0, %lo(var+4)(a6)
; RV64I-LP64E-NEXT: sd a0, 40(sp) # 8-byte Folded Spill
-; RV64I-LP64E-NEXT: lw a0, %lo(var+8)(a6)
+; RV64I-LP64E-NEXT: lw a0, %lo(var+4)(a6)
; RV64I-LP64E-NEXT: sd a0, 32(sp) # 8-byte Folded Spill
-; RV64I-LP64E-NEXT: lw a0, %lo(var+12)(a6)
+; RV64I-LP64E-NEXT: lw a0, %lo(var+8)(a6)
; RV64I-LP64E-NEXT: sd a0, 24(sp) # 8-byte Folded Spill
+; RV64I-LP64E-NEXT: lw a0, %lo(var+12)(a6)
+; RV64I-LP64E-NEXT: sd a0, 16(sp) # 8-byte Folded Spill
; RV64I-LP64E-NEXT: addi a5, a6, %lo(var)
; RV64I-LP64E-NEXT: lw a0, 16(a5)
-; RV64I-LP64E-NEXT: sd a0, 16(sp) # 8-byte Folded Spill
-; RV64I-LP64E-NEXT: lw a0, 20(a5)
; RV64I-LP64E-NEXT: sd a0, 8(sp) # 8-byte Folded Spill
+; RV64I-LP64E-NEXT: lw a0, 20(a5)
+; RV64I-LP64E-NEXT: sd a0, 0(sp) # 8-byte Folded Spill
; RV64I-LP64E-NEXT: lw t0, 24(a5)
; RV64I-LP64E-NEXT: lw t1, 28(a5)
; RV64I-LP64E-NEXT: lw t2, 32(a5)
@@ -729,22 +729,22 @@ define void @callee() nounwind {
; RV64I-LP64E-NEXT: sw t2, 32(a5)
; RV64I-LP64E-NEXT: sw t1, 28(a5)
; RV64I-LP64E-NEXT: sw t0, 24(a5)
-; RV64I-LP64E-NEXT: ld a0, 8(sp) # 8-byte Folded Reload
+; RV64I-LP64E-NEXT: ld a0, 0(sp) # 8-byte Folded Reload
; RV64I-LP64E-NEXT: sw a0, 20(a5)
-; RV64I-LP64E-NEXT: ld a0, 16(sp) # 8-byte Folded Reload
+; RV64I-LP64E-NEXT: ld a0, 8(sp) # 8-byte Folded Reload
; RV64I-LP64E-NEXT: sw a0, 16(a5)
-; RV64I-LP64E-NEXT: ld a0, 24(sp) # 8-byte Folded Reload
+; RV64I-LP64E-NEXT: ld a0, 16(sp) # 8-byte Folded Reload
; RV64I-LP64E-NEXT: sw a0, %lo(var+12)(a6)
-; RV64I-LP64E-NEXT: ld a0, 32(sp) # 8-byte Folded Reload
+; RV64I-LP64E-NEXT: ld a0, 24(sp) # 8-byte Folded Reload
; RV64I-LP64E-NEXT: sw a0, %lo(var+8)(a6)
-; RV64I-LP64E-NEXT: ld a0, 40(sp) # 8-byte Folded Reload
+; RV64I-LP64E-NEXT: ld a0, 32(sp) # 8-byte Folded Reload
; RV64I-LP64E-NEXT: sw a0, %lo(var+4)(a6)
-; RV64I-LP64E-NEXT: ld a0, 48(sp) # 8-byte Folded Reload
+; RV64I-LP64E-NEXT: ld a0, 40(sp) # 8-byte Folded Reload
; RV64I-LP64E-NEXT: sw a0, %lo(var)(a6)
-; RV64I-LP64E-NEXT: ld ra, 72(sp) # 8-byte Folded Reload
-; RV64I-LP64E-NEXT: ld s0, 64(sp) # 8-byte Folded Reload
-; RV64I-LP64E-NEXT: ld s1, 56(sp) # 8-byte Folded Reload
-; RV64I-LP64E-NEXT: addi sp, sp, 80
+; RV64I-LP64E-NEXT: ld ra, 64(sp) # 8-byte Folded Reload
+; RV64I-LP64E-NEXT: ld s0, 56(sp) # 8-byte Folded Reload
+; RV64I-LP64E-NEXT: ld s1, 48(sp) # 8-byte Folded Reload
+; RV64I-LP64E-NEXT: addi sp, sp, 72
; RV64I-LP64E-NEXT: ret
;
; RV64I-WITH-FP-LABEL: callee:
diff --git a/llvm/test/CodeGen/RISCV/calling-conv-ilp32e.ll b/llvm/test/CodeGen/RISCV/calling-conv-ilp32e.ll
index 0eb63913be8896..5c55113fc97497 100644
--- a/llvm/test/CodeGen/RISCV/calling-conv-ilp32e.ll
+++ b/llvm/test/CodeGen/RISCV/calling-conv-ilp32e.ll
@@ -151,20 +151,20 @@ define i32 @callee_float_on_stack(i64 %a, i64 %b, i64 %c, i64 %d, float %e) {
;
; ILP32E-WITHFP-LABEL: callee_float_on_stack:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: lw a0, 8(s0)
; ILP32E-WITHFP-NEXT: lw a1, 0(s0)
; ILP32E-WITHFP-NEXT: add a0, a1, a0
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_float_on_stack:
@@ -298,18 +298,18 @@ define float @callee_tiny_scalar_ret() {
;
; ILP32E-WITHFP-LABEL: callee_tiny_scalar_ret:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: lui a0, 260096
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_tiny_scalar_ret:
@@ -543,13 +543,13 @@ define i32 @callee_aligned_stack(i32 %a, i32 %b, fp128 %c, i32 %d, i32 %e, i64 %
;
; ILP32E-WITHFP-LABEL: callee_aligned_stack:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: lw a0, 0(a2)
; ILP32E-WITHFP-NEXT: lw a1, 12(s0)
@@ -562,9 +562,9 @@ define i32 @callee_aligned_stack(i32 %a, i32 %b, fp128 %c, i32 %d, i32 %e, i64 %
; ILP32E-WITHFP-NEXT: add a0, a0, a1
; ILP32E-WITHFP-NEXT: add a4, a5, a4
; ILP32E-WITHFP-NEXT: add a0, a0, a4
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_aligned_stack:
@@ -847,19 +847,19 @@ define double @callee_small_scalar_ret() {
;
; ILP32E-WITHFP-LABEL: callee_small_scalar_ret:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: lui a1, 261888
; ILP32E-WITHFP-NEXT: li a0, 0
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_small_scalar_ret:
@@ -944,18 +944,18 @@ define i32 @callee_i64_in_regs(i32 %a, i64 %b) {
;
; ILP32E-WITHFP-LABEL: callee_i64_in_regs:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: add a0, a0, a1
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_i64_in_regs:
@@ -1066,13 +1066,13 @@ define i32 @callee_many_scalars(i8 %a, i16 %b, i32 %c, i64 %d, i32 %e, i32 %f, i
;
; ILP32E-WITHFP-LABEL: callee_many_scalars:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: lw a6, 12(s0)
; ILP32E-WITHFP-NEXT: lw a7, 0(s0)
@@ -1091,9 +1091,9 @@ define i32 @callee_many_scalars(i8 %a, i16 %b, i32 %c, i64 %d, i32 %e, i32 %f, i
; ILP32E-WITHFP-NEXT: add a0, a0, a7
; ILP32E-WITHFP-NEXT: add a0, a0, a6
; ILP32E-WITHFP-NEXT: add a0, a1, a0
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_many_scalars:
@@ -1287,13 +1287,13 @@ define i32 @callee_large_scalars(i128 %a, fp128 %b) {
;
; ILP32E-WITHFP-LABEL: callee_large_scalars:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: lw a2, 0(a1)
; ILP32E-WITHFP-NEXT: lw a3, 0(a0)
@@ -1311,9 +1311,9 @@ define i32 @callee_large_scalars(i128 %a, fp128 %b) {
; ILP32E-WITHFP-NEXT: or a0, a2, a0
; ILP32E-WITHFP-NEXT: or a0, a0, a4
; ILP32E-WITHFP-NEXT: seqz a0, a0
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_large_scalars:
@@ -1514,13 +1514,13 @@ define i32 @callee_large_scalars_exhausted_regs(i32 %a, i32 %b, i32 %c, i32 %d,
;
; ILP32E-WITHFP-LABEL: callee_large_scalars_exhausted_regs:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: lw a0, 12(s0)
; ILP32E-WITHFP-NEXT: lw a1, 4(s0)
@@ -1540,9 +1540,9 @@ define i32 @callee_large_scalars_exhausted_regs(i32 %a, i32 %b, i32 %c, i32 %d,
; ILP32E-WITHFP-NEXT: or a0, a2, a0
; ILP32E-WITHFP-NEXT: or a0, a0, a4
; ILP32E-WITHFP-NEXT: seqz a0, a0
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_large_scalars_exhausted_regs:
@@ -1872,19 +1872,19 @@ define i32 @callee_small_coerced_struct([2 x i32] %a.coerce) {
;
; ILP32E-WITHFP-LABEL: callee_small_coerced_struct:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: xor a0, a0, a1
; ILP32E-WITHFP-NEXT: seqz a0, a0
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_small_coerced_struct:
@@ -1983,20 +1983,20 @@ define i32 @callee_large_struct(ptr byval(%struct.large) align 4 %a) {
;
; ILP32E-WITHFP-LABEL: callee_large_struct:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: lw a1, 0(a0)
; ILP32E-WITHFP-NEXT: lw a0, 12(a0)
; ILP32E-WITHFP-NEXT: add a0, a1, a0
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_large_struct:
@@ -2153,19 +2153,19 @@ define %struct.small @callee_small_struct_ret() {
;
; ILP32E-WITHFP-LABEL: callee_small_struct_ret:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: li a0, 1
; ILP32E-WITHFP-NEXT: li a1, 0
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_small_struct_ret:
@@ -2260,22 +2260,22 @@ define fp128 @callee_large_scalar_ret() {
;
; ILP32E-WITHFP-LABEL: callee_large_scalar_ret:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: lui a1, 524272
; ILP32E-WITHFP-NEXT: sw a1, 12(a0)
; ILP32E-WITHFP-NEXT: sw zero, 8(a0)
; ILP32E-WITHFP-NEXT: sw zero, 4(a0)
; ILP32E-WITHFP-NEXT: sw zero, 0(a0)
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_large_scalar_ret:
@@ -2395,13 +2395,13 @@ define void @callee_large_struct_ret(ptr noalias sret(%struct.large) %agg.result
;
; ILP32E-WITHFP-LABEL: callee_large_struct_ret:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -16
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 16
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -8
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 8
+; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -4
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -8
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi s0, sp, 8
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 0
; ILP32E-WITHFP-NEXT: li a1, 1
; ILP32E-WITHFP-NEXT: sw a1, 0(a0)
@@ -2411,9 +2411,9 @@ define void @callee_large_struct_ret(ptr noalias sret(%struct.large) %agg.result
; ILP32E-WITHFP-NEXT: sw a1, 8(a0)
; ILP32E-WITHFP-NEXT: li a1, 4
; ILP32E-WITHFP-NEXT: sw a1, 12(a0)
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 16
+; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 8
; ILP32E-WITHFP-NEXT: ret
;
; ILP32E-FPELIM-SAVE-RESTORE-LABEL: callee_large_struct_ret:
diff --git a/llvm/test/CodeGen/RISCV/rv64-legal-i32/vararg.ll b/llvm/test/CodeGen/RISCV/rv64-legal-i32/vararg.ll
index 2fb674f5608046..7fe67a07255d2c 100644
--- a/llvm/test/CodeGen/RISCV/rv64-legal-i32/vararg.ll
+++ b/llvm/test/CodeGen/RISCV/rv64-legal-i32/vararg.ll
@@ -76,28 +76,28 @@ define i32 @va1(ptr %fmt, ...) {
;
; LP64E-FPELIM-LABEL: va1:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -64
-; LP64E-FPELIM-NEXT: .cfi_def_cfa_offset 64
+; LP64E-FPELIM-NEXT: addi sp, sp, -56
+; LP64E-FPELIM-NEXT: .cfi_def_cfa_offset 56
; LP64E-FPELIM-NEXT: mv a0, a1
-; LP64E-FPELIM-NEXT: sd a5, 56(sp)
-; LP64E-FPELIM-NEXT: sd a4, 48(sp)
-; LP64E-FPELIM-NEXT: sd a3, 40(sp)
-; LP64E-FPELIM-NEXT: sd a2, 32(sp)
-; LP64E-FPELIM-NEXT: sd a1, 24(sp)
-; LP64E-FPELIM-NEXT: addi a1, sp, 28
-; LP64E-FPELIM-NEXT: sd a1, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 64
+; LP64E-FPELIM-NEXT: sd a5, 48(sp)
+; LP64E-FPELIM-NEXT: sd a4, 40(sp)
+; LP64E-FPELIM-NEXT: sd a3, 32(sp)
+; LP64E-FPELIM-NEXT: sd a2, 24(sp)
+; LP64E-FPELIM-NEXT: sd a1, 16(sp)
+; LP64E-FPELIM-NEXT: addi a1, sp, 20
+; LP64E-FPELIM-NEXT: sd a1, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 56
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va1:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -80
-; LP64E-WITHFP-NEXT: .cfi_def_cfa_offset 80
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi sp, sp, -72
+; LP64E-WITHFP-NEXT: .cfi_def_cfa_offset 72
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
; LP64E-WITHFP-NEXT: .cfi_offset ra, -56
; LP64E-WITHFP-NEXT: .cfi_offset s0, -64
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: .cfi_def_cfa s0, 48
; LP64E-WITHFP-NEXT: mv a0, a1
; LP64E-WITHFP-NEXT: sd a5, 40(s0)
@@ -107,9 +107,9 @@ define i32 @va1(ptr %fmt, ...) {
; LP64E-WITHFP-NEXT: sd a1, 8(s0)
; LP64E-WITHFP-NEXT: addi a1, s0, 12
; LP64E-WITHFP-NEXT: sd a1, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 80
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 72
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -161,24 +161,24 @@ define i32 @va1_va_arg(ptr %fmt, ...) nounwind {
;
; LP64E-FPELIM-LABEL: va1_va_arg:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -64
+; LP64E-FPELIM-NEXT: addi sp, sp, -56
; LP64E-FPELIM-NEXT: mv a0, a1
-; LP64E-FPELIM-NEXT: sd a5, 56(sp)
-; LP64E-FPELIM-NEXT: sd a4, 48(sp)
-; LP64E-FPELIM-NEXT: sd a3, 40(sp)
-; LP64E-FPELIM-NEXT: sd a2, 32(sp)
-; LP64E-FPELIM-NEXT: sd a1, 24(sp)
-; LP64E-FPELIM-NEXT: addi a1, sp, 32
-; LP64E-FPELIM-NEXT: sd a1, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 64
+; LP64E-FPELIM-NEXT: sd a5, 48(sp)
+; LP64E-FPELIM-NEXT: sd a4, 40(sp)
+; LP64E-FPELIM-NEXT: sd a3, 32(sp)
+; LP64E-FPELIM-NEXT: sd a2, 24(sp)
+; LP64E-FPELIM-NEXT: sd a1, 16(sp)
+; LP64E-FPELIM-NEXT: addi a1, sp, 24
+; LP64E-FPELIM-NEXT: sd a1, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 56
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va1_va_arg:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -80
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -72
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: mv a0, a1
; LP64E-WITHFP-NEXT: sd a5, 40(s0)
; LP64E-WITHFP-NEXT: sd a4, 32(s0)
@@ -187,9 +187,9 @@ define i32 @va1_va_arg(ptr %fmt, ...) nounwind {
; LP64E-WITHFP-NEXT: sd a1, 8(s0)
; LP64E-WITHFP-NEXT: addi a1, s0, 16
; LP64E-WITHFP-NEXT: sd a1, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 80
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 72
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -435,24 +435,24 @@ define i64 @va2(ptr %fmt, ...) nounwind {
;
; LP64E-FPELIM-LABEL: va2:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -64
+; LP64E-FPELIM-NEXT: addi sp, sp, -56
; LP64E-FPELIM-NEXT: mv a0, a1
-; LP64E-FPELIM-NEXT: sd a5, 56(sp)
-; LP64E-FPELIM-NEXT: sd a4, 48(sp)
-; LP64E-FPELIM-NEXT: sd a3, 40(sp)
-; LP64E-FPELIM-NEXT: sd a2, 32(sp)
-; LP64E-FPELIM-NEXT: sd a1, 24(sp)
-; LP64E-FPELIM-NEXT: addi a1, sp, 39
-; LP64E-FPELIM-NEXT: sd a1, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 64
+; LP64E-FPELIM-NEXT: sd a5, 48(sp)
+; LP64E-FPELIM-NEXT: sd a4, 40(sp)
+; LP64E-FPELIM-NEXT: sd a3, 32(sp)
+; LP64E-FPELIM-NEXT: sd a2, 24(sp)
+; LP64E-FPELIM-NEXT: sd a1, 16(sp)
+; LP64E-FPELIM-NEXT: addi a1, sp, 31
+; LP64E-FPELIM-NEXT: sd a1, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 56
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va2:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -80
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -72
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: mv a0, a1
; LP64E-WITHFP-NEXT: sd a5, 40(s0)
; LP64E-WITHFP-NEXT: sd a4, 32(s0)
@@ -461,9 +461,9 @@ define i64 @va2(ptr %fmt, ...) nounwind {
; LP64E-WITHFP-NEXT: sd a1, 8(s0)
; LP64E-WITHFP-NEXT: addi a1, s0, 23
; LP64E-WITHFP-NEXT: sd a1, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 80
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 72
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -521,24 +521,24 @@ define i64 @va2_va_arg(ptr %fmt, ...) nounwind {
;
; LP64E-FPELIM-LABEL: va2_va_arg:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -64
+; LP64E-FPELIM-NEXT: addi sp, sp, -56
; LP64E-FPELIM-NEXT: mv a0, a1
-; LP64E-FPELIM-NEXT: sd a5, 56(sp)
-; LP64E-FPELIM-NEXT: sd a4, 48(sp)
-; LP64E-FPELIM-NEXT: sd a3, 40(sp)
-; LP64E-FPELIM-NEXT: sd a2, 32(sp)
-; LP64E-FPELIM-NEXT: sd a1, 24(sp)
-; LP64E-FPELIM-NEXT: addi a1, sp, 32
-; LP64E-FPELIM-NEXT: sd a1, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 64
+; LP64E-FPELIM-NEXT: sd a5, 48(sp)
+; LP64E-FPELIM-NEXT: sd a4, 40(sp)
+; LP64E-FPELIM-NEXT: sd a3, 32(sp)
+; LP64E-FPELIM-NEXT: sd a2, 24(sp)
+; LP64E-FPELIM-NEXT: sd a1, 16(sp)
+; LP64E-FPELIM-NEXT: addi a1, sp, 24
+; LP64E-FPELIM-NEXT: sd a1, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 56
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va2_va_arg:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -80
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -72
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: mv a0, a1
; LP64E-WITHFP-NEXT: sd a5, 40(s0)
; LP64E-WITHFP-NEXT: sd a4, 32(s0)
@@ -547,9 +547,9 @@ define i64 @va2_va_arg(ptr %fmt, ...) nounwind {
; LP64E-WITHFP-NEXT: sd a1, 8(s0)
; LP64E-WITHFP-NEXT: addi a1, s0, 16
; LP64E-WITHFP-NEXT: sd a1, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 80
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 72
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -654,23 +654,23 @@ define i64 @va3(i32 %a, i64 %b, ...) nounwind {
;
; LP64E-FPELIM-LABEL: va3:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -48
-; LP64E-FPELIM-NEXT: sd a5, 40(sp)
-; LP64E-FPELIM-NEXT: sd a4, 32(sp)
-; LP64E-FPELIM-NEXT: sd a3, 24(sp)
-; LP64E-FPELIM-NEXT: sd a2, 16(sp)
-; LP64E-FPELIM-NEXT: addi a3, sp, 31
+; LP64E-FPELIM-NEXT: addi sp, sp, -40
+; LP64E-FPELIM-NEXT: sd a5, 32(sp)
+; LP64E-FPELIM-NEXT: sd a4, 24(sp)
+; LP64E-FPELIM-NEXT: sd a3, 16(sp)
+; LP64E-FPELIM-NEXT: sd a2, 8(sp)
+; LP64E-FPELIM-NEXT: addi a3, sp, 23
; LP64E-FPELIM-NEXT: add a0, a1, a2
-; LP64E-FPELIM-NEXT: sd a3, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 48
+; LP64E-FPELIM-NEXT: sd a3, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 40
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va3:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -64
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -56
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: sd a5, 24(s0)
; LP64E-WITHFP-NEXT: sd a4, 16(s0)
; LP64E-WITHFP-NEXT: sd a3, 8(s0)
@@ -678,9 +678,9 @@ define i64 @va3(i32 %a, i64 %b, ...) nounwind {
; LP64E-WITHFP-NEXT: addi a3, s0, 15
; LP64E-WITHFP-NEXT: add a0, a1, a2
; LP64E-WITHFP-NEXT: sd a3, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 64
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 56
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -737,23 +737,23 @@ define i64 @va3_va_arg(i32 %a, i64 %b, ...) nounwind {
;
; LP64E-FPELIM-LABEL: va3_va_arg:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -48
-; LP64E-FPELIM-NEXT: sd a5, 40(sp)
-; LP64E-FPELIM-NEXT: sd a4, 32(sp)
-; LP64E-FPELIM-NEXT: sd a3, 24(sp)
-; LP64E-FPELIM-NEXT: sd a2, 16(sp)
-; LP64E-FPELIM-NEXT: addi a3, sp, 24
+; LP64E-FPELIM-NEXT: addi sp, sp, -40
+; LP64E-FPELIM-NEXT: sd a5, 32(sp)
+; LP64E-FPELIM-NEXT: sd a4, 24(sp)
+; LP64E-FPELIM-NEXT: sd a3, 16(sp)
+; LP64E-FPELIM-NEXT: sd a2, 8(sp)
+; LP64E-FPELIM-NEXT: addi a3, sp, 16
; LP64E-FPELIM-NEXT: add a0, a1, a2
-; LP64E-FPELIM-NEXT: sd a3, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 48
+; LP64E-FPELIM-NEXT: sd a3, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 40
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va3_va_arg:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -64
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -56
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: sd a5, 24(s0)
; LP64E-WITHFP-NEXT: sd a4, 16(s0)
; LP64E-WITHFP-NEXT: sd a3, 8(s0)
@@ -761,9 +761,9 @@ define i64 @va3_va_arg(i32 %a, i64 %b, ...) nounwind {
; LP64E-WITHFP-NEXT: addi a3, s0, 8
; LP64E-WITHFP-NEXT: add a0, a1, a2
; LP64E-WITHFP-NEXT: sd a3, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 64
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 56
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -1208,24 +1208,24 @@ define i32 @va6_no_fixed_args(...) nounwind {
;
; LP64E-FPELIM-LABEL: va6_no_fixed_args:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -64
-; LP64E-FPELIM-NEXT: sd a5, 56(sp)
-; LP64E-FPELIM-NEXT: sd a4, 48(sp)
-; LP64E-FPELIM-NEXT: sd a3, 40(sp)
-; LP64E-FPELIM-NEXT: sd a2, 32(sp)
-; LP64E-FPELIM-NEXT: sd a1, 24(sp)
-; LP64E-FPELIM-NEXT: sd a0, 16(sp)
-; LP64E-FPELIM-NEXT: addi a1, sp, 24
-; LP64E-FPELIM-NEXT: sd a1, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 64
+; LP64E-FPELIM-NEXT: addi sp, sp, -56
+; LP64E-FPELIM-NEXT: sd a5, 48(sp)
+; LP64E-FPELIM-NEXT: sd a4, 40(sp)
+; LP64E-FPELIM-NEXT: sd a3, 32(sp)
+; LP64E-FPELIM-NEXT: sd a2, 24(sp)
+; LP64E-FPELIM-NEXT: sd a1, 16(sp)
+; LP64E-FPELIM-NEXT: sd a0, 8(sp)
+; LP64E-FPELIM-NEXT: addi a1, sp, 16
+; LP64E-FPELIM-NEXT: sd a1, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 56
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va6_no_fixed_args:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -80
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -72
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: sd a5, 40(s0)
; LP64E-WITHFP-NEXT: sd a4, 32(s0)
; LP64E-WITHFP-NEXT: sd a3, 24(s0)
@@ -1234,9 +1234,9 @@ define i32 @va6_no_fixed_args(...) nounwind {
; LP64E-WITHFP-NEXT: sd a0, 0(s0)
; LP64E-WITHFP-NEXT: addi a1, s0, 8
; LP64E-WITHFP-NEXT: sd a1, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 80
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 72
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
diff --git a/llvm/test/CodeGen/RISCV/vararg.ll b/llvm/test/CodeGen/RISCV/vararg.ll
index 14afbae3afbdd6..621f54946e4cdf 100644
--- a/llvm/test/CodeGen/RISCV/vararg.ll
+++ b/llvm/test/CodeGen/RISCV/vararg.ll
@@ -111,28 +111,28 @@ define i32 @va1(ptr %fmt, ...) {
;
; ILP32E-FPELIM-LABEL: va1:
; ILP32E-FPELIM: # %bb.0:
-; ILP32E-FPELIM-NEXT: addi sp, sp, -32
-; ILP32E-FPELIM-NEXT: .cfi_def_cfa_offset 32
+; ILP32E-FPELIM-NEXT: addi sp, sp, -28
+; ILP32E-FPELIM-NEXT: .cfi_def_cfa_offset 28
; ILP32E-FPELIM-NEXT: mv a0, a1
-; ILP32E-FPELIM-NEXT: sw a5, 28(sp)
-; ILP32E-FPELIM-NEXT: sw a4, 24(sp)
-; ILP32E-FPELIM-NEXT: sw a3, 20(sp)
-; ILP32E-FPELIM-NEXT: sw a2, 16(sp)
-; ILP32E-FPELIM-NEXT: sw a1, 12(sp)
-; ILP32E-FPELIM-NEXT: addi a1, sp, 16
-; ILP32E-FPELIM-NEXT: sw a1, 4(sp)
-; ILP32E-FPELIM-NEXT: addi sp, sp, 32
+; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
+; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
+; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
+; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
+; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
+; ILP32E-FPELIM-NEXT: addi a1, sp, 12
+; ILP32E-FPELIM-NEXT: sw a1, 0(sp)
+; ILP32E-FPELIM-NEXT: addi sp, sp, 28
; ILP32E-FPELIM-NEXT: ret
;
; ILP32E-WITHFP-LABEL: va1:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -48
-; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 48
-; ILP32E-WITHFP-NEXT: sw ra, 20(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 16(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi sp, sp, -36
+; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 36
+; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
; ILP32E-WITHFP-NEXT: .cfi_offset ra, -28
; ILP32E-WITHFP-NEXT: .cfi_offset s0, -32
-; ILP32E-WITHFP-NEXT: addi s0, sp, 24
+; ILP32E-WITHFP-NEXT: addi s0, sp, 12
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 24
; ILP32E-WITHFP-NEXT: mv a0, a1
; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
@@ -142,9 +142,9 @@ define i32 @va1(ptr %fmt, ...) {
; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
; ILP32E-WITHFP-NEXT: addi a1, s0, 8
; ILP32E-WITHFP-NEXT: sw a1, -12(s0)
-; ILP32E-WITHFP-NEXT: lw ra, 20(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 16(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 48
+; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 36
; ILP32E-WITHFP-NEXT: ret
;
; LP64-LP64F-LP64D-FPELIM-LABEL: va1:
@@ -191,28 +191,28 @@ define i32 @va1(ptr %fmt, ...) {
;
; LP64E-FPELIM-LABEL: va1:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -64
-; LP64E-FPELIM-NEXT: .cfi_def_cfa_offset 64
-; LP64E-FPELIM-NEXT: sd a1, 24(sp)
-; LP64E-FPELIM-NEXT: addi a0, sp, 28
-; LP64E-FPELIM-NEXT: sd a0, 8(sp)
-; LP64E-FPELIM-NEXT: lw a0, 24(sp)
-; LP64E-FPELIM-NEXT: sd a5, 56(sp)
-; LP64E-FPELIM-NEXT: sd a4, 48(sp)
-; LP64E-FPELIM-NEXT: sd a3, 40(sp)
-; LP64E-FPELIM-NEXT: sd a2, 32(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 64
+; LP64E-FPELIM-NEXT: addi sp, sp, -56
+; LP64E-FPELIM-NEXT: .cfi_def_cfa_offset 56
+; LP64E-FPELIM-NEXT: sd a1, 16(sp)
+; LP64E-FPELIM-NEXT: addi a0, sp, 20
+; LP64E-FPELIM-NEXT: sd a0, 0(sp)
+; LP64E-FPELIM-NEXT: lw a0, 16(sp)
+; LP64E-FPELIM-NEXT: sd a5, 48(sp)
+; LP64E-FPELIM-NEXT: sd a4, 40(sp)
+; LP64E-FPELIM-NEXT: sd a3, 32(sp)
+; LP64E-FPELIM-NEXT: sd a2, 24(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 56
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va1:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -80
-; LP64E-WITHFP-NEXT: .cfi_def_cfa_offset 80
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi sp, sp, -72
+; LP64E-WITHFP-NEXT: .cfi_def_cfa_offset 72
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
; LP64E-WITHFP-NEXT: .cfi_offset ra, -56
; LP64E-WITHFP-NEXT: .cfi_offset s0, -64
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: .cfi_def_cfa s0, 48
; LP64E-WITHFP-NEXT: sd a1, 8(s0)
; LP64E-WITHFP-NEXT: addi a0, s0, 12
@@ -222,9 +222,9 @@ define i32 @va1(ptr %fmt, ...) {
; LP64E-WITHFP-NEXT: sd a4, 32(s0)
; LP64E-WITHFP-NEXT: sd a3, 24(s0)
; LP64E-WITHFP-NEXT: sd a2, 16(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 80
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 72
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -292,24 +292,24 @@ define i32 @va1_va_arg(ptr %fmt, ...) nounwind {
;
; ILP32E-FPELIM-LABEL: va1_va_arg:
; ILP32E-FPELIM: # %bb.0:
-; ILP32E-FPELIM-NEXT: addi sp, sp, -32
+; ILP32E-FPELIM-NEXT: addi sp, sp, -28
; ILP32E-FPELIM-NEXT: mv a0, a1
-; ILP32E-FPELIM-NEXT: sw a5, 28(sp)
-; ILP32E-FPELIM-NEXT: sw a4, 24(sp)
-; ILP32E-FPELIM-NEXT: sw a3, 20(sp)
-; ILP32E-FPELIM-NEXT: sw a2, 16(sp)
-; ILP32E-FPELIM-NEXT: sw a1, 12(sp)
-; ILP32E-FPELIM-NEXT: addi a1, sp, 16
-; ILP32E-FPELIM-NEXT: sw a1, 4(sp)
-; ILP32E-FPELIM-NEXT: addi sp, sp, 32
+; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
+; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
+; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
+; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
+; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
+; ILP32E-FPELIM-NEXT: addi a1, sp, 12
+; ILP32E-FPELIM-NEXT: sw a1, 0(sp)
+; ILP32E-FPELIM-NEXT: addi sp, sp, 28
; ILP32E-FPELIM-NEXT: ret
;
; ILP32E-WITHFP-LABEL: va1_va_arg:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -48
-; ILP32E-WITHFP-NEXT: sw ra, 20(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 16(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: addi s0, sp, 24
+; ILP32E-WITHFP-NEXT: addi sp, sp, -36
+; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi s0, sp, 12
; ILP32E-WITHFP-NEXT: mv a0, a1
; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
@@ -318,9 +318,9 @@ define i32 @va1_va_arg(ptr %fmt, ...) nounwind {
; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
; ILP32E-WITHFP-NEXT: addi a1, s0, 8
; ILP32E-WITHFP-NEXT: sw a1, -12(s0)
-; ILP32E-WITHFP-NEXT: lw ra, 20(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 16(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 48
+; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 36
; ILP32E-WITHFP-NEXT: ret
;
; LP64-LP64F-LP64D-FPELIM-LABEL: va1_va_arg:
@@ -362,24 +362,24 @@ define i32 @va1_va_arg(ptr %fmt, ...) nounwind {
;
; LP64E-FPELIM-LABEL: va1_va_arg:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -64
+; LP64E-FPELIM-NEXT: addi sp, sp, -56
; LP64E-FPELIM-NEXT: mv a0, a1
-; LP64E-FPELIM-NEXT: sd a5, 56(sp)
-; LP64E-FPELIM-NEXT: sd a4, 48(sp)
-; LP64E-FPELIM-NEXT: sd a3, 40(sp)
-; LP64E-FPELIM-NEXT: sd a2, 32(sp)
-; LP64E-FPELIM-NEXT: sd a1, 24(sp)
-; LP64E-FPELIM-NEXT: addi a1, sp, 32
-; LP64E-FPELIM-NEXT: sd a1, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 64
+; LP64E-FPELIM-NEXT: sd a5, 48(sp)
+; LP64E-FPELIM-NEXT: sd a4, 40(sp)
+; LP64E-FPELIM-NEXT: sd a3, 32(sp)
+; LP64E-FPELIM-NEXT: sd a2, 24(sp)
+; LP64E-FPELIM-NEXT: sd a1, 16(sp)
+; LP64E-FPELIM-NEXT: addi a1, sp, 24
+; LP64E-FPELIM-NEXT: sd a1, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 56
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va1_va_arg:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -80
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -72
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: mv a0, a1
; LP64E-WITHFP-NEXT: sd a5, 40(s0)
; LP64E-WITHFP-NEXT: sd a4, 32(s0)
@@ -388,9 +388,9 @@ define i32 @va1_va_arg(ptr %fmt, ...) nounwind {
; LP64E-WITHFP-NEXT: sd a1, 8(s0)
; LP64E-WITHFP-NEXT: addi a1, s0, 16
; LP64E-WITHFP-NEXT: sd a1, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 80
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 72
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -879,29 +879,29 @@ define i64 @va2(ptr %fmt, ...) nounwind {
;
; ILP32E-FPELIM-LABEL: va2:
; ILP32E-FPELIM: # %bb.0:
-; ILP32E-FPELIM-NEXT: addi sp, sp, -32
-; ILP32E-FPELIM-NEXT: sw a5, 28(sp)
-; ILP32E-FPELIM-NEXT: sw a4, 24(sp)
-; ILP32E-FPELIM-NEXT: sw a3, 20(sp)
-; ILP32E-FPELIM-NEXT: sw a2, 16(sp)
-; ILP32E-FPELIM-NEXT: sw a1, 12(sp)
-; ILP32E-FPELIM-NEXT: addi a0, sp, 12
-; ILP32E-FPELIM-NEXT: sw a0, 4(sp)
-; ILP32E-FPELIM-NEXT: addi a0, sp, 19
+; ILP32E-FPELIM-NEXT: addi sp, sp, -28
+; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
+; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
+; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
+; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
+; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
+; ILP32E-FPELIM-NEXT: addi a0, sp, 8
+; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
+; ILP32E-FPELIM-NEXT: addi a0, sp, 15
; ILP32E-FPELIM-NEXT: andi a0, a0, -8
-; ILP32E-FPELIM-NEXT: addi a1, sp, 27
-; ILP32E-FPELIM-NEXT: sw a1, 4(sp)
+; ILP32E-FPELIM-NEXT: addi a1, sp, 23
+; ILP32E-FPELIM-NEXT: sw a1, 0(sp)
; ILP32E-FPELIM-NEXT: lw a1, 4(a0)
; ILP32E-FPELIM-NEXT: lw a0, 0(a0)
-; ILP32E-FPELIM-NEXT: addi sp, sp, 32
+; ILP32E-FPELIM-NEXT: addi sp, sp, 28
; ILP32E-FPELIM-NEXT: ret
;
; ILP32E-WITHFP-LABEL: va2:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -48
-; ILP32E-WITHFP-NEXT: sw ra, 20(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 16(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: addi s0, sp, 24
+; ILP32E-WITHFP-NEXT: addi sp, sp, -36
+; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi s0, sp, 12
; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
@@ -915,9 +915,9 @@ define i64 @va2(ptr %fmt, ...) nounwind {
; ILP32E-WITHFP-NEXT: sw a1, -12(s0)
; ILP32E-WITHFP-NEXT: lw a1, 4(a0)
; ILP32E-WITHFP-NEXT: lw a0, 0(a0)
-; ILP32E-WITHFP-NEXT: lw ra, 20(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 16(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 48
+; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 36
; ILP32E-WITHFP-NEXT: ret
;
; LP64-LP64F-LP64D-FPELIM-LABEL: va2:
@@ -959,24 +959,24 @@ define i64 @va2(ptr %fmt, ...) nounwind {
;
; LP64E-FPELIM-LABEL: va2:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -64
+; LP64E-FPELIM-NEXT: addi sp, sp, -56
; LP64E-FPELIM-NEXT: mv a0, a1
-; LP64E-FPELIM-NEXT: sd a5, 56(sp)
-; LP64E-FPELIM-NEXT: sd a4, 48(sp)
-; LP64E-FPELIM-NEXT: sd a3, 40(sp)
-; LP64E-FPELIM-NEXT: sd a2, 32(sp)
-; LP64E-FPELIM-NEXT: sd a1, 24(sp)
-; LP64E-FPELIM-NEXT: addi a1, sp, 39
-; LP64E-FPELIM-NEXT: sd a1, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 64
+; LP64E-FPELIM-NEXT: sd a5, 48(sp)
+; LP64E-FPELIM-NEXT: sd a4, 40(sp)
+; LP64E-FPELIM-NEXT: sd a3, 32(sp)
+; LP64E-FPELIM-NEXT: sd a2, 24(sp)
+; LP64E-FPELIM-NEXT: sd a1, 16(sp)
+; LP64E-FPELIM-NEXT: addi a1, sp, 31
+; LP64E-FPELIM-NEXT: sd a1, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 56
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va2:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -80
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -72
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: mv a0, a1
; LP64E-WITHFP-NEXT: sd a5, 40(s0)
; LP64E-WITHFP-NEXT: sd a4, 32(s0)
@@ -985,9 +985,9 @@ define i64 @va2(ptr %fmt, ...) nounwind {
; LP64E-WITHFP-NEXT: sd a1, 8(s0)
; LP64E-WITHFP-NEXT: addi a1, s0, 23
; LP64E-WITHFP-NEXT: sd a1, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 80
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 72
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -1076,29 +1076,29 @@ define i64 @va2_va_arg(ptr %fmt, ...) nounwind {
;
; ILP32E-FPELIM-LABEL: va2_va_arg:
; ILP32E-FPELIM: # %bb.0:
-; ILP32E-FPELIM-NEXT: addi sp, sp, -32
-; ILP32E-FPELIM-NEXT: sw a5, 28(sp)
-; ILP32E-FPELIM-NEXT: sw a4, 24(sp)
-; ILP32E-FPELIM-NEXT: sw a3, 20(sp)
-; ILP32E-FPELIM-NEXT: sw a2, 16(sp)
-; ILP32E-FPELIM-NEXT: sw a1, 12(sp)
-; ILP32E-FPELIM-NEXT: addi a0, sp, 19
+; ILP32E-FPELIM-NEXT: addi sp, sp, -28
+; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
+; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
+; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
+; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
+; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
+; ILP32E-FPELIM-NEXT: addi a0, sp, 15
; ILP32E-FPELIM-NEXT: andi a1, a0, -8
; ILP32E-FPELIM-NEXT: addi a0, a1, 4
-; ILP32E-FPELIM-NEXT: sw a0, 4(sp)
+; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
; ILP32E-FPELIM-NEXT: lw a0, 0(a1)
; ILP32E-FPELIM-NEXT: addi a2, a1, 8
-; ILP32E-FPELIM-NEXT: sw a2, 4(sp)
+; ILP32E-FPELIM-NEXT: sw a2, 0(sp)
; ILP32E-FPELIM-NEXT: lw a1, 4(a1)
-; ILP32E-FPELIM-NEXT: addi sp, sp, 32
+; ILP32E-FPELIM-NEXT: addi sp, sp, 28
; ILP32E-FPELIM-NEXT: ret
;
; ILP32E-WITHFP-LABEL: va2_va_arg:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -48
-; ILP32E-WITHFP-NEXT: sw ra, 20(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 16(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: addi s0, sp, 24
+; ILP32E-WITHFP-NEXT: addi sp, sp, -36
+; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi s0, sp, 12
; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
@@ -1112,9 +1112,9 @@ define i64 @va2_va_arg(ptr %fmt, ...) nounwind {
; ILP32E-WITHFP-NEXT: addi a2, a1, 8
; ILP32E-WITHFP-NEXT: sw a2, -12(s0)
; ILP32E-WITHFP-NEXT: lw a1, 4(a1)
-; ILP32E-WITHFP-NEXT: lw ra, 20(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 16(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 48
+; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 36
; ILP32E-WITHFP-NEXT: ret
;
; LP64-LP64F-LP64D-FPELIM-LABEL: va2_va_arg:
@@ -1156,24 +1156,24 @@ define i64 @va2_va_arg(ptr %fmt, ...) nounwind {
;
; LP64E-FPELIM-LABEL: va2_va_arg:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -64
+; LP64E-FPELIM-NEXT: addi sp, sp, -56
; LP64E-FPELIM-NEXT: mv a0, a1
-; LP64E-FPELIM-NEXT: sd a5, 56(sp)
-; LP64E-FPELIM-NEXT: sd a4, 48(sp)
-; LP64E-FPELIM-NEXT: sd a3, 40(sp)
-; LP64E-FPELIM-NEXT: sd a2, 32(sp)
-; LP64E-FPELIM-NEXT: sd a1, 24(sp)
-; LP64E-FPELIM-NEXT: addi a1, sp, 32
-; LP64E-FPELIM-NEXT: sd a1, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 64
+; LP64E-FPELIM-NEXT: sd a5, 48(sp)
+; LP64E-FPELIM-NEXT: sd a4, 40(sp)
+; LP64E-FPELIM-NEXT: sd a3, 32(sp)
+; LP64E-FPELIM-NEXT: sd a2, 24(sp)
+; LP64E-FPELIM-NEXT: sd a1, 16(sp)
+; LP64E-FPELIM-NEXT: addi a1, sp, 24
+; LP64E-FPELIM-NEXT: sd a1, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 56
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va2_va_arg:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -80
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -72
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: mv a0, a1
; LP64E-WITHFP-NEXT: sd a5, 40(s0)
; LP64E-WITHFP-NEXT: sd a4, 32(s0)
@@ -1182,9 +1182,9 @@ define i64 @va2_va_arg(ptr %fmt, ...) nounwind {
; LP64E-WITHFP-NEXT: sd a1, 8(s0)
; LP64E-WITHFP-NEXT: addi a1, s0, 16
; LP64E-WITHFP-NEXT: sd a1, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 80
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 72
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -1389,31 +1389,31 @@ define i64 @va3(i32 %a, i64 %b, ...) nounwind {
;
; ILP32E-FPELIM-LABEL: va3:
; ILP32E-FPELIM: # %bb.0:
-; ILP32E-FPELIM-NEXT: addi sp, sp, -32
-; ILP32E-FPELIM-NEXT: sw a5, 28(sp)
-; ILP32E-FPELIM-NEXT: sw a4, 24(sp)
-; ILP32E-FPELIM-NEXT: sw a3, 20(sp)
-; ILP32E-FPELIM-NEXT: addi a0, sp, 20
-; ILP32E-FPELIM-NEXT: sw a0, 12(sp)
-; ILP32E-FPELIM-NEXT: addi a0, sp, 27
+; ILP32E-FPELIM-NEXT: addi sp, sp, -20
+; ILP32E-FPELIM-NEXT: sw a5, 16(sp)
+; ILP32E-FPELIM-NEXT: sw a4, 12(sp)
+; ILP32E-FPELIM-NEXT: sw a3, 8(sp)
+; ILP32E-FPELIM-NEXT: addi a0, sp, 8
+; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
+; ILP32E-FPELIM-NEXT: addi a0, sp, 15
; ILP32E-FPELIM-NEXT: andi a0, a0, -8
-; ILP32E-FPELIM-NEXT: addi a3, sp, 35
-; ILP32E-FPELIM-NEXT: sw a3, 12(sp)
+; ILP32E-FPELIM-NEXT: addi a3, sp, 23
+; ILP32E-FPELIM-NEXT: sw a3, 0(sp)
; ILP32E-FPELIM-NEXT: lw a3, 4(a0)
; ILP32E-FPELIM-NEXT: lw a0, 0(a0)
; ILP32E-FPELIM-NEXT: add a2, a2, a3
; ILP32E-FPELIM-NEXT: add a0, a1, a0
; ILP32E-FPELIM-NEXT: sltu a1, a0, a1
; ILP32E-FPELIM-NEXT: add a1, a2, a1
-; ILP32E-FPELIM-NEXT: addi sp, sp, 32
+; ILP32E-FPELIM-NEXT: addi sp, sp, 20
; ILP32E-FPELIM-NEXT: ret
;
; ILP32E-WITHFP-LABEL: va3:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -32
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi sp, sp, -28
+; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi s0, sp, 12
; ILP32E-WITHFP-NEXT: sw a5, 12(s0)
; ILP32E-WITHFP-NEXT: sw a4, 8(s0)
; ILP32E-WITHFP-NEXT: sw a3, 4(s0)
@@ -1429,9 +1429,9 @@ define i64 @va3(i32 %a, i64 %b, ...) nounwind {
; ILP32E-WITHFP-NEXT: add a0, a1, a0
; ILP32E-WITHFP-NEXT: sltu a1, a0, a1
; ILP32E-WITHFP-NEXT: add a1, a2, a1
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 32
+; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 28
; ILP32E-WITHFP-NEXT: ret
;
; LP64-LP64F-LP64D-FPELIM-LABEL: va3:
@@ -1471,23 +1471,23 @@ define i64 @va3(i32 %a, i64 %b, ...) nounwind {
;
; LP64E-FPELIM-LABEL: va3:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -48
-; LP64E-FPELIM-NEXT: sd a5, 40(sp)
-; LP64E-FPELIM-NEXT: sd a4, 32(sp)
-; LP64E-FPELIM-NEXT: sd a3, 24(sp)
-; LP64E-FPELIM-NEXT: sd a2, 16(sp)
-; LP64E-FPELIM-NEXT: addi a3, sp, 31
+; LP64E-FPELIM-NEXT: addi sp, sp, -40
+; LP64E-FPELIM-NEXT: sd a5, 32(sp)
+; LP64E-FPELIM-NEXT: sd a4, 24(sp)
+; LP64E-FPELIM-NEXT: sd a3, 16(sp)
+; LP64E-FPELIM-NEXT: sd a2, 8(sp)
+; LP64E-FPELIM-NEXT: addi a3, sp, 23
; LP64E-FPELIM-NEXT: add a0, a1, a2
-; LP64E-FPELIM-NEXT: sd a3, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 48
+; LP64E-FPELIM-NEXT: sd a3, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 40
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va3:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -64
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -56
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: sd a5, 24(s0)
; LP64E-WITHFP-NEXT: sd a4, 16(s0)
; LP64E-WITHFP-NEXT: sd a3, 8(s0)
@@ -1495,9 +1495,9 @@ define i64 @va3(i32 %a, i64 %b, ...) nounwind {
; LP64E-WITHFP-NEXT: addi a3, s0, 15
; LP64E-WITHFP-NEXT: add a0, a1, a2
; LP64E-WITHFP-NEXT: sd a3, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 64
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 56
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -1593,31 +1593,31 @@ define i64 @va3_va_arg(i32 %a, i64 %b, ...) nounwind {
;
; ILP32E-FPELIM-LABEL: va3_va_arg:
; ILP32E-FPELIM: # %bb.0:
-; ILP32E-FPELIM-NEXT: addi sp, sp, -32
-; ILP32E-FPELIM-NEXT: sw a5, 28(sp)
-; ILP32E-FPELIM-NEXT: sw a4, 24(sp)
-; ILP32E-FPELIM-NEXT: sw a3, 20(sp)
-; ILP32E-FPELIM-NEXT: addi a0, sp, 27
+; ILP32E-FPELIM-NEXT: addi sp, sp, -20
+; ILP32E-FPELIM-NEXT: sw a5, 16(sp)
+; ILP32E-FPELIM-NEXT: sw a4, 12(sp)
+; ILP32E-FPELIM-NEXT: sw a3, 8(sp)
+; ILP32E-FPELIM-NEXT: addi a0, sp, 15
; ILP32E-FPELIM-NEXT: andi a0, a0, -8
; ILP32E-FPELIM-NEXT: addi a3, a0, 4
-; ILP32E-FPELIM-NEXT: sw a3, 12(sp)
+; ILP32E-FPELIM-NEXT: sw a3, 0(sp)
; ILP32E-FPELIM-NEXT: lw a3, 0(a0)
; ILP32E-FPELIM-NEXT: addi a4, a0, 8
-; ILP32E-FPELIM-NEXT: sw a4, 12(sp)
+; ILP32E-FPELIM-NEXT: sw a4, 0(sp)
; ILP32E-FPELIM-NEXT: lw a4, 4(a0)
; ILP32E-FPELIM-NEXT: add a0, a1, a3
; ILP32E-FPELIM-NEXT: sltu a1, a0, a1
; ILP32E-FPELIM-NEXT: add a2, a2, a4
; ILP32E-FPELIM-NEXT: add a1, a2, a1
-; ILP32E-FPELIM-NEXT: addi sp, sp, 32
+; ILP32E-FPELIM-NEXT: addi sp, sp, 20
; ILP32E-FPELIM-NEXT: ret
;
; ILP32E-WITHFP-LABEL: va3_va_arg:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -32
-; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: addi s0, sp, 16
+; ILP32E-WITHFP-NEXT: addi sp, sp, -28
+; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi s0, sp, 12
; ILP32E-WITHFP-NEXT: sw a5, 12(s0)
; ILP32E-WITHFP-NEXT: sw a4, 8(s0)
; ILP32E-WITHFP-NEXT: sw a3, 4(s0)
@@ -1633,9 +1633,9 @@ define i64 @va3_va_arg(i32 %a, i64 %b, ...) nounwind {
; ILP32E-WITHFP-NEXT: sltu a1, a0, a1
; ILP32E-WITHFP-NEXT: add a2, a2, a4
; ILP32E-WITHFP-NEXT: add a1, a2, a1
-; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 32
+; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 28
; ILP32E-WITHFP-NEXT: ret
;
; LP64-LP64F-LP64D-FPELIM-LABEL: va3_va_arg:
@@ -1675,23 +1675,23 @@ define i64 @va3_va_arg(i32 %a, i64 %b, ...) nounwind {
;
; LP64E-FPELIM-LABEL: va3_va_arg:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -48
-; LP64E-FPELIM-NEXT: sd a5, 40(sp)
-; LP64E-FPELIM-NEXT: sd a4, 32(sp)
-; LP64E-FPELIM-NEXT: sd a3, 24(sp)
-; LP64E-FPELIM-NEXT: sd a2, 16(sp)
-; LP64E-FPELIM-NEXT: addi a3, sp, 24
+; LP64E-FPELIM-NEXT: addi sp, sp, -40
+; LP64E-FPELIM-NEXT: sd a5, 32(sp)
+; LP64E-FPELIM-NEXT: sd a4, 24(sp)
+; LP64E-FPELIM-NEXT: sd a3, 16(sp)
+; LP64E-FPELIM-NEXT: sd a2, 8(sp)
+; LP64E-FPELIM-NEXT: addi a3, sp, 16
; LP64E-FPELIM-NEXT: add a0, a1, a2
-; LP64E-FPELIM-NEXT: sd a3, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 48
+; LP64E-FPELIM-NEXT: sd a3, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 40
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va3_va_arg:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -64
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -56
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: sd a5, 24(s0)
; LP64E-WITHFP-NEXT: sd a4, 16(s0)
; LP64E-WITHFP-NEXT: sd a3, 8(s0)
@@ -1699,9 +1699,9 @@ define i64 @va3_va_arg(i32 %a, i64 %b, ...) nounwind {
; LP64E-WITHFP-NEXT: addi a3, s0, 8
; LP64E-WITHFP-NEXT: add a0, a1, a2
; LP64E-WITHFP-NEXT: sd a3, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 64
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 56
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -2675,24 +2675,24 @@ define i32 @va6_no_fixed_args(...) nounwind {
;
; ILP32E-FPELIM-LABEL: va6_no_fixed_args:
; ILP32E-FPELIM: # %bb.0:
-; ILP32E-FPELIM-NEXT: addi sp, sp, -32
-; ILP32E-FPELIM-NEXT: sw a5, 28(sp)
-; ILP32E-FPELIM-NEXT: sw a4, 24(sp)
-; ILP32E-FPELIM-NEXT: sw a3, 20(sp)
-; ILP32E-FPELIM-NEXT: sw a2, 16(sp)
-; ILP32E-FPELIM-NEXT: sw a1, 12(sp)
-; ILP32E-FPELIM-NEXT: sw a0, 8(sp)
-; ILP32E-FPELIM-NEXT: addi a1, sp, 12
-; ILP32E-FPELIM-NEXT: sw a1, 4(sp)
-; ILP32E-FPELIM-NEXT: addi sp, sp, 32
+; ILP32E-FPELIM-NEXT: addi sp, sp, -28
+; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
+; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
+; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
+; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
+; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
+; ILP32E-FPELIM-NEXT: sw a0, 4(sp)
+; ILP32E-FPELIM-NEXT: addi a1, sp, 8
+; ILP32E-FPELIM-NEXT: sw a1, 0(sp)
+; ILP32E-FPELIM-NEXT: addi sp, sp, 28
; ILP32E-FPELIM-NEXT: ret
;
; ILP32E-WITHFP-LABEL: va6_no_fixed_args:
; ILP32E-WITHFP: # %bb.0:
-; ILP32E-WITHFP-NEXT: addi sp, sp, -48
-; ILP32E-WITHFP-NEXT: sw ra, 20(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: sw s0, 16(sp) # 4-byte Folded Spill
-; ILP32E-WITHFP-NEXT: addi s0, sp, 24
+; ILP32E-WITHFP-NEXT: addi sp, sp, -36
+; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
+; ILP32E-WITHFP-NEXT: addi s0, sp, 12
; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
@@ -2701,9 +2701,9 @@ define i32 @va6_no_fixed_args(...) nounwind {
; ILP32E-WITHFP-NEXT: sw a0, 0(s0)
; ILP32E-WITHFP-NEXT: addi a1, s0, 4
; ILP32E-WITHFP-NEXT: sw a1, -12(s0)
-; ILP32E-WITHFP-NEXT: lw ra, 20(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: lw s0, 16(sp) # 4-byte Folded Reload
-; ILP32E-WITHFP-NEXT: addi sp, sp, 48
+; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
+; ILP32E-WITHFP-NEXT: addi sp, sp, 36
; ILP32E-WITHFP-NEXT: ret
;
; LP64-LP64F-LP64D-FPELIM-LABEL: va6_no_fixed_args:
@@ -2745,24 +2745,24 @@ define i32 @va6_no_fixed_args(...) nounwind {
;
; LP64E-FPELIM-LABEL: va6_no_fixed_args:
; LP64E-FPELIM: # %bb.0:
-; LP64E-FPELIM-NEXT: addi sp, sp, -64
-; LP64E-FPELIM-NEXT: sd a5, 56(sp)
-; LP64E-FPELIM-NEXT: sd a4, 48(sp)
-; LP64E-FPELIM-NEXT: sd a3, 40(sp)
-; LP64E-FPELIM-NEXT: sd a2, 32(sp)
-; LP64E-FPELIM-NEXT: sd a1, 24(sp)
-; LP64E-FPELIM-NEXT: sd a0, 16(sp)
-; LP64E-FPELIM-NEXT: addi a1, sp, 24
-; LP64E-FPELIM-NEXT: sd a1, 8(sp)
-; LP64E-FPELIM-NEXT: addi sp, sp, 64
+; LP64E-FPELIM-NEXT: addi sp, sp, -56
+; LP64E-FPELIM-NEXT: sd a5, 48(sp)
+; LP64E-FPELIM-NEXT: sd a4, 40(sp)
+; LP64E-FPELIM-NEXT: sd a3, 32(sp)
+; LP64E-FPELIM-NEXT: sd a2, 24(sp)
+; LP64E-FPELIM-NEXT: sd a1, 16(sp)
+; LP64E-FPELIM-NEXT: sd a0, 8(sp)
+; LP64E-FPELIM-NEXT: addi a1, sp, 16
+; LP64E-FPELIM-NEXT: sd a1, 0(sp)
+; LP64E-FPELIM-NEXT: addi sp, sp, 56
; LP64E-FPELIM-NEXT: ret
;
; LP64E-WITHFP-LABEL: va6_no_fixed_args:
; LP64E-WITHFP: # %bb.0:
-; LP64E-WITHFP-NEXT: addi sp, sp, -80
-; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
-; LP64E-WITHFP-NEXT: addi s0, sp, 32
+; LP64E-WITHFP-NEXT: addi sp, sp, -72
+; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
+; LP64E-WITHFP-NEXT: addi s0, sp, 24
; LP64E-WITHFP-NEXT: sd a5, 40(s0)
; LP64E-WITHFP-NEXT: sd a4, 32(s0)
; LP64E-WITHFP-NEXT: sd a3, 24(s0)
@@ -2771,9 +2771,9 @@ define i32 @va6_no_fixed_args(...) nounwind {
; LP64E-WITHFP-NEXT: sd a0, 0(s0)
; LP64E-WITHFP-NEXT: addi a1, s0, 8
; LP64E-WITHFP-NEXT: sd a1, -24(s0)
-; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
-; LP64E-WITHFP-NEXT: addi sp, sp, 80
+; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
+; LP64E-WITHFP-NEXT: addi sp, sp, 72
; LP64E-WITHFP-NEXT: ret
%va = alloca ptr
call void @llvm.va_start(ptr %va)
@@ -2934,7 +2934,7 @@ define i32 @va_large_stack(ptr %fmt, ...) {
; ILP32E-WITHFP-NEXT: addi s0, sp, 2020
; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 24
; ILP32E-WITHFP-NEXT: lui a0, 24414
-; ILP32E-WITHFP-NEXT: addi a0, a0, -1740
+; ILP32E-WITHFP-NEXT: addi a0, a0, -1748
; ILP32E-WITHFP-NEXT: sub sp, sp, a0
; ILP32E-WITHFP-NEXT: mv a0, a1
; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
@@ -2947,7 +2947,7 @@ define i32 @va_large_stack(ptr %fmt, ...) {
; ILP32E-WITHFP-NEXT: sub a2, s0, a2
; ILP32E-WITHFP-NEXT: sw a1, -272(a2)
; ILP32E-WITHFP-NEXT: lui a1, 24414
-; ILP32E-WITHFP-NEXT: addi a1, a1, -1740
+; ILP32E-WITHFP-NEXT: addi a1, a1, -1748
; ILP32E-WITHFP-NEXT: add sp, sp, a1
; ILP32E-WITHFP-NEXT: lw ra, 2016(sp) # 4-byte Folded Reload
; ILP32E-WITHFP-NEXT: lw s0, 2012(sp) # 4-byte Folded Reload
More information about the llvm-commits
mailing list