1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2 ; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=53 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
3 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=53 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
4 ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM
5 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM
7 %struct.S = type { i32, i32, i32, float, float, float }
9 @globalBytes = global [1024 x i8] zeroinitializer, align 16
10 @Gint1 = global i32 zeroinitializer, align 4
11 @Gint2 = global i32 zeroinitializer, align 4
12 @Gstatic_int1 = internal global i32 zeroinitializer, align 4
13 @Gstatic_int2 = internal global i32 zeroinitializer, align 4
14 @Gstatic_int3 = internal global i32 zeroinitializer, align 4
15 @Gstatic_undef_int1 = internal global i32 undef, align 4
16 @Gstatic_undef_int2 = internal global i32 undef, align 4
17 @GI1 = internal global i32 undef, align 4
18 @GI2 = internal global i32 undef, align 4
19 @Gs1 = internal global %struct.S undef, align 4
20 @Gs2 = internal global %struct.S zeroinitializer, align 4
21 @GBytes = internal global [1024 x i8] zeroinitializer, align 16
22 @Flag0 = global i32 0, align 4
23 @Flag1 = internal global i32 undef, align 4
24 @Flag2 = internal global i32 undef, align 4
25 @Flag3 = internal global i32 zeroinitializer, align 4
26 @a1 = internal global i32 zeroinitializer
27 @a2 = internal global i32 zeroinitializer
28 @a3 = internal global i32 undef
29 @bytes1 = internal global i32 undef
30 @bytes2 = internal global i32 undef
33 ; CHECK: @[[GLOBALBYTES:[a-zA-Z0-9_$"\\.-]+]] = global [1024 x i8] zeroinitializer, align 16
34 ; CHECK: @[[GINT1:[a-zA-Z0-9_$"\\.-]+]] = global i32 0, align 4
35 ; CHECK: @[[GINT2:[a-zA-Z0-9_$"\\.-]+]] = global i32 0, align 4
36 ; CHECK: @[[GSTATIC_INT1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0, align 4
37 ; CHECK: @[[GSTATIC_INT2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0, align 4
38 ; CHECK: @[[GSTATIC_INT3:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0, align 4
39 ; CHECK: @[[GSTATIC_UNDEF_INT1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
40 ; CHECK: @[[GSTATIC_UNDEF_INT2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
41 ; CHECK: @[[GI1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
42 ; CHECK: @[[GI2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
43 ; CHECK: @[[GS1:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_S:%.*]] undef, align 4
44 ; CHECK: @[[GS2:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_S:%.*]] zeroinitializer, align 4
45 ; CHECK: @[[GBYTES:[a-zA-Z0-9_$"\\.-]+]] = internal global [1024 x i8] zeroinitializer, align 16
46 ; CHECK: @[[FLAG0:[a-zA-Z0-9_$"\\.-]+]] = global i32 0, align 4
47 ; CHECK: @[[FLAG1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
48 ; CHECK: @[[FLAG2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
49 ; CHECK: @[[FLAG3:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0, align 4
50 ; CHECK: @[[A1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0
51 ; CHECK: @[[A2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0
52 ; CHECK: @[[A3:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef
53 ; CHECK: @[[BYTES1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef
54 ; CHECK: @[[BYTES2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef
56 define void @write_arg(i32* %p, i32 %v) {
57 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
58 ; IS__TUNIT____-LABEL: define {{[^@]+}}@write_arg
59 ; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] {
60 ; IS__TUNIT____-NEXT: entry:
61 ; IS__TUNIT____-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]]
62 ; IS__TUNIT____-NEXT: ret void
64 ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
65 ; IS__CGSCC____-LABEL: define {{[^@]+}}@write_arg
66 ; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] {
67 ; IS__CGSCC____-NEXT: entry:
68 ; IS__CGSCC____-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]]
69 ; IS__CGSCC____-NEXT: ret void
72 store i32 %v, i32* %p, align 4, !tbaa !3
76 define void @write_random(i32* %p) {
77 ; CHECK-LABEL: define {{[^@]+}}@write_random
78 ; CHECK-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) {
80 ; CHECK-NEXT: [[CALL:%.*]] = call i32 (...) @random()
81 ; CHECK-NEXT: store i32 [[CALL]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]]
82 ; CHECK-NEXT: ret void
85 %call = call i32 (...) @random()
86 store i32 %call, i32* %p, align 4, !tbaa !3
90 declare i32 @random(...)
92 ; struct S local_alloca_simplifiable_1(void) {
97 ; write_arg(&s.i1, 1);
98 ; write_arg(&s.i2, 2);
99 ; write_arg(&s.i3, 3);
103 ; r.f3 = s.f3 + s.f1;
106 ; r.i3 = s.i3 + s.i1;
109 define void @local_alloca_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result) {
110 ; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn
111 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1
112 ; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
113 ; IS__TUNIT_OPM-NEXT: entry:
114 ; IS__TUNIT_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4
115 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8*
116 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR9:[0-9]+]]
117 ; IS__TUNIT_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
118 ; IS__TUNIT_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
119 ; IS__TUNIT_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
120 ; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
121 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR5:[0-9]+]]
122 ; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
123 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR5]]
124 ; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
125 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR5]]
126 ; IS__TUNIT_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
127 ; IS__TUNIT_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]]
128 ; IS__TUNIT_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
129 ; IS__TUNIT_OPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
130 ; IS__TUNIT_OPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]]
131 ; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
132 ; IS__TUNIT_OPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
133 ; IS__TUNIT_OPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]]
134 ; IS__TUNIT_OPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
135 ; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]]
136 ; IS__TUNIT_OPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1
137 ; IS__TUNIT_OPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
138 ; IS__TUNIT_OPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]]
139 ; IS__TUNIT_OPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1
140 ; IS__TUNIT_OPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
141 ; IS__TUNIT_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]]
142 ; IS__TUNIT_OPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8*
143 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR9]]
144 ; IS__TUNIT_OPM-NEXT: ret void
146 ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn
147 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1
148 ; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
149 ; IS__TUNIT_NPM-NEXT: entry:
150 ; IS__TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4
151 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8*
152 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR6:[0-9]+]]
153 ; IS__TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
154 ; IS__TUNIT_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
155 ; IS__TUNIT_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
156 ; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
157 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR4:[0-9]+]]
158 ; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
159 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR4]]
160 ; IS__TUNIT_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
161 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR4]]
162 ; IS__TUNIT_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
163 ; IS__TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]]
164 ; IS__TUNIT_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
165 ; IS__TUNIT_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
166 ; IS__TUNIT_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]]
167 ; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
168 ; IS__TUNIT_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
169 ; IS__TUNIT_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]]
170 ; IS__TUNIT_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
171 ; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]]
172 ; IS__TUNIT_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1
173 ; IS__TUNIT_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
174 ; IS__TUNIT_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]]
175 ; IS__TUNIT_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1
176 ; IS__TUNIT_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
177 ; IS__TUNIT_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]]
178 ; IS__TUNIT_NPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8*
179 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR6]]
180 ; IS__TUNIT_NPM-NEXT: ret void
182 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn
183 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1
184 ; IS__CGSCC_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
185 ; IS__CGSCC_OPM-NEXT: entry:
186 ; IS__CGSCC_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4
187 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8*
188 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR11:[0-9]+]]
189 ; IS__CGSCC_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
190 ; IS__CGSCC_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
191 ; IS__CGSCC_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
192 ; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
193 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12:[0-9]+]]
194 ; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
195 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]]
196 ; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
197 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]]
198 ; IS__CGSCC_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
199 ; IS__CGSCC_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]]
200 ; IS__CGSCC_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
201 ; IS__CGSCC_OPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
202 ; IS__CGSCC_OPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]]
203 ; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
204 ; IS__CGSCC_OPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
205 ; IS__CGSCC_OPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]]
206 ; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
207 ; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]]
208 ; IS__CGSCC_OPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1
209 ; IS__CGSCC_OPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
210 ; IS__CGSCC_OPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]]
211 ; IS__CGSCC_OPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1
212 ; IS__CGSCC_OPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
213 ; IS__CGSCC_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]]
214 ; IS__CGSCC_OPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8*
215 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR11]]
216 ; IS__CGSCC_OPM-NEXT: ret void
218 ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn
219 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1
220 ; IS__CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
221 ; IS__CGSCC_NPM-NEXT: entry:
222 ; IS__CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4
223 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8*
224 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR8:[0-9]+]]
225 ; IS__CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
226 ; IS__CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
227 ; IS__CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
228 ; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
229 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR9:[0-9]+]]
230 ; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
231 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR9]]
232 ; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
233 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR9]]
234 ; IS__CGSCC_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
235 ; IS__CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]]
236 ; IS__CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
237 ; IS__CGSCC_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
238 ; IS__CGSCC_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]]
239 ; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
240 ; IS__CGSCC_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
241 ; IS__CGSCC_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]]
242 ; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
243 ; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]]
244 ; IS__CGSCC_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1
245 ; IS__CGSCC_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
246 ; IS__CGSCC_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]]
247 ; IS__CGSCC_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1
248 ; IS__CGSCC_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
249 ; IS__CGSCC_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]]
250 ; IS__CGSCC_NPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8*
251 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR8]]
252 ; IS__CGSCC_NPM-NEXT: ret void
255 %s = alloca %struct.S, align 4
256 %i = bitcast %struct.S* %s to i8*
257 call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %i)
258 %f1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
259 store float 0x3FF19999A0000000, float* %f1, align 4, !tbaa !7
260 %f2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
261 store float 0x40019999A0000000, float* %f2, align 4, !tbaa !10
262 %f3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
263 store float 0x400A666660000000, float* %f3, align 4, !tbaa !11
264 %i1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
265 call void @write_arg(i32* nonnull %i1, i32 1)
266 %i2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
267 call void @write_arg(i32* nonnull %i2, i32 2)
268 %i3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
269 call void @write_arg(i32* nonnull %i3, i32 3)
270 %f11 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
271 %i4 = load float, float* %f11, align 4, !tbaa !7
272 %f12 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 3
273 store float %i4, float* %f12, align 4, !tbaa !7
274 %f23 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
275 %i5 = load float, float* %f23, align 4, !tbaa !10
276 %mul = fmul float %i5, 2.000000e+00
277 %f24 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 4
278 store float %mul, float* %f24, align 4, !tbaa !10
279 %f35 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
280 %i6 = load float, float* %f35, align 4, !tbaa !11
281 %f16 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
282 %i7 = load float, float* %f16, align 4, !tbaa !7
283 %add = fadd float %i6, %i7
284 %f37 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 5
285 store float %add, float* %f37, align 4, !tbaa !11
286 %i18 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
287 %i8 = load i32, i32* %i18, align 4, !tbaa !12
288 %i19 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 0
289 store i32 %i8, i32* %i19, align 4, !tbaa !12
290 %i210 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
291 %i9 = load i32, i32* %i210, align 4, !tbaa !13
292 %mul11 = shl nsw i32 %i9, 1
293 %i212 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 1
294 store i32 %mul11, i32* %i212, align 4, !tbaa !13
295 %i313 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
296 %i10 = load i32, i32* %i313, align 4, !tbaa !14
297 %i114 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
298 %i11 = load i32, i32* %i114, align 4, !tbaa !12
299 %add15 = add nsw i32 %i10, %i11
300 %i316 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 2
301 store i32 %add15, i32* %i316, align 4, !tbaa !14
302 %i12 = bitcast %struct.S* %s to i8*
303 call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %i12)
307 declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
309 declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
311 ; void local_alloca_simplifiable_2(void) {
313 ; for (int i = 0; i < 100; ++i)
315 ; for (int i = 0; i < 10; ++i)
316 ; ((float *)Bytes)[i * 10 + 1] = 0;
317 ; for (int i = 0; i < 20; ++i)
318 ; ((long long int *)Bytes)[i * 10 + 2] = 0;
320 ; write_arg((int *)&Bytes[500], 0);
322 ; for (int i = 0; i < 1024; ++i)
323 ; globalBytes[i] = Bytes[i];
326 define void @local_alloca_simplifiable_2() {
327 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind
328 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2
329 ; IS__TUNIT_OPM-SAME: () #[[ATTR2:[0-9]+]] {
330 ; IS__TUNIT_OPM-NEXT: entry:
331 ; IS__TUNIT_OPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
332 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
333 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]])
334 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]]
335 ; IS__TUNIT_OPM: for.cond:
336 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
337 ; IS__TUNIT_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
338 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
339 ; IS__TUNIT_OPM: for.cond.cleanup:
340 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]]
341 ; IS__TUNIT_OPM: for.body:
342 ; IS__TUNIT_OPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
343 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]]
344 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC]]
345 ; IS__TUNIT_OPM: for.inc:
346 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
347 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]]
348 ; IS__TUNIT_OPM: for.end:
349 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2:%.*]]
350 ; IS__TUNIT_OPM: for.cond2:
351 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
352 ; IS__TUNIT_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
353 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
354 ; IS__TUNIT_OPM: for.cond.cleanup4:
355 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END11:%.*]]
356 ; IS__TUNIT_OPM: for.body5:
357 ; IS__TUNIT_OPM-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float*
358 ; IS__TUNIT_OPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
359 ; IS__TUNIT_OPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1
360 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]]
361 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC9]]
362 ; IS__TUNIT_OPM: for.inc9:
363 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
364 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP17:![0-9]+]]
365 ; IS__TUNIT_OPM: for.end11:
366 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13:%.*]]
367 ; IS__TUNIT_OPM: for.cond13:
368 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ]
369 ; IS__TUNIT_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
370 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
371 ; IS__TUNIT_OPM: for.cond.cleanup15:
372 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END24:%.*]]
373 ; IS__TUNIT_OPM: for.body16:
374 ; IS__TUNIT_OPM-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64*
375 ; IS__TUNIT_OPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
376 ; IS__TUNIT_OPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2
377 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]]
378 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC22]]
379 ; IS__TUNIT_OPM: for.inc22:
380 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
381 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP18:![0-9]+]]
382 ; IS__TUNIT_OPM: for.end24:
383 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023
384 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500
385 ; IS__TUNIT_OPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32*
386 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR6:[0-9]+]]
387 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND28:%.*]]
388 ; IS__TUNIT_OPM: for.cond28:
389 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ]
390 ; IS__TUNIT_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
391 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]]
392 ; IS__TUNIT_OPM: for.cond.cleanup30:
393 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END38:%.*]]
394 ; IS__TUNIT_OPM: for.body31:
395 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
396 ; IS__TUNIT_OPM-NEXT: store i8 0, i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]]
397 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC36]]
398 ; IS__TUNIT_OPM: for.inc36:
399 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
400 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]]
401 ; IS__TUNIT_OPM: for.end38:
402 ; IS__TUNIT_OPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
403 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]])
404 ; IS__TUNIT_OPM-NEXT: ret void
406 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
407 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2
408 ; IS__TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] {
409 ; IS__TUNIT_NPM-NEXT: entry:
410 ; IS__TUNIT_NPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
411 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
412 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR6]]
413 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]]
414 ; IS__TUNIT_NPM: for.cond:
415 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
416 ; IS__TUNIT_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
417 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
418 ; IS__TUNIT_NPM: for.cond.cleanup:
419 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]]
420 ; IS__TUNIT_NPM: for.body:
421 ; IS__TUNIT_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
422 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]]
423 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC]]
424 ; IS__TUNIT_NPM: for.inc:
425 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
426 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]]
427 ; IS__TUNIT_NPM: for.end:
428 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2:%.*]]
429 ; IS__TUNIT_NPM: for.cond2:
430 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
431 ; IS__TUNIT_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
432 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
433 ; IS__TUNIT_NPM: for.cond.cleanup4:
434 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END11:%.*]]
435 ; IS__TUNIT_NPM: for.body5:
436 ; IS__TUNIT_NPM-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float*
437 ; IS__TUNIT_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
438 ; IS__TUNIT_NPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1
439 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]]
440 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC9]]
441 ; IS__TUNIT_NPM: for.inc9:
442 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
443 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP17:![0-9]+]]
444 ; IS__TUNIT_NPM: for.end11:
445 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13:%.*]]
446 ; IS__TUNIT_NPM: for.cond13:
447 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ]
448 ; IS__TUNIT_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
449 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
450 ; IS__TUNIT_NPM: for.cond.cleanup15:
451 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END24:%.*]]
452 ; IS__TUNIT_NPM: for.body16:
453 ; IS__TUNIT_NPM-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64*
454 ; IS__TUNIT_NPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
455 ; IS__TUNIT_NPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2
456 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]]
457 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC22]]
458 ; IS__TUNIT_NPM: for.inc22:
459 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
460 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP18:![0-9]+]]
461 ; IS__TUNIT_NPM: for.end24:
462 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023
463 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500
464 ; IS__TUNIT_NPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32*
465 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR4]]
466 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND28:%.*]]
467 ; IS__TUNIT_NPM: for.cond28:
468 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ]
469 ; IS__TUNIT_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
470 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]]
471 ; IS__TUNIT_NPM: for.cond.cleanup30:
472 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END38:%.*]]
473 ; IS__TUNIT_NPM: for.body31:
474 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
475 ; IS__TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]]
476 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC36]]
477 ; IS__TUNIT_NPM: for.inc36:
478 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
479 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]]
480 ; IS__TUNIT_NPM: for.end38:
481 ; IS__TUNIT_NPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
482 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) #[[ATTR6]]
483 ; IS__TUNIT_NPM-NEXT: ret void
485 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2() {
486 ; IS__CGSCC_OPM-NEXT: entry:
487 ; IS__CGSCC_OPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
488 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
489 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]])
490 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]]
491 ; IS__CGSCC_OPM: for.cond:
492 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
493 ; IS__CGSCC_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
494 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
495 ; IS__CGSCC_OPM: for.cond.cleanup:
496 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]]
497 ; IS__CGSCC_OPM: for.body:
498 ; IS__CGSCC_OPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
499 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]]
500 ; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]]
501 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]]
502 ; IS__CGSCC_OPM: for.inc:
503 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
504 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
505 ; IS__CGSCC_OPM: for.end:
506 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2:%.*]]
507 ; IS__CGSCC_OPM: for.cond2:
508 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
509 ; IS__CGSCC_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
510 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
511 ; IS__CGSCC_OPM: for.cond.cleanup4:
512 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END11:%.*]]
513 ; IS__CGSCC_OPM: for.body5:
514 ; IS__CGSCC_OPM-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float*
515 ; IS__CGSCC_OPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
516 ; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1
517 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]]
518 ; IS__CGSCC_OPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]]
519 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC9]]
520 ; IS__CGSCC_OPM: for.inc9:
521 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
522 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP19:![0-9]+]]
523 ; IS__CGSCC_OPM: for.end11:
524 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13:%.*]]
525 ; IS__CGSCC_OPM: for.cond13:
526 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ]
527 ; IS__CGSCC_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
528 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
529 ; IS__CGSCC_OPM: for.cond.cleanup15:
530 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END24:%.*]]
531 ; IS__CGSCC_OPM: for.body16:
532 ; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64*
533 ; IS__CGSCC_OPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
534 ; IS__CGSCC_OPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2
535 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]]
536 ; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]]
537 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC22]]
538 ; IS__CGSCC_OPM: for.inc22:
539 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
540 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP22:![0-9]+]]
541 ; IS__CGSCC_OPM: for.end24:
542 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023
543 ; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]]
544 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500
545 ; IS__CGSCC_OPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32*
546 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I22]], i32 noundef 0) #[[ATTR13:[0-9]+]]
547 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND28:%.*]]
548 ; IS__CGSCC_OPM: for.cond28:
549 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ]
550 ; IS__CGSCC_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
551 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]]
552 ; IS__CGSCC_OPM: for.cond.cleanup30:
553 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END38:%.*]]
554 ; IS__CGSCC_OPM: for.body31:
555 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDVARS_IV12]]
556 ; IS__CGSCC_OPM-NEXT: [[I23:%.*]] = load i8, i8* [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]]
557 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
558 ; IS__CGSCC_OPM-NEXT: store i8 [[I23]], i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]]
559 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC36]]
560 ; IS__CGSCC_OPM: for.inc36:
561 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
562 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]]
563 ; IS__CGSCC_OPM: for.end38:
564 ; IS__CGSCC_OPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
565 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nofree noundef nonnull [[I24]])
566 ; IS__CGSCC_OPM-NEXT: ret void
568 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2() {
569 ; IS__CGSCC_NPM-NEXT: entry:
570 ; IS__CGSCC_NPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
571 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
572 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR8]]
573 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]]
574 ; IS__CGSCC_NPM: for.cond:
575 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
576 ; IS__CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
577 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
578 ; IS__CGSCC_NPM: for.cond.cleanup:
579 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]]
580 ; IS__CGSCC_NPM: for.body:
581 ; IS__CGSCC_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
582 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]]
583 ; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]]
584 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]]
585 ; IS__CGSCC_NPM: for.inc:
586 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
587 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
588 ; IS__CGSCC_NPM: for.end:
589 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]]
590 ; IS__CGSCC_NPM: for.cond2:
591 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
592 ; IS__CGSCC_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
593 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
594 ; IS__CGSCC_NPM: for.cond.cleanup4:
595 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END11:%.*]]
596 ; IS__CGSCC_NPM: for.body5:
597 ; IS__CGSCC_NPM-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float*
598 ; IS__CGSCC_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
599 ; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1
600 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]]
601 ; IS__CGSCC_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]]
602 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC9]]
603 ; IS__CGSCC_NPM: for.inc9:
604 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
605 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP19:![0-9]+]]
606 ; IS__CGSCC_NPM: for.end11:
607 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]]
608 ; IS__CGSCC_NPM: for.cond13:
609 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ]
610 ; IS__CGSCC_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
611 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
612 ; IS__CGSCC_NPM: for.cond.cleanup15:
613 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END24:%.*]]
614 ; IS__CGSCC_NPM: for.body16:
615 ; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64*
616 ; IS__CGSCC_NPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
617 ; IS__CGSCC_NPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2
618 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]]
619 ; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]]
620 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC22]]
621 ; IS__CGSCC_NPM: for.inc22:
622 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
623 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP22:![0-9]+]]
624 ; IS__CGSCC_NPM: for.end24:
625 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023
626 ; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]]
627 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500
628 ; IS__CGSCC_NPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32*
629 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I22]], i32 noundef 0) #[[ATTR10:[0-9]+]]
630 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND28:%.*]]
631 ; IS__CGSCC_NPM: for.cond28:
632 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ]
633 ; IS__CGSCC_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
634 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]]
635 ; IS__CGSCC_NPM: for.cond.cleanup30:
636 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END38:%.*]]
637 ; IS__CGSCC_NPM: for.body31:
638 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDVARS_IV12]]
639 ; IS__CGSCC_NPM-NEXT: [[I23:%.*]] = load i8, i8* [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]]
640 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
641 ; IS__CGSCC_NPM-NEXT: store i8 [[I23]], i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]]
642 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC36]]
643 ; IS__CGSCC_NPM: for.inc36:
644 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
645 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]]
646 ; IS__CGSCC_NPM: for.end38:
647 ; IS__CGSCC_NPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
648 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nofree noundef nonnull [[I24]])
649 ; IS__CGSCC_NPM-NEXT: ret void
652 %Bytes = alloca [1024 x i8], align 16
653 %i = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 0
654 call void @llvm.lifetime.start.p0i8(i64 1024, i8* nonnull %i)
657 for.cond: ; preds = %for.inc, %entry
658 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
659 %exitcond = icmp ne i64 %indvars.iv, 100
660 br i1 %exitcond, label %for.body, label %for.cond.cleanup
662 for.cond.cleanup: ; preds = %for.cond
665 for.body: ; preds = %for.cond
666 %i15 = mul nuw nsw i64 %indvars.iv, 10
667 %arrayidx = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 %i15
668 store i8 0, i8* %arrayidx, align 2, !tbaa !15
671 for.inc: ; preds = %for.body
672 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
673 br label %for.cond, !llvm.loop !16
675 for.end: ; preds = %for.cond.cleanup
678 for.cond2: ; preds = %for.inc9, %for.end
679 %indvars.iv2 = phi i64 [ %indvars.iv.next3, %for.inc9 ], [ 0, %for.end ]
680 %exitcond6 = icmp ne i64 %indvars.iv2, 10
681 br i1 %exitcond6, label %for.body5, label %for.cond.cleanup4
683 for.cond.cleanup4: ; preds = %for.cond2
686 for.body5: ; preds = %for.cond2
687 %i16 = bitcast [1024 x i8]* %Bytes to float*
688 %i17 = mul nuw nsw i64 %indvars.iv2, 10
689 %i18 = or i64 %i17, 1
690 %arrayidx8 = getelementptr inbounds float, float* %i16, i64 %i18
691 store float 0.000000e+00, float* %arrayidx8, align 4, !tbaa !18
694 for.inc9: ; preds = %for.body5
695 %indvars.iv.next3 = add nuw nsw i64 %indvars.iv2, 1
696 br label %for.cond2, !llvm.loop !19
698 for.end11: ; preds = %for.cond.cleanup4
701 for.cond13: ; preds = %for.inc22, %for.end11
702 %indvars.iv7 = phi i64 [ %indvars.iv.next8, %for.inc22 ], [ 0, %for.end11 ]
703 %exitcond11 = icmp ne i64 %indvars.iv7, 20
704 br i1 %exitcond11, label %for.body16, label %for.cond.cleanup15
706 for.cond.cleanup15: ; preds = %for.cond13
709 for.body16: ; preds = %for.cond13
710 %i19 = bitcast [1024 x i8]* %Bytes to i64*
711 %i20 = mul nuw nsw i64 %indvars.iv7, 10
712 %i21 = add nuw nsw i64 %i20, 2
713 %arrayidx21 = getelementptr inbounds i64, i64* %i19, i64 %i21
714 store i64 0, i64* %arrayidx21, align 16, !tbaa !20
717 for.inc22: ; preds = %for.body16
718 %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7, 1
719 br label %for.cond13, !llvm.loop !22
721 for.end24: ; preds = %for.cond.cleanup15
722 %arrayidx25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 1023
723 store i8 0, i8* %arrayidx25, align 1, !tbaa !15
724 %arrayidx26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 500
725 %i22 = bitcast i8* %arrayidx26 to i32*
726 call void @write_arg(i32* nonnull %i22, i32 0)
729 for.cond28: ; preds = %for.inc36, %for.end24
730 %indvars.iv12 = phi i64 [ %indvars.iv.next13, %for.inc36 ], [ 0, %for.end24 ]
731 %exitcond14 = icmp ne i64 %indvars.iv12, 1024
732 br i1 %exitcond14, label %for.body31, label %for.cond.cleanup30
734 for.cond.cleanup30: ; preds = %for.cond28
737 for.body31: ; preds = %for.cond28
738 %arrayidx33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 %indvars.iv12
739 %i23 = load i8, i8* %arrayidx33, align 1, !tbaa !15
740 %arrayidx35 = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 %indvars.iv12
741 store i8 %i23, i8* %arrayidx35, align 1, !tbaa !15
744 for.inc36: ; preds = %for.body31
745 %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12, 1
746 br label %for.cond28, !llvm.loop !23
748 for.end38: ; preds = %for.cond.cleanup30
749 %i24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 0
750 call void @llvm.lifetime.end.p0i8(i64 1024, i8* nonnull %i24)
754 ; int local_alloca_simplifiable_3() {
761 define i32 @local_alloca_simplifiable_3() {
762 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
763 ; IS__TUNIT____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3
764 ; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] {
765 ; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i32, align 4
766 ; IS__TUNIT____-NEXT: store i32 1, i32* [[A]], align 4
767 ; IS__TUNIT____-NEXT: br label [[SPLIT:%.*]]
768 ; IS__TUNIT____: split:
769 ; IS__TUNIT____-NEXT: store i32 2, i32* [[A]], align 4
770 ; IS__TUNIT____-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4
771 ; IS__TUNIT____-NEXT: ret i32 [[L]]
773 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
774 ; IS__CGSCC____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3
775 ; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] {
776 ; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i32, align 4
777 ; IS__CGSCC____-NEXT: store i32 1, i32* [[A]], align 4
778 ; IS__CGSCC____-NEXT: br label [[SPLIT:%.*]]
779 ; IS__CGSCC____: split:
780 ; IS__CGSCC____-NEXT: store i32 2, i32* [[A]], align 4
781 ; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4
782 ; IS__CGSCC____-NEXT: ret i32 [[L]]
784 %A = alloca i32, align 4
789 %l = load i32, i32* %A, align 4
792 ; int local_alloca_simplifiable_4() {
797 define i32 @local_alloca_simplifiable_4() {
798 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
799 ; IS__TUNIT____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4
800 ; IS__TUNIT____-SAME: () #[[ATTR3]] {
801 ; IS__TUNIT____-NEXT: ret i32 undef
803 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
804 ; IS__CGSCC____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4
805 ; IS__CGSCC____-SAME: () #[[ATTR2]] {
806 ; IS__CGSCC____-NEXT: ret i32 undef
808 %A = alloca i32, align 4
809 %l = load i32, i32* %A, align 4
813 ; static int GI1 __attribute__((loader_uninitialized));
814 ; int multi_obj_simplifiable_1(int cnd) {
816 ; int *p = cnd ? &GI1 : &L;
819 define i32 @multi_obj_simplifiable_1(i32 %cnd) {
820 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
821 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1
822 ; IS__TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR4:[0-9]+]] {
823 ; IS__TUNIT_OPM-NEXT: entry:
824 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = alloca i32, align 4
825 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
826 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]]
827 ; IS__TUNIT_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
828 ; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
829 ; IS__TUNIT_OPM: cond.true:
830 ; IS__TUNIT_OPM-NEXT: br label [[COND_END:%.*]]
831 ; IS__TUNIT_OPM: cond.false:
832 ; IS__TUNIT_OPM-NEXT: br label [[COND_END]]
833 ; IS__TUNIT_OPM: cond.end:
834 ; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8*
835 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR9]]
836 ; IS__TUNIT_OPM-NEXT: ret i32 5
838 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
839 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1
840 ; IS__TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] {
841 ; IS__TUNIT_NPM-NEXT: entry:
842 ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = alloca i32, align 4
843 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
844 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR6]]
845 ; IS__TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
846 ; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
847 ; IS__TUNIT_NPM: cond.true:
848 ; IS__TUNIT_NPM-NEXT: br label [[COND_END:%.*]]
849 ; IS__TUNIT_NPM: cond.false:
850 ; IS__TUNIT_NPM-NEXT: br label [[COND_END]]
851 ; IS__TUNIT_NPM: cond.end:
852 ; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8*
853 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR6]]
854 ; IS__TUNIT_NPM-NEXT: ret i32 5
856 ; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
857 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1
858 ; IS__CGSCC_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3:[0-9]+]] {
859 ; IS__CGSCC_OPM-NEXT: entry:
860 ; IS__CGSCC_OPM-NEXT: [[L:%.*]] = alloca i32, align 4
861 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
862 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]]
863 ; IS__CGSCC_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
864 ; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
865 ; IS__CGSCC_OPM: cond.true:
866 ; IS__CGSCC_OPM-NEXT: br label [[COND_END:%.*]]
867 ; IS__CGSCC_OPM: cond.false:
868 ; IS__CGSCC_OPM-NEXT: br label [[COND_END]]
869 ; IS__CGSCC_OPM: cond.end:
870 ; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8*
871 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR11]]
872 ; IS__CGSCC_OPM-NEXT: ret i32 5
874 ; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
875 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1
876 ; IS__CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3:[0-9]+]] {
877 ; IS__CGSCC_NPM-NEXT: entry:
878 ; IS__CGSCC_NPM-NEXT: [[L:%.*]] = alloca i32, align 4
879 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
880 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR8]]
881 ; IS__CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
882 ; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
883 ; IS__CGSCC_NPM: cond.true:
884 ; IS__CGSCC_NPM-NEXT: br label [[COND_END:%.*]]
885 ; IS__CGSCC_NPM: cond.false:
886 ; IS__CGSCC_NPM-NEXT: br label [[COND_END]]
887 ; IS__CGSCC_NPM: cond.end:
888 ; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8*
889 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR8]]
890 ; IS__CGSCC_NPM-NEXT: ret i32 5
893 %L = alloca i32, align 4
894 %i = bitcast i32* %L to i8*
895 call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i)
896 store i32 5, i32* @GI1, align 4, !tbaa !3
897 store i32 5, i32* %L, align 4, !tbaa !3
898 %tobool.not = icmp eq i32 %cnd, 0
899 br i1 %tobool.not, label %cond.false, label %cond.true
901 cond.true: ; preds = %entry
904 cond.false: ; preds = %entry
907 cond.end: ; preds = %cond.false, %cond.true
908 %cond = phi i32* [ @GI1, %cond.true ], [ %L, %cond.false ]
909 %i1 = load i32, i32* %cond, align 4, !tbaa !3
910 %i2 = bitcast i32* %L to i8*
911 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i2)
915 ; static int GI2 __attribute__((loader_uninitialized));
916 ; int multi_obj_simplifiable_2(int cnd) {
918 ; int *p = cnd ? &GI2 : &L;
923 define i32 @multi_obj_simplifiable_2(i32 %cnd) {
924 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
925 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2
926 ; IS__TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR4]] {
927 ; IS__TUNIT_OPM-NEXT: entry:
928 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = alloca i32, align 4
929 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
930 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]]
931 ; IS__TUNIT_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
932 ; IS__TUNIT_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
933 ; IS__TUNIT_OPM: cond.true:
934 ; IS__TUNIT_OPM-NEXT: br label [[COND_END:%.*]]
935 ; IS__TUNIT_OPM: cond.false:
936 ; IS__TUNIT_OPM-NEXT: br label [[COND_END]]
937 ; IS__TUNIT_OPM: cond.end:
938 ; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8*
939 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]]
940 ; IS__TUNIT_OPM-NEXT: ret i32 5
942 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
943 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2
944 ; IS__TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] {
945 ; IS__TUNIT_NPM-NEXT: entry:
946 ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = alloca i32, align 4
947 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
948 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR6]]
949 ; IS__TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
950 ; IS__TUNIT_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
951 ; IS__TUNIT_NPM: cond.true:
952 ; IS__TUNIT_NPM-NEXT: br label [[COND_END:%.*]]
953 ; IS__TUNIT_NPM: cond.false:
954 ; IS__TUNIT_NPM-NEXT: br label [[COND_END]]
955 ; IS__TUNIT_NPM: cond.end:
956 ; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8*
957 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR6]]
958 ; IS__TUNIT_NPM-NEXT: ret i32 5
960 ; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
961 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2
962 ; IS__CGSCC_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] {
963 ; IS__CGSCC_OPM-NEXT: entry:
964 ; IS__CGSCC_OPM-NEXT: [[L:%.*]] = alloca i32, align 4
965 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
966 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]]
967 ; IS__CGSCC_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
968 ; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
969 ; IS__CGSCC_OPM: cond.true:
970 ; IS__CGSCC_OPM-NEXT: br label [[COND_END:%.*]]
971 ; IS__CGSCC_OPM: cond.false:
972 ; IS__CGSCC_OPM-NEXT: br label [[COND_END]]
973 ; IS__CGSCC_OPM: cond.end:
974 ; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8*
975 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]]
976 ; IS__CGSCC_OPM-NEXT: ret i32 5
978 ; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
979 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2
980 ; IS__CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] {
981 ; IS__CGSCC_NPM-NEXT: entry:
982 ; IS__CGSCC_NPM-NEXT: [[L:%.*]] = alloca i32, align 4
983 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
984 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR8]]
985 ; IS__CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
986 ; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
987 ; IS__CGSCC_NPM: cond.true:
988 ; IS__CGSCC_NPM-NEXT: br label [[COND_END:%.*]]
989 ; IS__CGSCC_NPM: cond.false:
990 ; IS__CGSCC_NPM-NEXT: br label [[COND_END]]
991 ; IS__CGSCC_NPM: cond.end:
992 ; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8*
993 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR8]]
994 ; IS__CGSCC_NPM-NEXT: ret i32 5
997 %L = alloca i32, align 4
998 %i = bitcast i32* %L to i8*
999 call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i)
1000 %tobool.not = icmp eq i32 %cnd, 0
1001 br i1 %tobool.not, label %cond.false, label %cond.true
1003 cond.true: ; preds = %entry
1006 cond.false: ; preds = %entry
1009 cond.end: ; preds = %cond.false, %cond.true
1010 %cond = phi i32* [ @GI2, %cond.true ], [ %L, %cond.false ]
1011 store i32 5, i32* %cond, align 4, !tbaa !3
1012 %i1 = bitcast i32* %L to i8*
1013 %l = load i32, i32* %cond, align 4, !tbaa !3
1014 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i1)
1018 ; static struct S Gs __attribute__((loader_uninitialized));
1019 ; struct S static_global_simplifiable_1(void) {
1023 ; write_arg(&Gs.i1, 1);
1024 ; write_arg(&Gs.i2, 2);
1025 ; write_arg(&Gs.i3, 3);
1029 ; r.f3 = Gs.f3 + Gs.f1;
1032 ; r.i3 = Gs.i3 + Gs.i1;
1036 define void @static_global_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result) {
1037 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly
1038 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1
1039 ; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR5]] {
1040 ; IS__TUNIT_OPM-NEXT: entry:
1041 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR5]]
1042 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR5]]
1043 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR5]]
1044 ; IS__TUNIT_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1045 ; IS__TUNIT_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1046 ; IS__TUNIT_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
1047 ; IS__TUNIT_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1048 ; IS__TUNIT_OPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]]
1049 ; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
1050 ; IS__TUNIT_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1051 ; IS__TUNIT_OPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]]
1052 ; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1053 ; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]]
1054 ; IS__TUNIT_OPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1
1055 ; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1056 ; IS__TUNIT_OPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]]
1057 ; IS__TUNIT_OPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1
1058 ; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1059 ; IS__TUNIT_OPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]]
1060 ; IS__TUNIT_OPM-NEXT: ret void
1062 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly
1063 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1
1064 ; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4]] {
1065 ; IS__TUNIT_NPM-NEXT: entry:
1066 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR4]]
1067 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR4]]
1068 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR4]]
1069 ; IS__TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1070 ; IS__TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1071 ; IS__TUNIT_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
1072 ; IS__TUNIT_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1073 ; IS__TUNIT_NPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]]
1074 ; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
1075 ; IS__TUNIT_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1076 ; IS__TUNIT_NPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]]
1077 ; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1078 ; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]]
1079 ; IS__TUNIT_NPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1
1080 ; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1081 ; IS__TUNIT_NPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]]
1082 ; IS__TUNIT_NPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1
1083 ; IS__TUNIT_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1084 ; IS__TUNIT_NPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]]
1085 ; IS__TUNIT_NPM-NEXT: ret void
1087 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1088 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1
1089 ; IS__CGSCC_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] {
1090 ; IS__CGSCC_OPM-NEXT: entry:
1091 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR12]]
1092 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR12]]
1093 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR12]]
1094 ; IS__CGSCC_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1095 ; IS__CGSCC_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1096 ; IS__CGSCC_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
1097 ; IS__CGSCC_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1098 ; IS__CGSCC_OPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]]
1099 ; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
1100 ; IS__CGSCC_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1101 ; IS__CGSCC_OPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]]
1102 ; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1103 ; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]]
1104 ; IS__CGSCC_OPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1
1105 ; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1106 ; IS__CGSCC_OPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]]
1107 ; IS__CGSCC_OPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1
1108 ; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1109 ; IS__CGSCC_OPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]]
1110 ; IS__CGSCC_OPM-NEXT: ret void
1112 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1113 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1
1114 ; IS__CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] {
1115 ; IS__CGSCC_NPM-NEXT: entry:
1116 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR9]]
1117 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR9]]
1118 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR9]]
1119 ; IS__CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1120 ; IS__CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1121 ; IS__CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
1122 ; IS__CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1123 ; IS__CGSCC_NPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]]
1124 ; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
1125 ; IS__CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1126 ; IS__CGSCC_NPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]]
1127 ; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1128 ; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]]
1129 ; IS__CGSCC_NPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1
1130 ; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1131 ; IS__CGSCC_NPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]]
1132 ; IS__CGSCC_NPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1
1133 ; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1134 ; IS__CGSCC_NPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]]
1135 ; IS__CGSCC_NPM-NEXT: ret void
1138 store float 0x3FF19999A0000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7
1139 store float 0x40019999A0000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 4), align 4, !tbaa !10
1140 store float 0x400A666660000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 5), align 4, !tbaa !11
1141 call void @write_arg(i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 0), i32 1)
1142 call void @write_arg(i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 1), i32 2)
1143 call void @write_arg(i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 2), i32 3)
1144 %i = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7
1145 %f1 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 3
1146 store float %i, float* %f1, align 4, !tbaa !7
1147 %i4 = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 4), align 4, !tbaa !10
1148 %mul = fmul float %i4, 2.000000e+00
1149 %f2 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 4
1150 store float %mul, float* %f2, align 4, !tbaa !10
1151 %i5 = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 5), align 4, !tbaa !11
1152 %i6 = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7
1153 %add = fadd float %i5, %i6
1154 %f3 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 5
1155 store float %add, float* %f3, align 4, !tbaa !11
1156 %i7 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 0), align 4, !tbaa !12
1157 %i1 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 0
1158 store i32 %i7, i32* %i1, align 4, !tbaa !12
1159 %i8 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 1), align 4, !tbaa !13
1160 %mul1 = shl nsw i32 %i8, 1
1161 %i2 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 1
1162 store i32 %mul1, i32* %i2, align 4, !tbaa !13
1163 %i9 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 2), align 4, !tbaa !14
1164 %i10 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 0), align 4, !tbaa !12
1165 %add2 = add nsw i32 %i9, %i10
1166 %i3 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 2
1167 store i32 %add2, i32* %i3, align 4, !tbaa !14
1171 ; static char GBytes[1024];
1172 ; void static_global_simplifiable_2(void) {
1173 ; for (int i = 0; i < 100; ++i)
1174 ; GBytes[i * 10] = 0;
1175 ; for (int i = 0; i < 10; ++i)
1176 ; ((float *)GBytes)[i * 10 + 1] = 0;
1177 ; for (int i = 0; i < 20; ++i)
1178 ; ((long long int *)GBytes)[i * 10 + 2] = 0;
1180 ; write_arg((int *)&GBytes[500], 0);
1182 ; for (int i = 0; i < 1024; ++i)
1183 ; globalBytes[i] = GBytes[i];
1186 define void @static_global_simplifiable_2() {
1187 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind writeonly
1188 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2
1189 ; IS__TUNIT_OPM-SAME: () #[[ATTR6]] {
1190 ; IS__TUNIT_OPM-NEXT: entry:
1191 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]]
1192 ; IS__TUNIT_OPM: for.cond:
1193 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1194 ; IS__TUNIT_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1195 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1196 ; IS__TUNIT_OPM: for.cond.cleanup:
1197 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]]
1198 ; IS__TUNIT_OPM: for.body:
1199 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1200 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]]
1201 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC]]
1202 ; IS__TUNIT_OPM: for.inc:
1203 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1204 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
1205 ; IS__TUNIT_OPM: for.end:
1206 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2:%.*]]
1207 ; IS__TUNIT_OPM: for.cond2:
1208 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1209 ; IS__TUNIT_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1210 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1211 ; IS__TUNIT_OPM: for.cond.cleanup4:
1212 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END11:%.*]]
1213 ; IS__TUNIT_OPM: for.body5:
1214 ; IS__TUNIT_OPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1215 ; IS__TUNIT_OPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1
1216 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]]
1217 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC9]]
1218 ; IS__TUNIT_OPM: for.inc9:
1219 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1220 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP22:![0-9]+]]
1221 ; IS__TUNIT_OPM: for.end11:
1222 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13:%.*]]
1223 ; IS__TUNIT_OPM: for.cond13:
1224 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1225 ; IS__TUNIT_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1226 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
1227 ; IS__TUNIT_OPM: for.cond.cleanup15:
1228 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END23:%.*]]
1229 ; IS__TUNIT_OPM: for.body16:
1230 ; IS__TUNIT_OPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
1231 ; IS__TUNIT_OPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2
1232 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]]
1233 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC21]]
1234 ; IS__TUNIT_OPM: for.inc21:
1235 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
1236 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]]
1237 ; IS__TUNIT_OPM: for.end23:
1238 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR6]]
1239 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND25:%.*]]
1240 ; IS__TUNIT_OPM: for.cond25:
1241 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ]
1242 ; IS__TUNIT_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
1243 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]]
1244 ; IS__TUNIT_OPM: for.cond.cleanup27:
1245 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END35:%.*]]
1246 ; IS__TUNIT_OPM: for.body28:
1247 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
1248 ; IS__TUNIT_OPM-NEXT: store i8 0, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
1249 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC33]]
1250 ; IS__TUNIT_OPM: for.inc33:
1251 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
1252 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP24:![0-9]+]]
1253 ; IS__TUNIT_OPM: for.end35:
1254 ; IS__TUNIT_OPM-NEXT: ret void
1256 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly
1257 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2
1258 ; IS__TUNIT_NPM-SAME: () #[[ATTR4]] {
1259 ; IS__TUNIT_NPM-NEXT: entry:
1260 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]]
1261 ; IS__TUNIT_NPM: for.cond:
1262 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1263 ; IS__TUNIT_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1264 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1265 ; IS__TUNIT_NPM: for.cond.cleanup:
1266 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]]
1267 ; IS__TUNIT_NPM: for.body:
1268 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1269 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]]
1270 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC]]
1271 ; IS__TUNIT_NPM: for.inc:
1272 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1273 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
1274 ; IS__TUNIT_NPM: for.end:
1275 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2:%.*]]
1276 ; IS__TUNIT_NPM: for.cond2:
1277 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1278 ; IS__TUNIT_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1279 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1280 ; IS__TUNIT_NPM: for.cond.cleanup4:
1281 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END11:%.*]]
1282 ; IS__TUNIT_NPM: for.body5:
1283 ; IS__TUNIT_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1284 ; IS__TUNIT_NPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1
1285 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]]
1286 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC9]]
1287 ; IS__TUNIT_NPM: for.inc9:
1288 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1289 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP22:![0-9]+]]
1290 ; IS__TUNIT_NPM: for.end11:
1291 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13:%.*]]
1292 ; IS__TUNIT_NPM: for.cond13:
1293 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1294 ; IS__TUNIT_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1295 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
1296 ; IS__TUNIT_NPM: for.cond.cleanup15:
1297 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END23:%.*]]
1298 ; IS__TUNIT_NPM: for.body16:
1299 ; IS__TUNIT_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
1300 ; IS__TUNIT_NPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2
1301 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]]
1302 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC21]]
1303 ; IS__TUNIT_NPM: for.inc21:
1304 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
1305 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]]
1306 ; IS__TUNIT_NPM: for.end23:
1307 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree writeonly align 4 dereferenceable_or_null(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR4]]
1308 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND25:%.*]]
1309 ; IS__TUNIT_NPM: for.cond25:
1310 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ]
1311 ; IS__TUNIT_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
1312 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]]
1313 ; IS__TUNIT_NPM: for.cond.cleanup27:
1314 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END35:%.*]]
1315 ; IS__TUNIT_NPM: for.body28:
1316 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
1317 ; IS__TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
1318 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC33]]
1319 ; IS__TUNIT_NPM: for.inc33:
1320 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
1321 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP24:![0-9]+]]
1322 ; IS__TUNIT_NPM: for.end35:
1323 ; IS__TUNIT_NPM-NEXT: ret void
1325 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2() {
1326 ; IS__CGSCC_OPM-NEXT: entry:
1327 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]]
1328 ; IS__CGSCC_OPM: for.cond:
1329 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1330 ; IS__CGSCC_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1331 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1332 ; IS__CGSCC_OPM: for.cond.cleanup:
1333 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]]
1334 ; IS__CGSCC_OPM: for.body:
1335 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1336 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]]
1337 ; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15]]
1338 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]]
1339 ; IS__CGSCC_OPM: for.inc:
1340 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1341 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
1342 ; IS__CGSCC_OPM: for.end:
1343 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2:%.*]]
1344 ; IS__CGSCC_OPM: for.cond2:
1345 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1346 ; IS__CGSCC_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1347 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1348 ; IS__CGSCC_OPM: for.cond.cleanup4:
1349 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END11:%.*]]
1350 ; IS__CGSCC_OPM: for.body5:
1351 ; IS__CGSCC_OPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1352 ; IS__CGSCC_OPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1
1353 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]]
1354 ; IS__CGSCC_OPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
1355 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC9]]
1356 ; IS__CGSCC_OPM: for.inc9:
1357 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1358 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP25:![0-9]+]]
1359 ; IS__CGSCC_OPM: for.end11:
1360 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13:%.*]]
1361 ; IS__CGSCC_OPM: for.cond13:
1362 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1363 ; IS__CGSCC_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1364 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
1365 ; IS__CGSCC_OPM: for.cond.cleanup15:
1366 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END23:%.*]]
1367 ; IS__CGSCC_OPM: for.body16:
1368 ; IS__CGSCC_OPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
1369 ; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2
1370 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]]
1371 ; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 16, !tbaa [[TBAA20]]
1372 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC21]]
1373 ; IS__CGSCC_OPM: for.inc21:
1374 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
1375 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP26:![0-9]+]]
1376 ; IS__CGSCC_OPM: for.end23:
1377 ; IS__CGSCC_OPM-NEXT: store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 1023), align 1, !tbaa [[TBAA15]]
1378 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR13]]
1379 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND25:%.*]]
1380 ; IS__CGSCC_OPM: for.cond25:
1381 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ]
1382 ; IS__CGSCC_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
1383 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]]
1384 ; IS__CGSCC_OPM: for.cond.cleanup27:
1385 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END35:%.*]]
1386 ; IS__CGSCC_OPM: for.body28:
1387 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX30:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[INDVARS_IV12]]
1388 ; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = load i8, i8* [[ARRAYIDX30]], align 1, !tbaa [[TBAA15]]
1389 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
1390 ; IS__CGSCC_OPM-NEXT: store i8 [[I19]], i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
1391 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC33]]
1392 ; IS__CGSCC_OPM: for.inc33:
1393 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
1394 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP27:![0-9]+]]
1395 ; IS__CGSCC_OPM: for.end35:
1396 ; IS__CGSCC_OPM-NEXT: ret void
1398 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2() {
1399 ; IS__CGSCC_NPM-NEXT: entry:
1400 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]]
1401 ; IS__CGSCC_NPM: for.cond:
1402 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1403 ; IS__CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1404 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1405 ; IS__CGSCC_NPM: for.cond.cleanup:
1406 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]]
1407 ; IS__CGSCC_NPM: for.body:
1408 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1409 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]]
1410 ; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15]]
1411 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]]
1412 ; IS__CGSCC_NPM: for.inc:
1413 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1414 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
1415 ; IS__CGSCC_NPM: for.end:
1416 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]]
1417 ; IS__CGSCC_NPM: for.cond2:
1418 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1419 ; IS__CGSCC_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1420 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1421 ; IS__CGSCC_NPM: for.cond.cleanup4:
1422 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END11:%.*]]
1423 ; IS__CGSCC_NPM: for.body5:
1424 ; IS__CGSCC_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1425 ; IS__CGSCC_NPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1
1426 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]]
1427 ; IS__CGSCC_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
1428 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC9]]
1429 ; IS__CGSCC_NPM: for.inc9:
1430 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1431 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP25:![0-9]+]]
1432 ; IS__CGSCC_NPM: for.end11:
1433 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]]
1434 ; IS__CGSCC_NPM: for.cond13:
1435 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1436 ; IS__CGSCC_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1437 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
1438 ; IS__CGSCC_NPM: for.cond.cleanup15:
1439 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END23:%.*]]
1440 ; IS__CGSCC_NPM: for.body16:
1441 ; IS__CGSCC_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
1442 ; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2
1443 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]]
1444 ; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 16, !tbaa [[TBAA20]]
1445 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC21]]
1446 ; IS__CGSCC_NPM: for.inc21:
1447 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
1448 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP26:![0-9]+]]
1449 ; IS__CGSCC_NPM: for.end23:
1450 ; IS__CGSCC_NPM-NEXT: store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 1023), align 1, !tbaa [[TBAA15]]
1451 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR10]]
1452 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND25:%.*]]
1453 ; IS__CGSCC_NPM: for.cond25:
1454 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ]
1455 ; IS__CGSCC_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
1456 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]]
1457 ; IS__CGSCC_NPM: for.cond.cleanup27:
1458 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END35:%.*]]
1459 ; IS__CGSCC_NPM: for.body28:
1460 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX30:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[INDVARS_IV12]]
1461 ; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = load i8, i8* [[ARRAYIDX30]], align 1, !tbaa [[TBAA15]]
1462 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
1463 ; IS__CGSCC_NPM-NEXT: store i8 [[I19]], i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
1464 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC33]]
1465 ; IS__CGSCC_NPM: for.inc33:
1466 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
1467 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP27:![0-9]+]]
1468 ; IS__CGSCC_NPM: for.end35:
1469 ; IS__CGSCC_NPM-NEXT: ret void
1474 for.cond: ; preds = %for.inc, %entry
1475 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
1476 %exitcond = icmp ne i64 %indvars.iv, 100
1477 br i1 %exitcond, label %for.body, label %for.cond.cleanup
1479 for.cond.cleanup: ; preds = %for.cond
1482 for.body: ; preds = %for.cond
1483 %i = mul nuw nsw i64 %indvars.iv, 10
1484 %arrayidx = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 %i
1485 store i8 0, i8* %arrayidx, align 2, !tbaa !15
1488 for.inc: ; preds = %for.body
1489 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
1490 br label %for.cond, !llvm.loop !24
1492 for.end: ; preds = %for.cond.cleanup
1495 for.cond2: ; preds = %for.inc9, %for.end
1496 %indvars.iv2 = phi i64 [ %indvars.iv.next3, %for.inc9 ], [ 0, %for.end ]
1497 %exitcond6 = icmp ne i64 %indvars.iv2, 10
1498 br i1 %exitcond6, label %for.body5, label %for.cond.cleanup4
1500 for.cond.cleanup4: ; preds = %for.cond2
1503 for.body5: ; preds = %for.cond2
1504 %i15 = mul nuw nsw i64 %indvars.iv2, 10
1505 %i16 = or i64 %i15, 1
1506 %arrayidx8 = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 %i16
1507 store float 0.000000e+00, float* %arrayidx8, align 4, !tbaa !18
1510 for.inc9: ; preds = %for.body5
1511 %indvars.iv.next3 = add nuw nsw i64 %indvars.iv2, 1
1512 br label %for.cond2, !llvm.loop !25
1514 for.end11: ; preds = %for.cond.cleanup4
1515 br label %for.cond13
1517 for.cond13: ; preds = %for.inc21, %for.end11
1518 %indvars.iv7 = phi i64 [ %indvars.iv.next8, %for.inc21 ], [ 0, %for.end11 ]
1519 %exitcond11 = icmp ne i64 %indvars.iv7, 20
1520 br i1 %exitcond11, label %for.body16, label %for.cond.cleanup15
1522 for.cond.cleanup15: ; preds = %for.cond13
1525 for.body16: ; preds = %for.cond13
1526 %i17 = mul nuw nsw i64 %indvars.iv7, 10
1527 %i18 = add nuw nsw i64 %i17, 2
1528 %arrayidx20 = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 %i18
1529 store i64 0, i64* %arrayidx20, align 16, !tbaa !20
1532 for.inc21: ; preds = %for.body16
1533 %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7, 1
1534 br label %for.cond13, !llvm.loop !26
1536 for.end23: ; preds = %for.cond.cleanup15
1537 store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 1023), align 1, !tbaa !15
1538 call void @write_arg(i32* bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 0)
1539 br label %for.cond25
1541 for.cond25: ; preds = %for.inc33, %for.end23
1542 %indvars.iv12 = phi i64 [ %indvars.iv.next13, %for.inc33 ], [ 0, %for.end23 ]
1543 %exitcond14 = icmp ne i64 %indvars.iv12, 1024
1544 br i1 %exitcond14, label %for.body28, label %for.cond.cleanup27
1546 for.cond.cleanup27: ; preds = %for.cond25
1549 for.body28: ; preds = %for.cond25
1550 %arrayidx30 = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 %indvars.iv12
1551 %i19 = load i8, i8* %arrayidx30, align 1, !tbaa !15
1552 %arrayidx32 = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 %indvars.iv12
1553 store i8 %i19, i8* %arrayidx32, align 1, !tbaa !15
1556 for.inc33: ; preds = %for.body28
1557 %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12, 1
1558 br label %for.cond25, !llvm.loop !27
1560 for.end35: ; preds = %for.cond.cleanup27
1565 ; int static_global_simplifiable_3() {
1569 define i32 @static_global_simplifiable_3() {
1570 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
1571 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3
1572 ; IS__TUNIT_OPM-SAME: () #[[ATTR4]] {
1573 ; IS__TUNIT_OPM-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]]
1574 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]]
1575 ; IS__TUNIT_OPM-NEXT: ret i32 [[I]]
1577 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
1578 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3
1579 ; IS__TUNIT_NPM-SAME: () #[[ATTR2]] {
1580 ; IS__TUNIT_NPM-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]]
1581 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]]
1582 ; IS__TUNIT_NPM-NEXT: ret i32 [[I]]
1584 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn
1585 ; IS__CGSCC____-LABEL: define {{[^@]+}}@static_global_simplifiable_3
1586 ; IS__CGSCC____-SAME: () #[[ATTR5:[0-9]+]] {
1587 ; IS__CGSCC____-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]]
1588 ; IS__CGSCC____-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]]
1589 ; IS__CGSCC____-NEXT: ret i32 [[I]]
1591 store i32 1, i32* @Flag3, align 4, !tbaa !3
1592 %i = load i32, i32* @Flag3, align 4, !tbaa !3
1596 ; struct S noalias_arg_simplifiable_1(struct S s) {
1600 ; write_arg(&s.i1, 1);
1601 ; write_arg(&s.i2, 2);
1602 ; write_arg(&s.i3, 3);
1606 ; r.f3 = s.f3 + s.f1;
1609 ; r.i3 = s.i3 + s.i1;
1613 define void @noalias_arg_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result, %struct.S* byval(%struct.S) align 8 %s) {
1614 ; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn
1615 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1
1616 ; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] {
1617 ; IS__TUNIT_OPM-NEXT: entry:
1618 ; IS__TUNIT_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1619 ; IS__TUNIT_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1620 ; IS__TUNIT_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1621 ; IS__TUNIT_OPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]]
1622 ; IS__TUNIT_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1623 ; IS__TUNIT_OPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]]
1624 ; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1625 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR5]]
1626 ; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1627 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR5]]
1628 ; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1629 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR5]]
1630 ; IS__TUNIT_OPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1631 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]]
1632 ; IS__TUNIT_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1633 ; IS__TUNIT_OPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]]
1634 ; IS__TUNIT_OPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1635 ; IS__TUNIT_OPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]]
1636 ; IS__TUNIT_OPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00
1637 ; IS__TUNIT_OPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1638 ; IS__TUNIT_OPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]]
1639 ; IS__TUNIT_OPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1640 ; IS__TUNIT_OPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]]
1641 ; IS__TUNIT_OPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1642 ; IS__TUNIT_OPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]]
1643 ; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]]
1644 ; IS__TUNIT_OPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1645 ; IS__TUNIT_OPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]]
1646 ; IS__TUNIT_OPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1647 ; IS__TUNIT_OPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]]
1648 ; IS__TUNIT_OPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1649 ; IS__TUNIT_OPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]]
1650 ; IS__TUNIT_OPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1651 ; IS__TUNIT_OPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]]
1652 ; IS__TUNIT_OPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1
1653 ; IS__TUNIT_OPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1654 ; IS__TUNIT_OPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]]
1655 ; IS__TUNIT_OPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1656 ; IS__TUNIT_OPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]]
1657 ; IS__TUNIT_OPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1658 ; IS__TUNIT_OPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]]
1659 ; IS__TUNIT_OPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]]
1660 ; IS__TUNIT_OPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1661 ; IS__TUNIT_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]]
1662 ; IS__TUNIT_OPM-NEXT: ret void
1664 ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn
1665 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1
1666 ; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] {
1667 ; IS__TUNIT_NPM-NEXT: entry:
1668 ; IS__TUNIT_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1669 ; IS__TUNIT_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1670 ; IS__TUNIT_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1671 ; IS__TUNIT_NPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]]
1672 ; IS__TUNIT_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1673 ; IS__TUNIT_NPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]]
1674 ; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1675 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR4]]
1676 ; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1677 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR4]]
1678 ; IS__TUNIT_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1679 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR4]]
1680 ; IS__TUNIT_NPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1681 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]]
1682 ; IS__TUNIT_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1683 ; IS__TUNIT_NPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]]
1684 ; IS__TUNIT_NPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1685 ; IS__TUNIT_NPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]]
1686 ; IS__TUNIT_NPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00
1687 ; IS__TUNIT_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1688 ; IS__TUNIT_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]]
1689 ; IS__TUNIT_NPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1690 ; IS__TUNIT_NPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]]
1691 ; IS__TUNIT_NPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1692 ; IS__TUNIT_NPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]]
1693 ; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]]
1694 ; IS__TUNIT_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1695 ; IS__TUNIT_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]]
1696 ; IS__TUNIT_NPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1697 ; IS__TUNIT_NPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]]
1698 ; IS__TUNIT_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1699 ; IS__TUNIT_NPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]]
1700 ; IS__TUNIT_NPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1701 ; IS__TUNIT_NPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]]
1702 ; IS__TUNIT_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1
1703 ; IS__TUNIT_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1704 ; IS__TUNIT_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]]
1705 ; IS__TUNIT_NPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1706 ; IS__TUNIT_NPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]]
1707 ; IS__TUNIT_NPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1708 ; IS__TUNIT_NPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]]
1709 ; IS__TUNIT_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]]
1710 ; IS__TUNIT_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1711 ; IS__TUNIT_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]]
1712 ; IS__TUNIT_NPM-NEXT: ret void
1714 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn
1715 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1
1716 ; IS__CGSCC_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR6:[0-9]+]] {
1717 ; IS__CGSCC_OPM-NEXT: entry:
1718 ; IS__CGSCC_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1719 ; IS__CGSCC_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1720 ; IS__CGSCC_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1721 ; IS__CGSCC_OPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]]
1722 ; IS__CGSCC_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1723 ; IS__CGSCC_OPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]]
1724 ; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1725 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12]]
1726 ; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1727 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]]
1728 ; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1729 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]]
1730 ; IS__CGSCC_OPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1731 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]]
1732 ; IS__CGSCC_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1733 ; IS__CGSCC_OPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]]
1734 ; IS__CGSCC_OPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1735 ; IS__CGSCC_OPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]]
1736 ; IS__CGSCC_OPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00
1737 ; IS__CGSCC_OPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1738 ; IS__CGSCC_OPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]]
1739 ; IS__CGSCC_OPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1740 ; IS__CGSCC_OPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]]
1741 ; IS__CGSCC_OPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1742 ; IS__CGSCC_OPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]]
1743 ; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]]
1744 ; IS__CGSCC_OPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1745 ; IS__CGSCC_OPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]]
1746 ; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1747 ; IS__CGSCC_OPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]]
1748 ; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1749 ; IS__CGSCC_OPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]]
1750 ; IS__CGSCC_OPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1751 ; IS__CGSCC_OPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]]
1752 ; IS__CGSCC_OPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1
1753 ; IS__CGSCC_OPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1754 ; IS__CGSCC_OPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]]
1755 ; IS__CGSCC_OPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1756 ; IS__CGSCC_OPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]]
1757 ; IS__CGSCC_OPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1758 ; IS__CGSCC_OPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]]
1759 ; IS__CGSCC_OPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]]
1760 ; IS__CGSCC_OPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1761 ; IS__CGSCC_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]]
1762 ; IS__CGSCC_OPM-NEXT: ret void
1764 ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn
1765 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1
1766 ; IS__CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR6:[0-9]+]] {
1767 ; IS__CGSCC_NPM-NEXT: entry:
1768 ; IS__CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1769 ; IS__CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1770 ; IS__CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1771 ; IS__CGSCC_NPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]]
1772 ; IS__CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1773 ; IS__CGSCC_NPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]]
1774 ; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1775 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR9]]
1776 ; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1777 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR9]]
1778 ; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1779 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR9]]
1780 ; IS__CGSCC_NPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1781 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]]
1782 ; IS__CGSCC_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1783 ; IS__CGSCC_NPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]]
1784 ; IS__CGSCC_NPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1785 ; IS__CGSCC_NPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]]
1786 ; IS__CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00
1787 ; IS__CGSCC_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1788 ; IS__CGSCC_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]]
1789 ; IS__CGSCC_NPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1790 ; IS__CGSCC_NPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]]
1791 ; IS__CGSCC_NPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1792 ; IS__CGSCC_NPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]]
1793 ; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]]
1794 ; IS__CGSCC_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1795 ; IS__CGSCC_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]]
1796 ; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1797 ; IS__CGSCC_NPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]]
1798 ; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1799 ; IS__CGSCC_NPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]]
1800 ; IS__CGSCC_NPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1801 ; IS__CGSCC_NPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]]
1802 ; IS__CGSCC_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1
1803 ; IS__CGSCC_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1804 ; IS__CGSCC_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]]
1805 ; IS__CGSCC_NPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1806 ; IS__CGSCC_NPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]]
1807 ; IS__CGSCC_NPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1808 ; IS__CGSCC_NPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]]
1809 ; IS__CGSCC_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]]
1810 ; IS__CGSCC_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1811 ; IS__CGSCC_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]]
1812 ; IS__CGSCC_NPM-NEXT: ret void
1815 %f1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
1816 store float 0x3FF19999A0000000, float* %f1, align 4, !tbaa !7
1817 %f2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
1818 store float 0x40019999A0000000, float* %f2, align 8, !tbaa !10
1819 %f3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
1820 store float 0x400A666660000000, float* %f3, align 4, !tbaa !11
1821 %i1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
1822 call void @write_arg(i32* nonnull %i1, i32 1)
1823 %i2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
1824 call void @write_arg(i32* nonnull %i2, i32 2)
1825 %i3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
1826 call void @write_arg(i32* nonnull %i3, i32 3)
1827 %f11 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
1828 %i = load float, float* %f11, align 4, !tbaa !7
1829 %f12 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 3
1830 store float %i, float* %f12, align 4, !tbaa !7
1831 %f23 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
1832 %i4 = load float, float* %f23, align 8, !tbaa !10
1833 %mul = fmul float %i4, 2.000000e+00
1834 %f24 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 4
1835 store float %mul, float* %f24, align 4, !tbaa !10
1836 %f35 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
1837 %i5 = load float, float* %f35, align 4, !tbaa !11
1838 %f16 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
1839 %i6 = load float, float* %f16, align 4, !tbaa !7
1840 %add = fadd float %i5, %i6
1841 %f37 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 5
1842 store float %add, float* %f37, align 4, !tbaa !11
1843 %i18 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
1844 %i7 = load i32, i32* %i18, align 8, !tbaa !12
1845 %i19 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 0
1846 store i32 %i7, i32* %i19, align 4, !tbaa !12
1847 %i210 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
1848 %i8 = load i32, i32* %i210, align 4, !tbaa !13
1849 %mul11 = shl nsw i32 %i8, 1
1850 %i212 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 1
1851 store i32 %mul11, i32* %i212, align 4, !tbaa !13
1852 %i313 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
1853 %i9 = load i32, i32* %i313, align 8, !tbaa !14
1854 %i114 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
1855 %i10 = load i32, i32* %i114, align 8, !tbaa !12
1856 %add15 = add nsw i32 %i9, %i10
1857 %i316 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 2
1858 store i32 %add15, i32* %i316, align 4, !tbaa !14
1862 ; void noalias_arg_simplifiable_2(char Bytes[1024]) {
1863 ; for (int i = 0; i < 100; ++i)
1864 ; Bytes[i * 10] = 0;
1865 ; for (int i = 0; i < 10; ++i)
1866 ; ((float *)Bytes)[i * 10 + 1] = 0;
1867 ; for (int i = 0; i < 20; ++i)
1868 ; ((long long int *)Bytes)[i * 10 + 2] = 0;
1870 ; write_arg((int *)&Bytes[500], 0);
1872 ; for (int i = 0; i < 1024; ++i)
1873 ; globalBytes[i] = Bytes[i];
1876 define void @noalias_arg_simplifiable_2(i8* %Bytes) {
1877 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind
1878 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2
1879 ; IS__TUNIT_OPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR2]] {
1880 ; IS__TUNIT_OPM-NEXT: entry:
1881 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND:%.*]]
1882 ; IS__TUNIT_OPM: for.cond:
1883 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1884 ; IS__TUNIT_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1885 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1886 ; IS__TUNIT_OPM: for.cond.cleanup:
1887 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END:%.*]]
1888 ; IS__TUNIT_OPM: for.body:
1889 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1890 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]]
1891 ; IS__TUNIT_OPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA19]]
1892 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC]]
1893 ; IS__TUNIT_OPM: for.inc:
1894 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1895 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]]
1896 ; IS__TUNIT_OPM: for.end:
1897 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2:%.*]]
1898 ; IS__TUNIT_OPM: for.cond2:
1899 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1900 ; IS__TUNIT_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1901 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1902 ; IS__TUNIT_OPM: for.cond.cleanup4:
1903 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END11:%.*]]
1904 ; IS__TUNIT_OPM: for.body5:
1905 ; IS__TUNIT_OPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float*
1906 ; IS__TUNIT_OPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1907 ; IS__TUNIT_OPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1
1908 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]]
1909 ; IS__TUNIT_OPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]]
1910 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC9]]
1911 ; IS__TUNIT_OPM: for.inc9:
1912 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1913 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP27:![0-9]+]]
1914 ; IS__TUNIT_OPM: for.end11:
1915 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13:%.*]]
1916 ; IS__TUNIT_OPM: for.cond13:
1917 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1918 ; IS__TUNIT_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1919 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
1920 ; IS__TUNIT_OPM: for.cond.cleanup15:
1921 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END23:%.*]]
1922 ; IS__TUNIT_OPM: for.body16:
1923 ; IS__TUNIT_OPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64*
1924 ; IS__TUNIT_OPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
1925 ; IS__TUNIT_OPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2
1926 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]]
1927 ; IS__TUNIT_OPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]]
1928 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC21]]
1929 ; IS__TUNIT_OPM: for.inc21:
1930 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
1931 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]]
1932 ; IS__TUNIT_OPM: for.end23:
1933 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023
1934 ; IS__TUNIT_OPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]]
1935 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500
1936 ; IS__TUNIT_OPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32*
1937 ; IS__TUNIT_OPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR6]]
1938 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND27:%.*]]
1939 ; IS__TUNIT_OPM: for.cond27:
1940 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ]
1941 ; IS__TUNIT_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
1942 ; IS__TUNIT_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]]
1943 ; IS__TUNIT_OPM: for.cond.cleanup29:
1944 ; IS__TUNIT_OPM-NEXT: br label [[FOR_END37:%.*]]
1945 ; IS__TUNIT_OPM: for.body30:
1946 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]]
1947 ; IS__TUNIT_OPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
1948 ; IS__TUNIT_OPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
1949 ; IS__TUNIT_OPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]]
1950 ; IS__TUNIT_OPM-NEXT: br label [[FOR_INC35]]
1951 ; IS__TUNIT_OPM: for.inc35:
1952 ; IS__TUNIT_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
1953 ; IS__TUNIT_OPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]]
1954 ; IS__TUNIT_OPM: for.end37:
1955 ; IS__TUNIT_OPM-NEXT: ret void
1957 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
1958 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2
1959 ; IS__TUNIT_NPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR2]] {
1960 ; IS__TUNIT_NPM-NEXT: entry:
1961 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND:%.*]]
1962 ; IS__TUNIT_NPM: for.cond:
1963 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1964 ; IS__TUNIT_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1965 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1966 ; IS__TUNIT_NPM: for.cond.cleanup:
1967 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END:%.*]]
1968 ; IS__TUNIT_NPM: for.body:
1969 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1970 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]]
1971 ; IS__TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA19]]
1972 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC]]
1973 ; IS__TUNIT_NPM: for.inc:
1974 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1975 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]]
1976 ; IS__TUNIT_NPM: for.end:
1977 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2:%.*]]
1978 ; IS__TUNIT_NPM: for.cond2:
1979 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1980 ; IS__TUNIT_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1981 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1982 ; IS__TUNIT_NPM: for.cond.cleanup4:
1983 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END11:%.*]]
1984 ; IS__TUNIT_NPM: for.body5:
1985 ; IS__TUNIT_NPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float*
1986 ; IS__TUNIT_NPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1987 ; IS__TUNIT_NPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1
1988 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]]
1989 ; IS__TUNIT_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]]
1990 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC9]]
1991 ; IS__TUNIT_NPM: for.inc9:
1992 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1993 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP27:![0-9]+]]
1994 ; IS__TUNIT_NPM: for.end11:
1995 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13:%.*]]
1996 ; IS__TUNIT_NPM: for.cond13:
1997 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1998 ; IS__TUNIT_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1999 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
2000 ; IS__TUNIT_NPM: for.cond.cleanup15:
2001 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END23:%.*]]
2002 ; IS__TUNIT_NPM: for.body16:
2003 ; IS__TUNIT_NPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64*
2004 ; IS__TUNIT_NPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
2005 ; IS__TUNIT_NPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2
2006 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]]
2007 ; IS__TUNIT_NPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]]
2008 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC21]]
2009 ; IS__TUNIT_NPM: for.inc21:
2010 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
2011 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]]
2012 ; IS__TUNIT_NPM: for.end23:
2013 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023
2014 ; IS__TUNIT_NPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]]
2015 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500
2016 ; IS__TUNIT_NPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32*
2017 ; IS__TUNIT_NPM-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR4]]
2018 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND27:%.*]]
2019 ; IS__TUNIT_NPM: for.cond27:
2020 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ]
2021 ; IS__TUNIT_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
2022 ; IS__TUNIT_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]]
2023 ; IS__TUNIT_NPM: for.cond.cleanup29:
2024 ; IS__TUNIT_NPM-NEXT: br label [[FOR_END37:%.*]]
2025 ; IS__TUNIT_NPM: for.body30:
2026 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]]
2027 ; IS__TUNIT_NPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
2028 ; IS__TUNIT_NPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
2029 ; IS__TUNIT_NPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]]
2030 ; IS__TUNIT_NPM-NEXT: br label [[FOR_INC35]]
2031 ; IS__TUNIT_NPM: for.inc35:
2032 ; IS__TUNIT_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
2033 ; IS__TUNIT_NPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]]
2034 ; IS__TUNIT_NPM: for.end37:
2035 ; IS__TUNIT_NPM-NEXT: ret void
2037 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2
2038 ; IS__CGSCC_OPM-SAME: (i8* [[BYTES:%.*]]) {
2039 ; IS__CGSCC_OPM-NEXT: entry:
2040 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]]
2041 ; IS__CGSCC_OPM: for.cond:
2042 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
2043 ; IS__CGSCC_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
2044 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
2045 ; IS__CGSCC_OPM: for.cond.cleanup:
2046 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]]
2047 ; IS__CGSCC_OPM: for.body:
2048 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
2049 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]]
2050 ; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA15]]
2051 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]]
2052 ; IS__CGSCC_OPM: for.inc:
2053 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
2054 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]]
2055 ; IS__CGSCC_OPM: for.end:
2056 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2:%.*]]
2057 ; IS__CGSCC_OPM: for.cond2:
2058 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
2059 ; IS__CGSCC_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
2060 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
2061 ; IS__CGSCC_OPM: for.cond.cleanup4:
2062 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END11:%.*]]
2063 ; IS__CGSCC_OPM: for.body5:
2064 ; IS__CGSCC_OPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float*
2065 ; IS__CGSCC_OPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
2066 ; IS__CGSCC_OPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1
2067 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]]
2068 ; IS__CGSCC_OPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
2069 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC9]]
2070 ; IS__CGSCC_OPM: for.inc9:
2071 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
2072 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP29:![0-9]+]]
2073 ; IS__CGSCC_OPM: for.end11:
2074 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13:%.*]]
2075 ; IS__CGSCC_OPM: for.cond13:
2076 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
2077 ; IS__CGSCC_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
2078 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
2079 ; IS__CGSCC_OPM: for.cond.cleanup15:
2080 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END23:%.*]]
2081 ; IS__CGSCC_OPM: for.body16:
2082 ; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64*
2083 ; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
2084 ; IS__CGSCC_OPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2
2085 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]]
2086 ; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA20]]
2087 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC21]]
2088 ; IS__CGSCC_OPM: for.inc21:
2089 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
2090 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]]
2091 ; IS__CGSCC_OPM: for.end23:
2092 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023
2093 ; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]]
2094 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500
2095 ; IS__CGSCC_OPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32*
2096 ; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR13]]
2097 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND27:%.*]]
2098 ; IS__CGSCC_OPM: for.cond27:
2099 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ]
2100 ; IS__CGSCC_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
2101 ; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]]
2102 ; IS__CGSCC_OPM: for.cond.cleanup29:
2103 ; IS__CGSCC_OPM-NEXT: br label [[FOR_END37:%.*]]
2104 ; IS__CGSCC_OPM: for.body30:
2105 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]]
2106 ; IS__CGSCC_OPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
2107 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
2108 ; IS__CGSCC_OPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA15]]
2109 ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC35]]
2110 ; IS__CGSCC_OPM: for.inc35:
2111 ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
2112 ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]]
2113 ; IS__CGSCC_OPM: for.end37:
2114 ; IS__CGSCC_OPM-NEXT: ret void
2116 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2
2117 ; IS__CGSCC_NPM-SAME: (i8* [[BYTES:%.*]]) {
2118 ; IS__CGSCC_NPM-NEXT: entry:
2119 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]]
2120 ; IS__CGSCC_NPM: for.cond:
2121 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
2122 ; IS__CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
2123 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
2124 ; IS__CGSCC_NPM: for.cond.cleanup:
2125 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]]
2126 ; IS__CGSCC_NPM: for.body:
2127 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
2128 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]]
2129 ; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA15]]
2130 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]]
2131 ; IS__CGSCC_NPM: for.inc:
2132 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
2133 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]]
2134 ; IS__CGSCC_NPM: for.end:
2135 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]]
2136 ; IS__CGSCC_NPM: for.cond2:
2137 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
2138 ; IS__CGSCC_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
2139 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
2140 ; IS__CGSCC_NPM: for.cond.cleanup4:
2141 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END11:%.*]]
2142 ; IS__CGSCC_NPM: for.body5:
2143 ; IS__CGSCC_NPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float*
2144 ; IS__CGSCC_NPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
2145 ; IS__CGSCC_NPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1
2146 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]]
2147 ; IS__CGSCC_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
2148 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC9]]
2149 ; IS__CGSCC_NPM: for.inc9:
2150 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
2151 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP29:![0-9]+]]
2152 ; IS__CGSCC_NPM: for.end11:
2153 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]]
2154 ; IS__CGSCC_NPM: for.cond13:
2155 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
2156 ; IS__CGSCC_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
2157 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
2158 ; IS__CGSCC_NPM: for.cond.cleanup15:
2159 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END23:%.*]]
2160 ; IS__CGSCC_NPM: for.body16:
2161 ; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64*
2162 ; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
2163 ; IS__CGSCC_NPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2
2164 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]]
2165 ; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA20]]
2166 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC21]]
2167 ; IS__CGSCC_NPM: for.inc21:
2168 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
2169 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]]
2170 ; IS__CGSCC_NPM: for.end23:
2171 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023
2172 ; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]]
2173 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500
2174 ; IS__CGSCC_NPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32*
2175 ; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR10]]
2176 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND27:%.*]]
2177 ; IS__CGSCC_NPM: for.cond27:
2178 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ]
2179 ; IS__CGSCC_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
2180 ; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]]
2181 ; IS__CGSCC_NPM: for.cond.cleanup29:
2182 ; IS__CGSCC_NPM-NEXT: br label [[FOR_END37:%.*]]
2183 ; IS__CGSCC_NPM: for.body30:
2184 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]]
2185 ; IS__CGSCC_NPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
2186 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
2187 ; IS__CGSCC_NPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA15]]
2188 ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC35]]
2189 ; IS__CGSCC_NPM: for.inc35:
2190 ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
2191 ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]]
2192 ; IS__CGSCC_NPM: for.end37:
2193 ; IS__CGSCC_NPM-NEXT: ret void
2198 for.cond: ; preds = %for.inc, %entry
2199 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
2200 %exitcond = icmp ne i64 %indvars.iv, 100
2201 br i1 %exitcond, label %for.body, label %for.cond.cleanup
2203 for.cond.cleanup: ; preds = %for.cond
2206 for.body: ; preds = %for.cond
2207 %i = mul nuw nsw i64 %indvars.iv, 10
2208 %arrayidx = getelementptr inbounds i8, i8* %Bytes, i64 %i
2209 store i8 0, i8* %arrayidx, align 1, !tbaa !15
2212 for.inc: ; preds = %for.body
2213 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
2214 br label %for.cond, !llvm.loop !28
2216 for.end: ; preds = %for.cond.cleanup
2219 for.cond2: ; preds = %for.inc9, %for.end
2220 %indvars.iv2 = phi i64 [ %indvars.iv.next3, %for.inc9 ], [ 0, %for.end ]
2221 %exitcond6 = icmp ne i64 %indvars.iv2, 10
2222 br i1 %exitcond6, label %for.body5, label %for.cond.cleanup4
2224 for.cond.cleanup4: ; preds = %for.cond2
2227 for.body5: ; preds = %for.cond2
2228 %i15 = bitcast i8* %Bytes to float*
2229 %i16 = mul nuw nsw i64 %indvars.iv2, 10
2230 %i17 = or i64 %i16, 1
2231 %arrayidx8 = getelementptr inbounds float, float* %i15, i64 %i17
2232 store float 0.000000e+00, float* %arrayidx8, align 4, !tbaa !18
2235 for.inc9: ; preds = %for.body5
2236 %indvars.iv.next3 = add nuw nsw i64 %indvars.iv2, 1
2237 br label %for.cond2, !llvm.loop !29
2239 for.end11: ; preds = %for.cond.cleanup4
2240 br label %for.cond13
2242 for.cond13: ; preds = %for.inc21, %for.end11
2243 %indvars.iv7 = phi i64 [ %indvars.iv.next8, %for.inc21 ], [ 0, %for.end11 ]
2244 %exitcond11 = icmp ne i64 %indvars.iv7, 20
2245 br i1 %exitcond11, label %for.body16, label %for.cond.cleanup15
2247 for.cond.cleanup15: ; preds = %for.cond13
2250 for.body16: ; preds = %for.cond13
2251 %i18 = bitcast i8* %Bytes to i64*
2252 %i19 = mul nuw nsw i64 %indvars.iv7, 10
2253 %i20 = add nuw nsw i64 %i19, 2
2254 %arrayidx20 = getelementptr inbounds i64, i64* %i18, i64 %i20
2255 store i64 0, i64* %arrayidx20, align 8, !tbaa !20
2258 for.inc21: ; preds = %for.body16
2259 %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7, 1
2260 br label %for.cond13, !llvm.loop !30
2262 for.end23: ; preds = %for.cond.cleanup15
2263 %arrayidx24 = getelementptr inbounds i8, i8* %Bytes, i64 1023
2264 store i8 0, i8* %arrayidx24, align 1, !tbaa !15
2265 %arrayidx25 = getelementptr inbounds i8, i8* %Bytes, i64 500
2266 %i21 = bitcast i8* %arrayidx25 to i32*
2267 call void @write_arg(i32* nonnull %i21, i32 0)
2268 br label %for.cond27
2270 for.cond27: ; preds = %for.inc35, %for.end23
2271 %indvars.iv12 = phi i64 [ %indvars.iv.next13, %for.inc35 ], [ 0, %for.end23 ]
2272 %exitcond14 = icmp ne i64 %indvars.iv12, 1024
2273 br i1 %exitcond14, label %for.body30, label %for.cond.cleanup29
2275 for.cond.cleanup29: ; preds = %for.cond27
2278 for.body30: ; preds = %for.cond27
2279 %arrayidx32 = getelementptr inbounds i8, i8* %Bytes, i64 %indvars.iv12
2280 %i22 = load i8, i8* %arrayidx32, align 1, !tbaa !15
2281 %arrayidx34 = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 %indvars.iv12
2282 store i8 %i22, i8* %arrayidx34, align 1, !tbaa !15
2285 for.inc35: ; preds = %for.body30
2286 %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12, 1
2287 br label %for.cond27, !llvm.loop !31
2289 for.end37: ; preds = %for.cond.cleanup29
2293 ; int local_alloca_not_simplifiable_1() {
2302 define i32 @local_alloca_not_simplifiable_1() {
2303 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() {
2304 ; IS__TUNIT_OPM-NEXT: entry:
2305 ; IS__TUNIT_OPM-NEXT: [[X:%.*]] = alloca i32, align 4
2306 ; IS__TUNIT_OPM-NEXT: [[Y:%.*]] = alloca i32, align 4
2307 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8*
2308 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR9]]
2309 ; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8*
2310 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR9]]
2311 ; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2312 ; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]]
2313 ; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8*
2314 ; IS__TUNIT_OPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]])
2315 ; IS__TUNIT_OPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]])
2316 ; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]]
2317 ; IS__TUNIT_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0
2318 ; IS__TUNIT_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1
2319 ; IS__TUNIT_OPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2320 ; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]]
2321 ; IS__TUNIT_OPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]]
2322 ; IS__TUNIT_OPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8*
2323 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]])
2324 ; IS__TUNIT_OPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8*
2325 ; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]])
2326 ; IS__TUNIT_OPM-NEXT: ret i32 [[ADD1]]
2328 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() {
2329 ; IS__TUNIT_NPM-NEXT: entry:
2330 ; IS__TUNIT_NPM-NEXT: [[X:%.*]] = alloca i32, align 4
2331 ; IS__TUNIT_NPM-NEXT: [[Y:%.*]] = alloca i32, align 4
2332 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8*
2333 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR6]]
2334 ; IS__TUNIT_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8*
2335 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR6]]
2336 ; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2337 ; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]]
2338 ; IS__TUNIT_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8*
2339 ; IS__TUNIT_NPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]])
2340 ; IS__TUNIT_NPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]])
2341 ; IS__TUNIT_NPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]]
2342 ; IS__TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0
2343 ; IS__TUNIT_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1
2344 ; IS__TUNIT_NPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2345 ; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]]
2346 ; IS__TUNIT_NPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]]
2347 ; IS__TUNIT_NPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8*
2348 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]])
2349 ; IS__TUNIT_NPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8*
2350 ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]])
2351 ; IS__TUNIT_NPM-NEXT: ret i32 [[ADD1]]
2353 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() {
2354 ; IS__CGSCC_OPM-NEXT: entry:
2355 ; IS__CGSCC_OPM-NEXT: [[X:%.*]] = alloca i32, align 4
2356 ; IS__CGSCC_OPM-NEXT: [[Y:%.*]] = alloca i32, align 4
2357 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8*
2358 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]]
2359 ; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8*
2360 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]]
2361 ; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2362 ; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]]
2363 ; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8*
2364 ; IS__CGSCC_OPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]])
2365 ; IS__CGSCC_OPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]])
2366 ; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]]
2367 ; IS__CGSCC_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0
2368 ; IS__CGSCC_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1
2369 ; IS__CGSCC_OPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2370 ; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]]
2371 ; IS__CGSCC_OPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]]
2372 ; IS__CGSCC_OPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8*
2373 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]])
2374 ; IS__CGSCC_OPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8*
2375 ; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]])
2376 ; IS__CGSCC_OPM-NEXT: ret i32 [[ADD1]]
2378 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() {
2379 ; IS__CGSCC_NPM-NEXT: entry:
2380 ; IS__CGSCC_NPM-NEXT: [[X:%.*]] = alloca i32, align 4
2381 ; IS__CGSCC_NPM-NEXT: [[Y:%.*]] = alloca i32, align 4
2382 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8*
2383 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR8]]
2384 ; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8*
2385 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR8]]
2386 ; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2387 ; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]]
2388 ; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8*
2389 ; IS__CGSCC_NPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]])
2390 ; IS__CGSCC_NPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]])
2391 ; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]]
2392 ; IS__CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0
2393 ; IS__CGSCC_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1
2394 ; IS__CGSCC_NPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2395 ; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]]
2396 ; IS__CGSCC_NPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]]
2397 ; IS__CGSCC_NPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8*
2398 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]])
2399 ; IS__CGSCC_NPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8*
2400 ; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]])
2401 ; IS__CGSCC_NPM-NEXT: ret i32 [[ADD1]]
2404 %X = alloca i32, align 4
2405 %Y = alloca i32, align 4
2406 %i = bitcast i32* %X to i8*
2407 call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i)
2408 %i1 = bitcast i32* %Y to i8*
2409 call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i1)
2410 store i32 1, i32* %Y, align 4, !tbaa !3
2411 store i32 1, i32* %X, align 4, !tbaa !3
2412 %i2 = bitcast i32* %X to i8*
2413 call void @escape(i8* nonnull %i2)
2414 call void @write_random(i32* nonnull %Y)
2415 %i3 = load i32, i32* %X, align 4, !tbaa !3
2416 %tobool.not = icmp eq i32 %i3, 0
2417 %cond = select i1 %tobool.not, i32 2, i32 1
2418 %i4 = load i32, i32* %Y, align 4, !tbaa !3
2419 %add = add nsw i32 %i3, %i4
2420 %add1 = add nsw i32 %add, %cond
2421 %i5 = bitcast i32* %Y to i8*
2422 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i5)
2423 %i6 = bitcast i32* %X to i8*
2424 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i6)
2428 ; We could simplify these if we separate accessed bins wrt. alignment (here mod 4).
2429 define i32 @unknown_access_mixed_simplifiable(i32 %arg1, i32 %arg2) {
2430 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
2431 ; IS__TUNIT____-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable
2432 ; IS__TUNIT____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR3]] {
2433 ; IS__TUNIT____-NEXT: entry:
2434 ; IS__TUNIT____-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4
2435 ; IS__TUNIT____-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32*
2436 ; IS__TUNIT____-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
2437 ; IS__TUNIT____-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]]
2438 ; IS__TUNIT____-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]]
2439 ; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP1]], align 4
2440 ; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP2]], align 4
2441 ; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP3]], align 4
2442 ; IS__TUNIT____-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4
2443 ; IS__TUNIT____-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4
2444 ; IS__TUNIT____-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4
2445 ; IS__TUNIT____-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]]
2446 ; IS__TUNIT____-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]]
2447 ; IS__TUNIT____-NEXT: ret i32 [[ADD2]]
2449 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2450 ; IS__CGSCC____-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable
2451 ; IS__CGSCC____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR2]] {
2452 ; IS__CGSCC____-NEXT: entry:
2453 ; IS__CGSCC____-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4
2454 ; IS__CGSCC____-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32*
2455 ; IS__CGSCC____-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
2456 ; IS__CGSCC____-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]]
2457 ; IS__CGSCC____-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]]
2458 ; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP1]], align 4
2459 ; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP2]], align 4
2460 ; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP3]], align 4
2461 ; IS__CGSCC____-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4
2462 ; IS__CGSCC____-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4
2463 ; IS__CGSCC____-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4
2464 ; IS__CGSCC____-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]]
2465 ; IS__CGSCC____-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]]
2466 ; IS__CGSCC____-NEXT: ret i32 [[ADD2]]
2469 %s = alloca %struct.S, align 4
2470 %bc = bitcast %struct.S* %s to i32*
2471 %gep1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
2472 %gep2 = getelementptr inbounds i32, i32* %bc, i32 %arg1
2473 %gep3 = getelementptr inbounds i32, i32* %bc, i32 %arg2
2474 store i32 7, i32* %gep1
2475 store i32 7, i32* %gep2
2476 store i32 7, i32* %gep3
2477 %l1 = load i32, i32* %gep1
2478 %l2 = load i32, i32* %gep2
2479 %l3 = load i32, i32* %gep3
2480 %add1 = add i32 %l1, %l2
2481 %add2 = add i32 %add1, %l3
2485 ; The access to bc4b could go anywhere, nothing is simplifiable.
2486 define i32 @unknown_access_mixed_not_simplifiable(i32 %arg1, i32 %arg2, i32 %arg3) {
2487 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
2488 ; IS__TUNIT____-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable
2489 ; IS__TUNIT____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR3]] {
2490 ; IS__TUNIT____-NEXT: entry:
2491 ; IS__TUNIT____-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4
2492 ; IS__TUNIT____-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32*
2493 ; IS__TUNIT____-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
2494 ; IS__TUNIT____-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]]
2495 ; IS__TUNIT____-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]]
2496 ; IS__TUNIT____-NEXT: [[BC4A:%.*]] = bitcast %struct.S* [[S]] to i8*
2497 ; IS__TUNIT____-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, i8* [[BC4A]], i32 [[ARG3]]
2498 ; IS__TUNIT____-NEXT: [[BC4B:%.*]] = bitcast i8* [[GEP4]] to i32*
2499 ; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP1]], align 4
2500 ; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP2]], align 4
2501 ; IS__TUNIT____-NEXT: store i32 7, i32* [[GEP3]], align 4
2502 ; IS__TUNIT____-NEXT: store i32 7, i32* [[BC4B]], align 4
2503 ; IS__TUNIT____-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4
2504 ; IS__TUNIT____-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4
2505 ; IS__TUNIT____-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4
2506 ; IS__TUNIT____-NEXT: [[L4:%.*]] = load i32, i32* [[BC4B]], align 4
2507 ; IS__TUNIT____-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]]
2508 ; IS__TUNIT____-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]]
2509 ; IS__TUNIT____-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]]
2510 ; IS__TUNIT____-NEXT: ret i32 [[ADD3]]
2512 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2513 ; IS__CGSCC____-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable
2514 ; IS__CGSCC____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR2]] {
2515 ; IS__CGSCC____-NEXT: entry:
2516 ; IS__CGSCC____-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4
2517 ; IS__CGSCC____-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32*
2518 ; IS__CGSCC____-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
2519 ; IS__CGSCC____-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]]
2520 ; IS__CGSCC____-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]]
2521 ; IS__CGSCC____-NEXT: [[BC4A:%.*]] = bitcast %struct.S* [[S]] to i8*
2522 ; IS__CGSCC____-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, i8* [[BC4A]], i32 [[ARG3]]
2523 ; IS__CGSCC____-NEXT: [[BC4B:%.*]] = bitcast i8* [[GEP4]] to i32*
2524 ; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP1]], align 4
2525 ; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP2]], align 4
2526 ; IS__CGSCC____-NEXT: store i32 7, i32* [[GEP3]], align 4
2527 ; IS__CGSCC____-NEXT: store i32 7, i32* [[BC4B]], align 4
2528 ; IS__CGSCC____-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4
2529 ; IS__CGSCC____-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4
2530 ; IS__CGSCC____-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4
2531 ; IS__CGSCC____-NEXT: [[L4:%.*]] = load i32, i32* [[BC4B]], align 4
2532 ; IS__CGSCC____-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]]
2533 ; IS__CGSCC____-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]]
2534 ; IS__CGSCC____-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]]
2535 ; IS__CGSCC____-NEXT: ret i32 [[ADD3]]
2538 %s = alloca %struct.S, align 4
2539 %bc = bitcast %struct.S* %s to i32*
2540 %gep1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
2541 %gep2 = getelementptr inbounds i32, i32* %bc, i32 %arg1
2542 %gep3 = getelementptr inbounds i32, i32* %bc, i32 %arg2
2543 %bc4a = bitcast %struct.S* %s to i8*
2544 %gep4 = getelementptr inbounds i8, i8* %bc4a, i32 %arg3
2545 %bc4b = bitcast i8* %gep4 to i32*
2546 store i32 7, i32* %gep1
2547 store i32 7, i32* %gep2
2548 store i32 7, i32* %gep3
2549 store i32 7, i32* %bc4b
2550 %l1 = load i32, i32* %gep1
2551 %l2 = load i32, i32* %gep2
2552 %l3 = load i32, i32* %gep3
2553 %l4 = load i32, i32* %bc4b
2554 %add1 = add i32 %l1, %l2
2555 %add2 = add i32 %add1, %l3
2556 %add3 = add i32 %add2, %l4
2560 declare void @escape(i8*)
2563 ; int global_not_simplifiable_1(int cnd) {
2567 define i32 @global_not_simplifiable_1(i32 %cnd) {
2568 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn
2569 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1
2570 ; IS__TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] {
2571 ; IS__TUNIT_OPM-NEXT: entry:
2572 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]]
2573 ; IS__TUNIT_OPM-NEXT: ret i32 [[I]]
2575 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn
2576 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1
2577 ; IS__TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR5:[0-9]+]] {
2578 ; IS__TUNIT_NPM-NEXT: entry:
2579 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]]
2580 ; IS__TUNIT_NPM-NEXT: ret i32 [[I]]
2582 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
2583 ; IS__CGSCC____-LABEL: define {{[^@]+}}@global_not_simplifiable_1
2584 ; IS__CGSCC____-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] {
2585 ; IS__CGSCC____-NEXT: entry:
2586 ; IS__CGSCC____-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]]
2587 ; IS__CGSCC____-NEXT: ret i32 [[I]]
2590 %i = load i32, i32* @Flag0, align 4, !tbaa !3
2594 ; static int Flag1 __attribute__((loader_uninitialized));
2595 ; int static_global_not_simplifiable_1(int cnd) {
2603 define i32 @static_global_not_simplifiable_1(i32 %cnd) {
2604 ; CHECK-LABEL: define {{[^@]+}}@static_global_not_simplifiable_1
2605 ; CHECK-SAME: (i32 [[CND:%.*]]) {
2606 ; CHECK-NEXT: entry:
2607 ; CHECK-NEXT: call void @sync()
2608 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
2609 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
2611 ; CHECK-NEXT: store i32 1, i32* @Flag1, align 4, !tbaa [[TBAA3]]
2612 ; CHECK-NEXT: br label [[IF_END]]
2614 ; CHECK-NEXT: ret i32 1
2617 %i = load i32, i32* @Flag1, align 4, !tbaa !3
2619 %tobool.not = icmp eq i32 %cnd, 0
2620 br i1 %tobool.not, label %if.end, label %if.then
2622 if.then: ; preds = %entry
2623 store i32 1, i32* @Flag1, align 4, !tbaa !3
2626 if.end: ; preds = %if.then, %entry
2630 declare void @sync()
2632 ; static int Flag2 __attribute__((loader_uninitialized));
2633 ; int static_global_not_simplifiable_2(int cnd) {
2640 define i32 @static_global_not_simplifiable_2(i32 %cnd) {
2641 ; CHECK-LABEL: define {{[^@]+}}@static_global_not_simplifiable_2
2642 ; CHECK-SAME: (i32 [[CND:%.*]]) {
2643 ; CHECK-NEXT: entry:
2644 ; CHECK-NEXT: store i32 1, i32* @Flag2, align 4, !tbaa [[TBAA3]]
2645 ; CHECK-NEXT: call void @sync()
2646 ; CHECK-NEXT: [[I:%.*]] = load i32, i32* @Flag2, align 4, !tbaa [[TBAA3]]
2647 ; CHECK-NEXT: store i32 2, i32* @Flag2, align 4, !tbaa [[TBAA3]]
2648 ; CHECK-NEXT: ret i32 [[I]]
2651 store i32 1, i32* @Flag2, align 4, !tbaa !3
2653 %i = load i32, i32* @Flag2, align 4, !tbaa !3
2654 store i32 2, i32* @Flag2, align 4, !tbaa !3
2658 ; int write_read{,_static,_static_undef}_global(void) {
2659 ; Gint{,static,_static_undef}1 = 7;
2662 ; void write{,_static,_static_undef}_global(void) {
2663 ; Gint{,static,_static_undef}2 = 7;
2665 ; int read{,_static,_static_undef}_global(void) {
2666 ; return Gint{,static,_static_undef}2;
2669 ; FIXME: We could replace these loads.
2670 define i32 @write_read_global() {
2671 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
2672 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_global
2673 ; IS__TUNIT_OPM-SAME: () #[[ATTR4]] {
2674 ; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gint1, align 4
2675 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4
2676 ; IS__TUNIT_OPM-NEXT: ret i32 [[L]]
2678 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
2679 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_global
2680 ; IS__TUNIT_NPM-SAME: () #[[ATTR2]] {
2681 ; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gint1, align 4
2682 ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4
2683 ; IS__TUNIT_NPM-NEXT: ret i32 [[L]]
2685 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn
2686 ; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_global
2687 ; IS__CGSCC____-SAME: () #[[ATTR5]] {
2688 ; IS__CGSCC____-NEXT: store i32 7, i32* @Gint1, align 4
2689 ; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4
2690 ; IS__CGSCC____-NEXT: ret i32 [[L]]
2692 store i32 7, i32* @Gint1
2693 %l = load i32, i32* @Gint1
2696 define void @write_global() {
2697 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly
2698 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_global
2699 ; IS__TUNIT_OPM-SAME: () #[[ATTR5]] {
2700 ; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gint2, align 4
2701 ; IS__TUNIT_OPM-NEXT: ret void
2703 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly
2704 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_global
2705 ; IS__TUNIT_NPM-SAME: () #[[ATTR4]] {
2706 ; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gint2, align 4
2707 ; IS__TUNIT_NPM-NEXT: ret void
2709 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2710 ; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global
2711 ; IS__CGSCC____-SAME: () #[[ATTR4:[0-9]+]] {
2712 ; IS__CGSCC____-NEXT: store i32 7, i32* @Gint2, align 4
2713 ; IS__CGSCC____-NEXT: ret void
2715 store i32 7, i32* @Gint2
2718 define i32 @read_global() {
2719 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn
2720 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@read_global
2721 ; IS__TUNIT_OPM-SAME: () #[[ATTR7]] {
2722 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4
2723 ; IS__TUNIT_OPM-NEXT: ret i32 [[L]]
2725 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn
2726 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@read_global
2727 ; IS__TUNIT_NPM-SAME: () #[[ATTR5]] {
2728 ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4
2729 ; IS__TUNIT_NPM-NEXT: ret i32 [[L]]
2731 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
2732 ; IS__CGSCC____-LABEL: define {{[^@]+}}@read_global
2733 ; IS__CGSCC____-SAME: () #[[ATTR7]] {
2734 ; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4
2735 ; IS__CGSCC____-NEXT: ret i32 [[L]]
2737 %l = load i32, i32* @Gint2
2740 ; FIXME: We could replace these loads.
2741 define i32 @write_read_static_global() {
2742 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
2743 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_global
2744 ; IS__TUNIT_OPM-SAME: () #[[ATTR4]] {
2745 ; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gstatic_int1, align 4
2746 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4
2747 ; IS__TUNIT_OPM-NEXT: ret i32 [[L]]
2749 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
2750 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_static_global
2751 ; IS__TUNIT_NPM-SAME: () #[[ATTR2]] {
2752 ; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gstatic_int1, align 4
2753 ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4
2754 ; IS__TUNIT_NPM-NEXT: ret i32 [[L]]
2756 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn
2757 ; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_static_global
2758 ; IS__CGSCC____-SAME: () #[[ATTR5]] {
2759 ; IS__CGSCC____-NEXT: store i32 7, i32* @Gstatic_int1, align 4
2760 ; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4
2761 ; IS__CGSCC____-NEXT: ret i32 [[L]]
2763 store i32 7, i32* @Gstatic_int1
2764 %l = load i32, i32* @Gstatic_int1
2767 define void @write_static_global() {
2768 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly
2769 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_static_global
2770 ; IS__TUNIT_OPM-SAME: () #[[ATTR5]] {
2771 ; IS__TUNIT_OPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4
2772 ; IS__TUNIT_OPM-NEXT: ret void
2774 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly
2775 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_static_global
2776 ; IS__TUNIT_NPM-SAME: () #[[ATTR4]] {
2777 ; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4
2778 ; IS__TUNIT_NPM-NEXT: ret void
2780 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2781 ; IS__CGSCC____-LABEL: define {{[^@]+}}@write_static_global
2782 ; IS__CGSCC____-SAME: () #[[ATTR4]] {
2783 ; IS__CGSCC____-NEXT: store i32 7, i32* @Gstatic_int2, align 4
2784 ; IS__CGSCC____-NEXT: ret void
2786 store i32 7, i32* @Gstatic_int2
2789 define i32 @read_static_global() {
2790 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readonly willreturn
2791 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@read_static_global
2792 ; IS__TUNIT_OPM-SAME: () #[[ATTR7]] {
2793 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4
2794 ; IS__TUNIT_OPM-NEXT: ret i32 [[L]]
2796 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readonly willreturn
2797 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@read_static_global
2798 ; IS__TUNIT_NPM-SAME: () #[[ATTR5]] {
2799 ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4
2800 ; IS__TUNIT_NPM-NEXT: ret i32 [[L]]
2802 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
2803 ; IS__CGSCC____-LABEL: define {{[^@]+}}@read_static_global
2804 ; IS__CGSCC____-SAME: () #[[ATTR7]] {
2805 ; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4
2806 ; IS__CGSCC____-NEXT: ret i32 [[L]]
2808 %l = load i32, i32* @Gstatic_int2
2811 define i32 @write_read_static_undef_global() {
2812 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly
2813 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_undef_global
2814 ; IS__TUNIT_OPM-SAME: () #[[ATTR5]] {
2815 ; IS__TUNIT_OPM-NEXT: ret i32 7
2817 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly
2818 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_read_static_undef_global
2819 ; IS__TUNIT_NPM-SAME: () #[[ATTR4]] {
2820 ; IS__TUNIT_NPM-NEXT: ret i32 7
2822 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2823 ; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_static_undef_global
2824 ; IS__CGSCC____-SAME: () #[[ATTR4]] {
2825 ; IS__CGSCC____-NEXT: ret i32 7
2827 store i32 7, i32* @Gstatic_undef_int1
2828 %l = load i32, i32* @Gstatic_undef_int1
2831 define void @write_static_undef_global() {
2832 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly
2833 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_static_undef_global
2834 ; IS__TUNIT_OPM-SAME: () #[[ATTR5]] {
2835 ; IS__TUNIT_OPM-NEXT: ret void
2837 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly
2838 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_static_undef_global
2839 ; IS__TUNIT_NPM-SAME: () #[[ATTR4]] {
2840 ; IS__TUNIT_NPM-NEXT: ret void
2842 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2843 ; IS__CGSCC____-LABEL: define {{[^@]+}}@write_static_undef_global
2844 ; IS__CGSCC____-SAME: () #[[ATTR4]] {
2845 ; IS__CGSCC____-NEXT: store i32 7, i32* @Gstatic_undef_int2, align 4
2846 ; IS__CGSCC____-NEXT: ret void
2848 store i32 7, i32* @Gstatic_undef_int2
2851 define i32 @read_static_undef_global() {
2852 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
2853 ; IS__TUNIT____-LABEL: define {{[^@]+}}@read_static_undef_global
2854 ; IS__TUNIT____-SAME: () #[[ATTR3]] {
2855 ; IS__TUNIT____-NEXT: ret i32 7
2857 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2858 ; IS__CGSCC____-LABEL: define {{[^@]+}}@read_static_undef_global
2859 ; IS__CGSCC____-SAME: () #[[ATTR2]] {
2860 ; IS__CGSCC____-NEXT: ret i32 7
2862 %l = load i32, i32* @Gstatic_undef_int2
2866 define i32 @single_read_of_static_global() {
2867 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
2868 ; IS__TUNIT____-LABEL: define {{[^@]+}}@single_read_of_static_global
2869 ; IS__TUNIT____-SAME: () #[[ATTR3]] {
2870 ; IS__TUNIT____-NEXT: ret i32 0
2872 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2873 ; IS__CGSCC____-LABEL: define {{[^@]+}}@single_read_of_static_global
2874 ; IS__CGSCC____-SAME: () #[[ATTR2]] {
2875 ; IS__CGSCC____-NEXT: ret i32 0
2877 %l = load i32, i32* @Gstatic_int3
2881 define i8 @phi_store() {
2882 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone
2883 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_store
2884 ; IS__TUNIT_OPM-SAME: () #[[ATTR8:[0-9]+]] {
2885 ; IS__TUNIT_OPM-NEXT: entry:
2886 ; IS__TUNIT_OPM-NEXT: [[A:%.*]] = alloca i16, align 2
2887 ; IS__TUNIT_OPM-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8*
2888 ; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]]
2889 ; IS__TUNIT_OPM: loop:
2890 ; IS__TUNIT_OPM-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
2891 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2892 ; IS__TUNIT_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1
2893 ; IS__TUNIT_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1
2894 ; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2
2895 ; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2896 ; IS__TUNIT_OPM: end:
2897 ; IS__TUNIT_OPM-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1
2898 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1
2899 ; IS__TUNIT_OPM-NEXT: ret i8 [[L]]
2901 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
2902 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_store
2903 ; IS__TUNIT_NPM-SAME: () #[[ATTR3]] {
2904 ; IS__TUNIT_NPM-NEXT: entry:
2905 ; IS__TUNIT_NPM-NEXT: [[A:%.*]] = alloca i16, align 2
2906 ; IS__TUNIT_NPM-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8*
2907 ; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]]
2908 ; IS__TUNIT_NPM: loop:
2909 ; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
2910 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2911 ; IS__TUNIT_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1
2912 ; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1
2913 ; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2
2914 ; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2915 ; IS__TUNIT_NPM: end:
2916 ; IS__TUNIT_NPM-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1
2917 ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1
2918 ; IS__TUNIT_NPM-NEXT: ret i8 [[L]]
2920 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone
2921 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_store
2922 ; IS__CGSCC_OPM-SAME: () #[[ATTR8:[0-9]+]] {
2923 ; IS__CGSCC_OPM-NEXT: entry:
2924 ; IS__CGSCC_OPM-NEXT: [[A:%.*]] = alloca i16, align 2
2925 ; IS__CGSCC_OPM-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8*
2926 ; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]]
2927 ; IS__CGSCC_OPM: loop:
2928 ; IS__CGSCC_OPM-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
2929 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2930 ; IS__CGSCC_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1
2931 ; IS__CGSCC_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1
2932 ; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2
2933 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2934 ; IS__CGSCC_OPM: end:
2935 ; IS__CGSCC_OPM-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1
2936 ; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1
2937 ; IS__CGSCC_OPM-NEXT: ret i8 [[L]]
2939 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2940 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_store
2941 ; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
2942 ; IS__CGSCC_NPM-NEXT: entry:
2943 ; IS__CGSCC_NPM-NEXT: [[A:%.*]] = alloca i16, align 2
2944 ; IS__CGSCC_NPM-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8*
2945 ; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]]
2946 ; IS__CGSCC_NPM: loop:
2947 ; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
2948 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2949 ; IS__CGSCC_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1
2950 ; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1
2951 ; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2
2952 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2953 ; IS__CGSCC_NPM: end:
2954 ; IS__CGSCC_NPM-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1
2955 ; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1
2956 ; IS__CGSCC_NPM-NEXT: ret i8 [[L]]
2960 %b = bitcast i16* %a to i8*
2963 %p = phi i8* [%b, %entry], [%g, %loop]
2964 %i = phi i8 [0, %entry], [%o, %loop]
2966 %g = getelementptr i8, i8* %p, i64 1
2967 %o = add nsw i8 %i, 1
2968 %c = icmp eq i8 %o, 2
2969 br i1 %c, label %end, label %loop
2971 %s = getelementptr i8, i8* %b, i64 1
2972 %l = load i8, i8* %s
2976 ; FIXME: This function returns 1.
2977 define i8 @phi_no_store_1() {
2978 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind
2979 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_no_store_1
2980 ; IS__TUNIT_OPM-SAME: () #[[ATTR2]] {
2981 ; IS__TUNIT_OPM-NEXT: entry:
2982 ; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]]
2983 ; IS__TUNIT_OPM: loop:
2984 ; IS__TUNIT_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
2985 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2986 ; IS__TUNIT_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1
2987 ; IS__TUNIT_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1
2988 ; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3
2989 ; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2990 ; IS__TUNIT_OPM: end:
2991 ; IS__TUNIT_OPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2
2992 ; IS__TUNIT_OPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1
2993 ; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]]
2994 ; IS__TUNIT_OPM-NEXT: ret i8 [[ADD]]
2996 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
2997 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_1
2998 ; IS__TUNIT_NPM-SAME: () #[[ATTR2]] {
2999 ; IS__TUNIT_NPM-NEXT: entry:
3000 ; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]]
3001 ; IS__TUNIT_NPM: loop:
3002 ; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
3003 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3004 ; IS__TUNIT_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1
3005 ; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1
3006 ; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3
3007 ; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3008 ; IS__TUNIT_NPM: end:
3009 ; IS__TUNIT_NPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2
3010 ; IS__TUNIT_NPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1
3011 ; IS__TUNIT_NPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]]
3012 ; IS__TUNIT_NPM-NEXT: ret i8 [[ADD]]
3014 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind
3015 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_no_store_1
3016 ; IS__CGSCC_OPM-SAME: () #[[ATTR9:[0-9]+]] {
3017 ; IS__CGSCC_OPM-NEXT: entry:
3018 ; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]]
3019 ; IS__CGSCC_OPM: loop:
3020 ; IS__CGSCC_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
3021 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3022 ; IS__CGSCC_OPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1
3023 ; IS__CGSCC_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1
3024 ; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3
3025 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3026 ; IS__CGSCC_OPM: end:
3027 ; IS__CGSCC_OPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2
3028 ; IS__CGSCC_OPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1
3029 ; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]]
3030 ; IS__CGSCC_OPM-NEXT: ret i8 [[ADD]]
3032 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn
3033 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_1
3034 ; IS__CGSCC_NPM-SAME: () #[[ATTR5]] {
3035 ; IS__CGSCC_NPM-NEXT: entry:
3036 ; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]]
3037 ; IS__CGSCC_NPM: loop:
3038 ; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
3039 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3040 ; IS__CGSCC_NPM-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1
3041 ; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1
3042 ; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3
3043 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3044 ; IS__CGSCC_NPM: end:
3045 ; IS__CGSCC_NPM-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2
3046 ; IS__CGSCC_NPM-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1
3047 ; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]]
3048 ; IS__CGSCC_NPM-NEXT: ret i8 [[ADD]]
3051 %b = bitcast i32* @a1 to i8*
3054 %p = phi i8* [%b, %entry], [%g, %loop]
3055 %i = phi i8 [0, %entry], [%o, %loop]
3057 %g = getelementptr i8, i8* %p, i64 1
3058 %o = add nsw i8 %i, 1
3059 %c = icmp eq i8 %o, 3
3060 br i1 %c, label %end, label %loop
3062 %s11 = getelementptr i8, i8* %b, i64 2
3063 %l11 = load i8, i8* %s11
3064 %s12 = getelementptr i8, i8* %b, i64 3
3065 %l12 = load i8, i8* %s12
3066 %add = add i8 %l11, %l12
3070 ; FIXME: This function returns 1.
3071 define i8 @phi_no_store_2() {
3072 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind
3073 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_no_store_2
3074 ; IS__TUNIT_OPM-SAME: () #[[ATTR2]] {
3075 ; IS__TUNIT_OPM-NEXT: entry:
3076 ; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]]
3077 ; IS__TUNIT_OPM: loop:
3078 ; IS__TUNIT_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ]
3079 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3080 ; IS__TUNIT_OPM-NEXT: store i8 1, i8* [[P]], align 2
3081 ; IS__TUNIT_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1
3082 ; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
3083 ; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3084 ; IS__TUNIT_OPM: end:
3085 ; IS__TUNIT_OPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2
3086 ; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add i8 [[L21]], 0
3087 ; IS__TUNIT_OPM-NEXT: ret i8 [[ADD]]
3089 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
3090 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_2
3091 ; IS__TUNIT_NPM-SAME: () #[[ATTR2]] {
3092 ; IS__TUNIT_NPM-NEXT: entry:
3093 ; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]]
3094 ; IS__TUNIT_NPM: loop:
3095 ; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ]
3096 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3097 ; IS__TUNIT_NPM-NEXT: store i8 1, i8* [[P]], align 2
3098 ; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1
3099 ; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
3100 ; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3101 ; IS__TUNIT_NPM: end:
3102 ; IS__TUNIT_NPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2
3103 ; IS__TUNIT_NPM-NEXT: ret i8 [[L21]]
3105 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind
3106 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_no_store_2
3107 ; IS__CGSCC_OPM-SAME: () #[[ATTR9]] {
3108 ; IS__CGSCC_OPM-NEXT: entry:
3109 ; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]]
3110 ; IS__CGSCC_OPM: loop:
3111 ; IS__CGSCC_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ]
3112 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3113 ; IS__CGSCC_OPM-NEXT: store i8 1, i8* [[P]], align 2
3114 ; IS__CGSCC_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1
3115 ; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
3116 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3117 ; IS__CGSCC_OPM: end:
3118 ; IS__CGSCC_OPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2
3119 ; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add i8 [[L21]], 0
3120 ; IS__CGSCC_OPM-NEXT: ret i8 [[ADD]]
3122 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn
3123 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_2
3124 ; IS__CGSCC_NPM-SAME: () #[[ATTR5]] {
3125 ; IS__CGSCC_NPM-NEXT: entry:
3126 ; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]]
3127 ; IS__CGSCC_NPM: loop:
3128 ; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ]
3129 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3130 ; IS__CGSCC_NPM-NEXT: store i8 1, i8* [[P]], align 2
3131 ; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1
3132 ; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
3133 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3134 ; IS__CGSCC_NPM: end:
3135 ; IS__CGSCC_NPM-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2
3136 ; IS__CGSCC_NPM-NEXT: ret i8 [[L21]]
3139 %b = bitcast i32* @a2 to i8*
3142 %p = phi i8* [%b, %entry], [%g, %loop]
3143 %i = phi i8 [0, %entry], [%o, %loop]
3145 %g = getelementptr i8, i8* %b, i64 2
3146 %o = add nsw i8 %i, 1
3147 %c = icmp eq i8 %o, 7
3148 br i1 %c, label %end, label %loop
3150 %s21 = getelementptr i8, i8* %b, i64 2
3151 %l21 = load i8, i8* %s21
3152 %s22 = getelementptr i8, i8* %b, i64 3
3153 %l22 = load i8, i8* %s22
3154 %add = add i8 %l21, %l22
3158 define i8 @phi_no_store_3() {
3159 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind writeonly
3160 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_no_store_3
3161 ; IS__TUNIT_OPM-SAME: () #[[ATTR6]] {
3162 ; IS__TUNIT_OPM-NEXT: entry:
3163 ; IS__TUNIT_OPM-NEXT: br label [[LOOP:%.*]]
3164 ; IS__TUNIT_OPM: loop:
3165 ; IS__TUNIT_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ]
3166 ; IS__TUNIT_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3167 ; IS__TUNIT_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1
3168 ; IS__TUNIT_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
3169 ; IS__TUNIT_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3170 ; IS__TUNIT_OPM: end:
3171 ; IS__TUNIT_OPM-NEXT: ret i8 1
3173 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly
3174 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_no_store_3
3175 ; IS__TUNIT_NPM-SAME: () #[[ATTR4]] {
3176 ; IS__TUNIT_NPM-NEXT: entry:
3177 ; IS__TUNIT_NPM-NEXT: br label [[LOOP:%.*]]
3178 ; IS__TUNIT_NPM: loop:
3179 ; IS__TUNIT_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ]
3180 ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3181 ; IS__TUNIT_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1
3182 ; IS__TUNIT_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
3183 ; IS__TUNIT_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3184 ; IS__TUNIT_NPM: end:
3185 ; IS__TUNIT_NPM-NEXT: ret i8 1
3187 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly
3188 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_no_store_3
3189 ; IS__CGSCC_OPM-SAME: () #[[ATTR10:[0-9]+]] {
3190 ; IS__CGSCC_OPM-NEXT: entry:
3191 ; IS__CGSCC_OPM-NEXT: br label [[LOOP:%.*]]
3192 ; IS__CGSCC_OPM: loop:
3193 ; IS__CGSCC_OPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ]
3194 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3195 ; IS__CGSCC_OPM-NEXT: [[O]] = add nsw i8 [[I]], 1
3196 ; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
3197 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3198 ; IS__CGSCC_OPM: end:
3199 ; IS__CGSCC_OPM-NEXT: ret i8 1
3201 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
3202 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_no_store_3
3203 ; IS__CGSCC_NPM-SAME: () #[[ATTR4]] {
3204 ; IS__CGSCC_NPM-NEXT: entry:
3205 ; IS__CGSCC_NPM-NEXT: br label [[LOOP:%.*]]
3206 ; IS__CGSCC_NPM: loop:
3207 ; IS__CGSCC_NPM-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ]
3208 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3209 ; IS__CGSCC_NPM-NEXT: [[O]] = add nsw i8 [[I]], 1
3210 ; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
3211 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3212 ; IS__CGSCC_NPM: end:
3213 ; IS__CGSCC_NPM-NEXT: ret i8 1
3216 %b = bitcast i32* @a3 to i8*
3217 %s30 = getelementptr i8, i8* %b, i64 3
3218 store i8 0, i8* %s30
3221 %p = phi i8* [%b, %entry], [%g, %loop]
3222 %i = phi i8 [0, %entry], [%o, %loop]
3224 %g = getelementptr i8, i8* %b, i64 2
3225 %o = add nsw i8 %i, 1
3226 %c = icmp eq i8 %o, 7
3227 br i1 %c, label %end, label %loop
3229 %s31 = getelementptr i8, i8* %b, i64 2
3230 %l31 = load i8, i8* %s31
3231 %s32 = getelementptr i8, i8* %b, i64 3
3232 %l32 = load i8, i8* %s32
3233 %add = add i8 %l31, %l32
3237 define i8 @cast_and_load_1() {
3238 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
3239 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_1
3240 ; IS__TUNIT_OPM-SAME: () #[[ATTR4]] {
3241 ; IS__TUNIT_OPM-NEXT: store i32 42, i32* @bytes1, align 4
3242 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4
3243 ; IS__TUNIT_OPM-NEXT: ret i8 [[L]]
3245 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
3246 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@cast_and_load_1
3247 ; IS__TUNIT_NPM-SAME: () #[[ATTR2]] {
3248 ; IS__TUNIT_NPM-NEXT: store i32 42, i32* @bytes1, align 4
3249 ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4
3250 ; IS__TUNIT_NPM-NEXT: ret i8 [[L]]
3252 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn
3253 ; IS__CGSCC____-LABEL: define {{[^@]+}}@cast_and_load_1
3254 ; IS__CGSCC____-SAME: () #[[ATTR5]] {
3255 ; IS__CGSCC____-NEXT: store i32 42, i32* @bytes1, align 4
3256 ; IS__CGSCC____-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4
3257 ; IS__CGSCC____-NEXT: ret i8 [[L]]
3259 store i32 42, i32* @bytes1
3260 %bc = bitcast i32* @bytes1 to i8*
3261 %l = load i8, i8* %bc
3265 define i64 @cast_and_load_2() {
3266 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
3267 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_2
3268 ; IS__TUNIT_OPM-SAME: () #[[ATTR4]] {
3269 ; IS__TUNIT_OPM-NEXT: store i32 42, i32* @bytes2, align 4
3270 ; IS__TUNIT_OPM-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4
3271 ; IS__TUNIT_OPM-NEXT: ret i64 [[L]]
3273 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
3274 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@cast_and_load_2
3275 ; IS__TUNIT_NPM-SAME: () #[[ATTR2]] {
3276 ; IS__TUNIT_NPM-NEXT: store i32 42, i32* @bytes2, align 4
3277 ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4
3278 ; IS__TUNIT_NPM-NEXT: ret i64 [[L]]
3280 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn
3281 ; IS__CGSCC____-LABEL: define {{[^@]+}}@cast_and_load_2
3282 ; IS__CGSCC____-SAME: () #[[ATTR5]] {
3283 ; IS__CGSCC____-NEXT: store i32 42, i32* @bytes2, align 4
3284 ; IS__CGSCC____-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4
3285 ; IS__CGSCC____-NEXT: ret i64 [[L]]
3287 store i32 42, i32* @bytes2
3288 %bc = bitcast i32* @bytes2 to i64*
3289 %l = load i64, i64* %bc
3293 !llvm.module.flags = !{!0, !1}
3296 !0 = !{i32 1, !"wchar_size", i32 4}
3297 !1 = !{i32 7, !"uwtable", i32 1}
3298 !2 = !{!"clang version 13.0.0"}
3299 !3 = !{!4, !4, i64 0}
3300 !4 = !{!"int", !5, i64 0}
3301 !5 = !{!"omnipotent char", !6, i64 0}
3302 !6 = !{!"Simple C/C++ TBAA"}
3303 !7 = !{!8, !9, i64 12}
3304 !8 = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20}
3305 !9 = !{!"float", !5, i64 0}
3306 !10 = !{!8, !9, i64 16}
3307 !11 = !{!8, !9, i64 20}
3308 !12 = !{!8, !4, i64 0}
3309 !13 = !{!8, !4, i64 4}
3310 !14 = !{!8, !4, i64 8}
3311 !15 = !{!5, !5, i64 0}
3312 !16 = distinct !{!16, !17}
3313 !17 = !{!"llvm.loop.mustprogress"}
3314 !18 = !{!9, !9, i64 0}
3315 !19 = distinct !{!19, !17}
3316 !20 = !{!21, !21, i64 0}
3317 !21 = !{!"long long", !5, i64 0}
3318 !22 = distinct !{!22, !17}
3319 !23 = distinct !{!23, !17}
3320 !24 = distinct !{!24, !17}
3321 !25 = distinct !{!25, !17}
3322 !26 = distinct !{!26, !17}
3323 !27 = distinct !{!27, !17}
3324 !28 = distinct !{!28, !17}
3325 !29 = distinct !{!29, !17}
3326 !30 = distinct !{!30, !17}
3327 !31 = distinct !{!31, !17}
3329 ; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly }
3330 ; IS__TUNIT_OPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn }
3331 ; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind }
3332 ; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn }
3333 ; IS__TUNIT_OPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn }
3334 ; IS__TUNIT_OPM: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn writeonly }
3335 ; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree nosync nounwind writeonly }
3336 ; IS__TUNIT_OPM: attributes #[[ATTR7]] = { nofree nosync nounwind readonly willreturn }
3337 ; IS__TUNIT_OPM: attributes #[[ATTR8]] = { nofree nosync nounwind readnone }
3338 ; IS__TUNIT_OPM: attributes #[[ATTR9]] = { willreturn }
3340 ; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree nosync nounwind willreturn writeonly }
3341 ; IS__TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn }
3342 ; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn }
3343 ; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn }
3344 ; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn writeonly }
3345 ; IS__TUNIT_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn }
3346 ; IS__TUNIT_NPM: attributes #[[ATTR6]] = { willreturn }
3348 ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
3349 ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn }
3350 ; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn }
3351 ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn }
3352 ; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly }
3353 ; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn }
3354 ; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn }
3355 ; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn }
3356 ; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone }
3357 ; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind }
3358 ; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind writeonly }
3359 ; IS__CGSCC_OPM: attributes #[[ATTR11]] = { willreturn }
3360 ; IS__CGSCC_OPM: attributes #[[ATTR12]] = { nounwind willreturn writeonly }
3361 ; IS__CGSCC_OPM: attributes #[[ATTR13]] = { nounwind writeonly }
3363 ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
3364 ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn }
3365 ; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn }
3366 ; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn }
3367 ; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly }
3368 ; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn }
3369 ; IS__CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn }
3370 ; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn }
3371 ; IS__CGSCC_NPM: attributes #[[ATTR8]] = { willreturn }
3372 ; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nounwind willreturn writeonly }
3373 ; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nounwind writeonly }
3375 ; IS__TUNIT____: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
3376 ; IS__TUNIT____: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1}
3377 ; IS__TUNIT____: [[META2:![0-9]+]] = !{!"clang version 13.0.0"}
3378 ; IS__TUNIT____: [[TBAA3]] = !{!4, !4, i64 0}
3379 ; IS__TUNIT____: [[META4:![0-9]+]] = !{!"int", !5, i64 0}
3380 ; IS__TUNIT____: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0}
3381 ; IS__TUNIT____: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"}
3382 ; IS__TUNIT____: [[META7:![0-9]+]] = !{!8, !9, i64 12}
3383 ; IS__TUNIT____: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20}
3384 ; IS__TUNIT____: [[META9:![0-9]+]] = !{!"float", !5, i64 0}
3385 ; IS__TUNIT____: [[META10:![0-9]+]] = !{!8, !9, i64 16}
3386 ; IS__TUNIT____: [[META11:![0-9]+]] = !{!8, !9, i64 20}
3387 ; IS__TUNIT____: [[META12:![0-9]+]] = !{!8, !4, i64 0}
3388 ; IS__TUNIT____: [[META13:![0-9]+]] = !{!8, !4, i64 4}
3389 ; IS__TUNIT____: [[META14:![0-9]+]] = !{!8, !4, i64 8}
3390 ; IS__TUNIT____: [[META15:![0-9]+]] = distinct !{!15, !16}
3391 ; IS__TUNIT____: [[META16:![0-9]+]] = !{!"llvm.loop.mustprogress"}
3392 ; IS__TUNIT____: [[META17:![0-9]+]] = distinct !{!17, !16}
3393 ; IS__TUNIT____: [[META18:![0-9]+]] = distinct !{!18, !16}
3394 ; IS__TUNIT____: [[META19:![0-9]+]] = !{!5, !5, i64 0}
3395 ; IS__TUNIT____: [[META20:![0-9]+]] = distinct !{!20, !16}
3396 ; IS__TUNIT____: [[META21:![0-9]+]] = distinct !{!21, !16}
3397 ; IS__TUNIT____: [[META22:![0-9]+]] = distinct !{!22, !16}
3398 ; IS__TUNIT____: [[META23:![0-9]+]] = distinct !{!23, !16}
3399 ; IS__TUNIT____: [[META24:![0-9]+]] = distinct !{!24, !16}
3400 ; IS__TUNIT____: [[META25:![0-9]+]] = distinct !{!25, !16}
3401 ; IS__TUNIT____: [[META26:![0-9]+]] = !{!9, !9, i64 0}
3402 ; IS__TUNIT____: [[META27:![0-9]+]] = distinct !{!27, !16}
3403 ; IS__TUNIT____: [[META28:![0-9]+]] = !{!29, !29, i64 0}
3404 ; IS__TUNIT____: [[META29:![0-9]+]] = !{!"long long", !5, i64 0}
3405 ; IS__TUNIT____: [[META30:![0-9]+]] = distinct !{!30, !16}
3406 ; IS__TUNIT____: [[META31:![0-9]+]] = distinct !{!31, !16}
3408 ; IS__CGSCC____: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
3409 ; IS__CGSCC____: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1}
3410 ; IS__CGSCC____: [[META2:![0-9]+]] = !{!"clang version 13.0.0"}
3411 ; IS__CGSCC____: [[TBAA3]] = !{!4, !4, i64 0}
3412 ; IS__CGSCC____: [[META4:![0-9]+]] = !{!"int", !5, i64 0}
3413 ; IS__CGSCC____: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0}
3414 ; IS__CGSCC____: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"}
3415 ; IS__CGSCC____: [[META7:![0-9]+]] = !{!8, !9, i64 12}
3416 ; IS__CGSCC____: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20}
3417 ; IS__CGSCC____: [[META9:![0-9]+]] = !{!"float", !5, i64 0}
3418 ; IS__CGSCC____: [[META10:![0-9]+]] = !{!8, !9, i64 16}
3419 ; IS__CGSCC____: [[META11:![0-9]+]] = !{!8, !9, i64 20}
3420 ; IS__CGSCC____: [[META12:![0-9]+]] = !{!8, !4, i64 0}
3421 ; IS__CGSCC____: [[META13:![0-9]+]] = !{!8, !4, i64 4}
3422 ; IS__CGSCC____: [[META14:![0-9]+]] = !{!8, !4, i64 8}
3423 ; IS__CGSCC____: [[META15:![0-9]+]] = !{!5, !5, i64 0}
3424 ; IS__CGSCC____: [[META16:![0-9]+]] = distinct !{!16, !17}
3425 ; IS__CGSCC____: [[META17:![0-9]+]] = !{!"llvm.loop.mustprogress"}
3426 ; IS__CGSCC____: [[META18:![0-9]+]] = !{!9, !9, i64 0}
3427 ; IS__CGSCC____: [[META19:![0-9]+]] = distinct !{!19, !17}
3428 ; IS__CGSCC____: [[META20:![0-9]+]] = !{!21, !21, i64 0}
3429 ; IS__CGSCC____: [[META21:![0-9]+]] = !{!"long long", !5, i64 0}
3430 ; IS__CGSCC____: [[META22:![0-9]+]] = distinct !{!22, !17}
3431 ; IS__CGSCC____: [[META23:![0-9]+]] = distinct !{!23, !17}
3432 ; IS__CGSCC____: [[META24:![0-9]+]] = distinct !{!24, !17}
3433 ; IS__CGSCC____: [[META25:![0-9]+]] = distinct !{!25, !17}
3434 ; IS__CGSCC____: [[META26:![0-9]+]] = distinct !{!26, !17}
3435 ; IS__CGSCC____: [[META27:![0-9]+]] = distinct !{!27, !17}
3436 ; IS__CGSCC____: [[META28:![0-9]+]] = distinct !{!28, !17}
3437 ; IS__CGSCC____: [[META29:![0-9]+]] = distinct !{!29, !17}
3438 ; IS__CGSCC____: [[META30:![0-9]+]] = distinct !{!30, !17}
3439 ; IS__CGSCC____: [[META31:![0-9]+]] = distinct !{!31, !17}