1 ; RUN: llc %s -O0 -o - | FileCheck -check-prefix=NO-MERGE %s
2 ; RUN: llc %s -O0 -o - -arm-global-merge=false | FileCheck -check-prefix=NO-MERGE %s
3 ; RUN: llc %s -O0 -o - -arm-global-merge=true | FileCheck -check-prefix=MERGE %s
4 ; RUN: llc %s -O1 -o - | FileCheck -check-prefix=NO-MERGE %s
5 ; RUN: llc %s -O1 -o - -arm-global-merge=false | FileCheck -check-prefix=NO-MERGE %s
6 ; RUN: llc %s -O1 -o - -arm-global-merge=true | FileCheck -check-prefix=MERGE %s
7 ; RUN: llc %s -O3 -o - | FileCheck -check-prefix=MERGE %s
8 ; RUN: llc %s -O3 -o - -arm-global-merge=false | FileCheck -check-prefix=NO-MERGE %s
9 ; RUN: llc %s -O3 -o - -arm-global-merge=true | FileCheck -check-prefix=MERGE %s
11 ; MERGE-NOT: .zerofill __DATA,__bss,_bar,20,2
12 ; MERGE-NOT: .zerofill __DATA,__bss,_baz,20,2
13 ; MERGE-NOT: .zerofill __DATA,__bss,_foo,20,2
14 ; MERGE: .zerofill __DATA,__bss,__MergedGlobals,60,2
15 ; MERGE-NOT: .zerofill __DATA,__bss,_bar,20,2
16 ; MERGE-NOT: .zerofill __DATA,__bss,_baz,20,2
17 ; MERGE-NOT: .zerofill __DATA,__bss,_foo,20,2
19 ; NO-MERGE-NOT: .zerofill __DATA,__bss,__MergedGlobals,60,2
20 ; NO-MERGE: .zerofill __DATA,__bss,_bar,20,2
21 ; NO-MERGE: .zerofill __DATA,__bss,_baz,20,2
22 ; NO-MERGE: .zerofill __DATA,__bss,_foo,20,2
23 ; NO-MERGE-NOT: .zerofill __DATA,__bss,__MergedGlobals,60,2
25 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
26 target triple = "thumbv7-apple-ios3.0.0"
28 @bar = internal global [5 x i32] zeroinitializer, align 4
29 @baz = internal global [5 x i32] zeroinitializer, align 4
30 @foo = internal global [5 x i32] zeroinitializer, align 4
32 ; Function Attrs: nounwind ssp
33 define internal void @initialize() #0 {
34 %1 = tail call i32 @calc() #3
35 store i32 %1, ptr @bar, align 4, !tbaa !1
36 %2 = tail call i32 @calc() #3
37 store i32 %2, ptr @baz, align 4, !tbaa !1
38 %3 = tail call i32 @calc() #3
39 store i32 %3, ptr getelementptr inbounds ([5 x i32], ptr @bar, i32 0, i32 1), align 4, !tbaa !1
40 %4 = tail call i32 @calc() #3
41 store i32 %4, ptr getelementptr inbounds ([5 x i32], ptr @baz, i32 0, i32 1), align 4, !tbaa !1
42 %5 = tail call i32 @calc() #3
43 store i32 %5, ptr getelementptr inbounds ([5 x i32], ptr @bar, i32 0, i32 2), align 4, !tbaa !1
44 %6 = tail call i32 @calc() #3
45 store i32 %6, ptr getelementptr inbounds ([5 x i32], ptr @baz, i32 0, i32 2), align 4, !tbaa !1
46 %7 = tail call i32 @calc() #3
47 store i32 %7, ptr getelementptr inbounds ([5 x i32], ptr @bar, i32 0, i32 3), align 4, !tbaa !1
48 %8 = tail call i32 @calc() #3
49 store i32 %8, ptr getelementptr inbounds ([5 x i32], ptr @baz, i32 0, i32 3), align 4, !tbaa !1
50 %9 = tail call i32 @calc() #3
51 store i32 %9, ptr getelementptr inbounds ([5 x i32], ptr @bar, i32 0, i32 4), align 4, !tbaa !1
52 %10 = tail call i32 @calc() #3
53 store i32 %10, ptr getelementptr inbounds ([5 x i32], ptr @baz, i32 0, i32 4), align 4, !tbaa !1
57 declare i32 @calc(...) #1
59 ; Function Attrs: nounwind ssp
60 define internal void @calculate() #0 {
61 %1 = load <4 x i32>, ptr @bar, align 4
62 %2 = load <4 x i32>, ptr @baz, align 4
63 %3 = mul <4 x i32> %2, %1
64 store <4 x i32> %3, ptr @foo, align 4
65 %4 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @bar, i32 0, i32 4), align 4, !tbaa !1
66 %5 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @baz, i32 0, i32 4), align 4, !tbaa !1
67 %6 = mul nsw i32 %5, %4
68 store i32 %6, ptr getelementptr inbounds ([5 x i32], ptr @foo, i32 0, i32 4), align 4, !tbaa !1
72 ; Function Attrs: nounwind readnone ssp
73 define internal ptr @returnFoo() #2 {
77 attributes #0 = { nounwind ssp "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
78 attributes #1 = { "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
79 attributes #2 = { nounwind readnone ssp "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
80 attributes #3 = { nounwind }
84 !0 = !{!"LLVM version 3.4 "}
86 !2 = !{!"int", !3, i64 0}
87 !3 = !{!"omnipotent char", !4, i64 0}
88 !4 = !{!"Simple C/C++ TBAA"}