58 lines · plain
1; RUN: split-file %s %t2; RUN: cat %t/main.ll %t/align4.ll > %t/a2.ll3; RUN: cat %t/main.ll %t/align16.ll > %t/b2.ll4; RUN: llc -mtriple=i386-unknown-freebsd -mcpu=core2 -relocation-model=pic < %t/a2.ll | FileCheck %s -check-prefix=UNALIGNED5; RUN: llc -mtriple=i386-unknown-freebsd -mcpu=core2 -relocation-model=pic < %t/b2.ll | FileCheck %s -check-prefix=ALIGNED6; RUN: llc -mtriple=i386-unknown-freebsd -mcpu=core2 -stackrealign -relocation-model=pic < %t/a2.ll | FileCheck %s -check-prefix=FORCEALIGNED7 8;--- main.ll9@arr = internal unnamed_addr global [32 x i32] zeroinitializer, align 1610 11; PR1225012define i32 @test1() {13vector.ph:14 br label %vector.body15 16vector.body:17 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]18 %0 = getelementptr inbounds [32 x i32], ptr @arr, i32 0, i32 %index19 %wide.load = load <4 x i32>, ptr %0, align 1620 %1 = add nsw <4 x i32> %wide.load, <i32 10, i32 10, i32 10, i32 10>21 %2 = xor <4 x i32> %1, <i32 123345, i32 123345, i32 123345, i32 123345>22 %3 = add nsw <4 x i32> %2, <i32 112, i32 112, i32 112, i32 112>23 %4 = xor <4 x i32> %3, <i32 543345, i32 543345, i32 543345, i32 543345>24 %5 = add nsw <4 x i32> %4, <i32 73, i32 73, i32 73, i32 73>25 %6 = xor <4 x i32> %5, <i32 345987, i32 345987, i32 345987, i32 345987>26 %7 = add nsw <4 x i32> %6, <i32 48, i32 48, i32 48, i32 48>27 %8 = xor <4 x i32> %7, <i32 123987, i32 123987, i32 123987, i32 123987>28 store <4 x i32> %8, ptr %0, align 1629 %index.next = add i32 %index, 430 %9 = icmp eq i32 %index.next, 3231 br i1 %9, label %middle.block, label %vector.body32 33middle.block:34 ret i32 035 36; We can't fold the spill into a padd unless the stack is aligned. Just spilling37; doesn't force stack realignment though38; UNALIGNED-LABEL: @test139; UNALIGNED-NOT: andl $-{{..}}, %esp40; UNALIGNED: movdqu {{.*}} # 16-byte Spill41; UNALIGNED-NOT: paddd {{.*}} # 16-byte Folded Reload42 43; ALIGNED-LABEL: @test144; ALIGNED-NOT: andl $-{{..}}, %esp45; ALIGNED: movdqa {{.*}} # 16-byte Spill46; ALIGNED: paddd {{.*}} # 16-byte Folded Reload47 48; FORCEALIGNED-LABEL: @test149; FORCEALIGNED: andl $-{{..}}, %esp50; FORCEALIGNED: movdqa {{.*}} # 16-byte Spill51; FORCEALIGNED: paddd {{.*}} # 16-byte Folded Reload52}53!llvm.module.flags = !{!0}54;--- align4.ll55!0 = !{i32 2, !"override-stack-alignment", i32 4}56;--- align16.ll57!0 = !{i32 2, !"override-stack-alignment", i32 16}58