44 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \3; RUN: | FileCheck %s -check-prefix=RV32I4 5; The stack size is 2048 and the SP adjustment will be split.6define i32 @SplitSP() nounwind {7; RV32I-LABEL: SplitSP:8; RV32I: # %bb.0: # %entry9; RV32I-NEXT: addi sp, sp, -203210; RV32I-NEXT: sw ra, 2028(sp) # 4-byte Folded Spill11; RV32I-NEXT: addi sp, sp, -1612; RV32I-NEXT: addi a0, sp, 1613; RV32I-NEXT: call foo14; RV32I-NEXT: li a0, 015; RV32I-NEXT: addi sp, sp, 1616; RV32I-NEXT: lw ra, 2028(sp) # 4-byte Folded Reload17; RV32I-NEXT: addi sp, sp, 203218; RV32I-NEXT: ret19entry:20 %xx = alloca [2028 x i8], align 121 %call = call i32 @foo(ptr nonnull %xx)22 ret i32 023}24 25; The stack size is 2032 and the SP adjustment will not be split.26define i32 @NoSplitSP() nounwind {27; RV32I-LABEL: NoSplitSP:28; RV32I: # %bb.0: # %entry29; RV32I-NEXT: addi sp, sp, -203230; RV32I-NEXT: sw ra, 2028(sp) # 4-byte Folded Spill31; RV32I-NEXT: addi a0, sp, 432; RV32I-NEXT: call foo33; RV32I-NEXT: li a0, 034; RV32I-NEXT: lw ra, 2028(sp) # 4-byte Folded Reload35; RV32I-NEXT: addi sp, sp, 203236; RV32I-NEXT: ret37entry:38 %xx = alloca [2024 x i8], align 139 %call = call i32 @foo(ptr nonnull %xx)40 ret i32 041}42 43declare i32 @foo(ptr)44