1 ; RUN: split-file %s %t
2 ; RUN: cat %t/main.ll %t/align4.ll > %t/a2.ll
3 ; RUN: cat %t/main.ll %t/align16.ll > %t/b2.ll
4 ; RUN: llc -mtriple=i386-unknown-freebsd -mcpu=core2 -relocation-model=pic < %t/a2.ll | FileCheck %s -check-prefix=UNALIGNED
5 ; RUN: llc -mtriple=i386-unknown-freebsd -mcpu=core2 -relocation-model=pic < %t/b2.ll | FileCheck %s -check-prefix=ALIGNED
6 ; RUN: llc -mtriple=i386-unknown-freebsd -mcpu=core2 -stackrealign -relocation-model=pic < %t/a2.ll | FileCheck %s -check-prefix=FORCEALIGNED
9 @arr = internal unnamed_addr global [32 x i32] zeroinitializer, align 16
17 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
18 %0 = getelementptr inbounds [32 x i32], ptr @arr, i32 0, i32 %index
19 %wide.load = load <4 x i32>, ptr %0, align 16
20 %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 16
29 %index.next = add i32 %index, 4
30 %9 = icmp eq i32 %index.next, 32
31 br i1 %9, label %middle.block, label %vector.body
36 ; We can't fold the spill into a padd unless the stack is aligned. Just spilling
37 ; doesn't force stack realignment though
38 ; UNALIGNED-LABEL: @test1
39 ; UNALIGNED-NOT: andl $-{{..}}, %esp
40 ; UNALIGNED: movdqu {{.*}} # 16-byte Spill
41 ; UNALIGNED-NOT: paddd {{.*}} # 16-byte Folded Reload
43 ; ALIGNED-LABEL: @test1
44 ; ALIGNED-NOT: andl $-{{..}}, %esp
45 ; ALIGNED: movdqa {{.*}} # 16-byte Spill
46 ; ALIGNED: paddd {{.*}} # 16-byte Folded Reload
48 ; FORCEALIGNED-LABEL: @test1
49 ; FORCEALIGNED: andl $-{{..}}, %esp
50 ; FORCEALIGNED: movdqa {{.*}} # 16-byte Spill
51 ; FORCEALIGNED: paddd {{.*}} # 16-byte Folded Reload
53 !llvm.module.flags = !{!0}
55 !0 = !{i32 2, !"override-stack-alignment", i32 4}
57 !0 = !{i32 2, !"override-stack-alignment", i32 16}