11; RUN: llc < %s -march=sbf -mattr=+dynamic-frames | FileCheck %s
22; RUN: llc -march=sbf -mattr=+dynamic-frames-v3,+alu32 < %s | FileCheck --check-prefix=CHECK-V3 %s
3+ ; RUN: llc -march=sbf -mattr=+dynamic-frames-v3,+optimize-stack-space < %s | FileCheck --check-prefix=CHECK-OPT %s
34;
45; Source:
56; int test_func(int * vec, int idx) {
@@ -15,6 +16,7 @@ define i32 @test_func(ptr noundef %vec, i32 noundef %idx) #0 {
1516; CHECK-LABEL: test_func:
1617; CHECK: add64 r10, -128
1718; CHECK-V3-NOT: add64 r10, 128
19+ ; CHECK-OPT: add64 r10, -3968
1820entry:
1921 %vec.addr = alloca ptr , align 8
2022 %idx.addr = alloca i512 , align 4
@@ -36,6 +38,7 @@ declare i64 @read_ptr(ptr %a);
3638define i64 @test_func_4096 (i64 %idx ) {
3739; CHECK-LABEL: test_func_4096
3840; CHECK-V3-NOT: add64 r10, 4096
41+ ; CHECK-OPT-NOT: add64 r10, 4096
3942entry:
4043 %large_var = alloca [4096 x i8 ], align 8
4144 %val = call i64 @read_ptr (ptr %large_var )
4548define i64 @test_func_4128 (i64 %idx ) {
4649; CHECK-LABEL: test_func_4128
4750; CHECK-V3: add64 r10, 64
51+ ; CHECK-OPT: add64 r10, 64
4852; The stack is aligned at 64, so we bump 64 to have a stack size of 4096+64=4160,
4953; so we can fit the 4128 bytes of the array.
5054entry:
0 commit comments