53 lines · plain
1; RUN: llc < %s -mtriple=i686-windows -stackrealign | FileCheck %s2 3declare void @good(i32 %a, i32 %b, i32 %c, i32 %d)4declare void @oneparam(i32 %a)5declare void @eightparams(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f, i32 %g, i32 %h)6 7; When there is no reserved call frame, check that additional alignment8; is added when the pushes don't add up to the required alignment.9; CHECK-LABEL: test5:10; CHECK: subl $16, %esp11; CHECK-NEXT: pushl $412; CHECK-NEXT: pushl $313; CHECK-NEXT: pushl $214; CHECK-NEXT: pushl $115; CHECK-NEXT: call16define void @test5(i32 %k) {17entry:18 %a = alloca i32, i32 %k19 call void @good(i32 1, i32 2, i32 3, i32 4)20 ret void21}22 23; When the alignment adds up, do the transformation24; CHECK-LABEL: test5b:25; CHECK: pushl $826; CHECK-NEXT: pushl $727; CHECK-NEXT: pushl $628; CHECK-NEXT: pushl $529; CHECK-NEXT: pushl $430; CHECK-NEXT: pushl $331; CHECK-NEXT: pushl $232; CHECK-NEXT: pushl $133; CHECK-NEXT: call34define void @test5b() optsize {35entry:36 call void @eightparams(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)37 ret void38}39 40; When having to compensate for the alignment isn't worth it,41; don't use pushes.42; CHECK-LABEL: test5c:43; CHECK: movl $1, (%esp)44; CHECK-NEXT: call45define void @test5c() optsize {46entry:47 call void @oneparam(i32 1)48 ret void49}50 51!llvm.module.flags = !{!0}52!0 = !{i32 2, !"override-stack-alignment", i32 32}53