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=50 -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=50 -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
6;
7%struct.S = type { i32, i32, i32, float, float, float }
8
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
31@rec_storage = internal global i32 undef
32
33;.
34; CHECK: @[[GLOBALBYTES:[a-zA-Z0-9_$"\\.-]+]] = global [1024 x i8] zeroinitializer, align 16
35; CHECK: @[[GINT1:[a-zA-Z0-9_$"\\.-]+]] = global i32 0, align 4
36; CHECK: @[[GINT2:[a-zA-Z0-9_$"\\.-]+]] = global i32 0, align 4
37; CHECK: @[[GSTATIC_INT1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0, align 4
38; CHECK: @[[GSTATIC_INT2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0, align 4
39; CHECK: @[[GSTATIC_INT3:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0, align 4
40; CHECK: @[[GSTATIC_UNDEF_INT1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
41; CHECK: @[[GSTATIC_UNDEF_INT2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
42; CHECK: @[[GI1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
43; CHECK: @[[GI2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
44; CHECK: @[[GS1:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_S:%.*]] undef, align 4
45; CHECK: @[[GS2:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_S:%.*]] zeroinitializer, align 4
46; CHECK: @[[GBYTES:[a-zA-Z0-9_$"\\.-]+]] = internal global [1024 x i8] zeroinitializer, align 16
47; CHECK: @[[FLAG0:[a-zA-Z0-9_$"\\.-]+]] = global i32 0, align 4
48; CHECK: @[[FLAG1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
49; CHECK: @[[FLAG2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4
50; CHECK: @[[FLAG3:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0, align 4
51; CHECK: @[[A1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0
52; CHECK: @[[A2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0
53; CHECK: @[[A3:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef
54; CHECK: @[[BYTES1:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef
55; CHECK: @[[BYTES2:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef
56; CHECK: @[[REC_STORAGE:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef
57; CHECK: @[[GLOBAL:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_STY:%.*]] zeroinitializer, align 8
58;.
59define void @write_arg(i32* %p, i32 %v) {
60; CHECK: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
61; CHECK-LABEL: define {{[^@]+}}@write_arg
62; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] {
63; CHECK-NEXT:  entry:
64; CHECK-NEXT:    store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]]
65; CHECK-NEXT:    ret void
66;
67entry:
68  store i32 %v, i32* %p, align 4, !tbaa !3
69  ret void
70}
71
72define void @write_random(i32* %p) {
73; CHECK-LABEL: define {{[^@]+}}@write_random
74; CHECK-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) {
75; CHECK-NEXT:  entry:
76; CHECK-NEXT:    [[CALL:%.*]] = call i32 (...) @random()
77; CHECK-NEXT:    store i32 [[CALL]], i32* [[P]], align 4, !tbaa [[TBAA3]]
78; CHECK-NEXT:    ret void
79;
80entry:
81  %call = call i32 (...) @random()
82  store i32 %call, i32* %p, align 4, !tbaa !3
83  ret void
84}
85
86declare i32 @random(...)
87
88;    struct S local_alloca_simplifiable_1(void) {
89;      struct S s;
90;      s.f1 = 1.1;
91;      s.f2 = 2.2;
92;      s.f3 = 3.3;
93;      write_arg(&s.i1, 1);
94;      write_arg(&s.i2, 2);
95;      write_arg(&s.i3, 3);
96;      struct S r;
97;      r.f1 = s.f1;
98;      r.f2 = s.f2 * 2;
99;      r.f3 = s.f3 + s.f1;
100;      r.i1 = s.i1;
101;      r.i2 = s.i2 * 2;
102;      r.i3 = s.i3 + s.i1;
103;      return r;
104;    }
105define void @local_alloca_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result) {
106; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn
107; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1
108; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
109; IS__TUNIT_OPM-NEXT:  entry:
110; IS__TUNIT_OPM-NEXT:    [[S:%.*]] = alloca [[STRUCT_S]], align 4
111; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = bitcast %struct.S* [[S]] to i8*
112; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR14:[0-9]+]]
113; IS__TUNIT_OPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
114; IS__TUNIT_OPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
115; IS__TUNIT_OPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
116; IS__TUNIT_OPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
117; IS__TUNIT_OPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR15:[0-9]+]]
118; IS__TUNIT_OPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
119; IS__TUNIT_OPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR15]]
120; IS__TUNIT_OPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
121; IS__TUNIT_OPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR15]]
122; IS__TUNIT_OPM-NEXT:    [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
123; IS__TUNIT_OPM-NEXT:    store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]]
124; IS__TUNIT_OPM-NEXT:    [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
125; IS__TUNIT_OPM-NEXT:    [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
126; IS__TUNIT_OPM-NEXT:    store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]]
127; IS__TUNIT_OPM-NEXT:    [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
128; IS__TUNIT_OPM-NEXT:    [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
129; IS__TUNIT_OPM-NEXT:    store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]]
130; IS__TUNIT_OPM-NEXT:    [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
131; IS__TUNIT_OPM-NEXT:    store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]]
132; IS__TUNIT_OPM-NEXT:    [[MUL11:%.*]] = shl nsw i32 2, 1
133; IS__TUNIT_OPM-NEXT:    [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
134; IS__TUNIT_OPM-NEXT:    store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]]
135; IS__TUNIT_OPM-NEXT:    [[ADD15:%.*]] = add nsw i32 3, 1
136; IS__TUNIT_OPM-NEXT:    [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
137; IS__TUNIT_OPM-NEXT:    store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]]
138; IS__TUNIT_OPM-NEXT:    [[I12:%.*]] = bitcast %struct.S* [[S]] to i8*
139; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR14]]
140; IS__TUNIT_OPM-NEXT:    ret void
141;
142; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn
143; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1
144; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
145; IS__TUNIT_NPM-NEXT:  entry:
146; IS__TUNIT_NPM-NEXT:    [[S:%.*]] = alloca [[STRUCT_S]], align 4
147; IS__TUNIT_NPM-NEXT:    [[I:%.*]] = bitcast %struct.S* [[S]] to i8*
148; IS__TUNIT_NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR11:[0-9]+]]
149; IS__TUNIT_NPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
150; IS__TUNIT_NPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
151; IS__TUNIT_NPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
152; IS__TUNIT_NPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
153; IS__TUNIT_NPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12:[0-9]+]]
154; IS__TUNIT_NPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
155; IS__TUNIT_NPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]]
156; IS__TUNIT_NPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
157; IS__TUNIT_NPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]]
158; IS__TUNIT_NPM-NEXT:    [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
159; IS__TUNIT_NPM-NEXT:    store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]]
160; IS__TUNIT_NPM-NEXT:    [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
161; IS__TUNIT_NPM-NEXT:    [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
162; IS__TUNIT_NPM-NEXT:    store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]]
163; IS__TUNIT_NPM-NEXT:    [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
164; IS__TUNIT_NPM-NEXT:    [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
165; IS__TUNIT_NPM-NEXT:    store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]]
166; IS__TUNIT_NPM-NEXT:    [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
167; IS__TUNIT_NPM-NEXT:    store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]]
168; IS__TUNIT_NPM-NEXT:    [[MUL11:%.*]] = shl nsw i32 2, 1
169; IS__TUNIT_NPM-NEXT:    [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
170; IS__TUNIT_NPM-NEXT:    store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]]
171; IS__TUNIT_NPM-NEXT:    [[ADD15:%.*]] = add nsw i32 3, 1
172; IS__TUNIT_NPM-NEXT:    [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
173; IS__TUNIT_NPM-NEXT:    store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]]
174; IS__TUNIT_NPM-NEXT:    [[I12:%.*]] = bitcast %struct.S* [[S]] to i8*
175; IS__TUNIT_NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR11]]
176; IS__TUNIT_NPM-NEXT:    ret void
177;
178; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn
179; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1
180; IS__CGSCC_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
181; IS__CGSCC_OPM-NEXT:  entry:
182; IS__CGSCC_OPM-NEXT:    [[S:%.*]] = alloca [[STRUCT_S]], align 4
183; IS__CGSCC_OPM-NEXT:    [[I:%.*]] = bitcast %struct.S* [[S]] to i8*
184; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR13:[0-9]+]]
185; IS__CGSCC_OPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
186; IS__CGSCC_OPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
187; IS__CGSCC_OPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
188; IS__CGSCC_OPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
189; IS__CGSCC_OPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR14:[0-9]+]]
190; IS__CGSCC_OPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
191; IS__CGSCC_OPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR14]]
192; IS__CGSCC_OPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
193; IS__CGSCC_OPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR14]]
194; IS__CGSCC_OPM-NEXT:    [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
195; IS__CGSCC_OPM-NEXT:    store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]]
196; IS__CGSCC_OPM-NEXT:    [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
197; IS__CGSCC_OPM-NEXT:    [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
198; IS__CGSCC_OPM-NEXT:    store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]]
199; IS__CGSCC_OPM-NEXT:    [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
200; IS__CGSCC_OPM-NEXT:    [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
201; IS__CGSCC_OPM-NEXT:    store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]]
202; IS__CGSCC_OPM-NEXT:    [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
203; IS__CGSCC_OPM-NEXT:    store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]]
204; IS__CGSCC_OPM-NEXT:    [[MUL11:%.*]] = shl nsw i32 2, 1
205; IS__CGSCC_OPM-NEXT:    [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
206; IS__CGSCC_OPM-NEXT:    store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]]
207; IS__CGSCC_OPM-NEXT:    [[ADD15:%.*]] = add nsw i32 3, 1
208; IS__CGSCC_OPM-NEXT:    [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
209; IS__CGSCC_OPM-NEXT:    store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]]
210; IS__CGSCC_OPM-NEXT:    [[I12:%.*]] = bitcast %struct.S* [[S]] to i8*
211; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR13]]
212; IS__CGSCC_OPM-NEXT:    ret void
213;
214; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn
215; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1
216; IS__CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
217; IS__CGSCC_NPM-NEXT:  entry:
218; IS__CGSCC_NPM-NEXT:    [[S:%.*]] = alloca [[STRUCT_S]], align 4
219; IS__CGSCC_NPM-NEXT:    [[I:%.*]] = bitcast %struct.S* [[S]] to i8*
220; IS__CGSCC_NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR11:[0-9]+]]
221; IS__CGSCC_NPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
222; IS__CGSCC_NPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
223; IS__CGSCC_NPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
224; IS__CGSCC_NPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
225; IS__CGSCC_NPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12:[0-9]+]]
226; IS__CGSCC_NPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
227; IS__CGSCC_NPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]]
228; IS__CGSCC_NPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
229; IS__CGSCC_NPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]]
230; IS__CGSCC_NPM-NEXT:    [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
231; IS__CGSCC_NPM-NEXT:    store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]]
232; IS__CGSCC_NPM-NEXT:    [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
233; IS__CGSCC_NPM-NEXT:    [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
234; IS__CGSCC_NPM-NEXT:    store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]]
235; IS__CGSCC_NPM-NEXT:    [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
236; IS__CGSCC_NPM-NEXT:    [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
237; IS__CGSCC_NPM-NEXT:    store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]]
238; IS__CGSCC_NPM-NEXT:    [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
239; IS__CGSCC_NPM-NEXT:    store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]]
240; IS__CGSCC_NPM-NEXT:    [[MUL11:%.*]] = shl nsw i32 2, 1
241; IS__CGSCC_NPM-NEXT:    [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
242; IS__CGSCC_NPM-NEXT:    store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]]
243; IS__CGSCC_NPM-NEXT:    [[ADD15:%.*]] = add nsw i32 3, 1
244; IS__CGSCC_NPM-NEXT:    [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
245; IS__CGSCC_NPM-NEXT:    store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]]
246; IS__CGSCC_NPM-NEXT:    [[I12:%.*]] = bitcast %struct.S* [[S]] to i8*
247; IS__CGSCC_NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR11]]
248; IS__CGSCC_NPM-NEXT:    ret void
249;
250entry:
251  %s = alloca %struct.S, align 4
252  %i = bitcast %struct.S* %s to i8*
253  call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %i)
254  %f1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
255  store float 0x3FF19999A0000000, float* %f1, align 4, !tbaa !7
256  %f2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
257  store float 0x40019999A0000000, float* %f2, align 4, !tbaa !10
258  %f3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
259  store float 0x400A666660000000, float* %f3, align 4, !tbaa !11
260  %i1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
261  call void @write_arg(i32* nonnull %i1, i32 1)
262  %i2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
263  call void @write_arg(i32* nonnull %i2, i32 2)
264  %i3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
265  call void @write_arg(i32* nonnull %i3, i32 3)
266  %f11 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
267  %i4 = load float, float* %f11, align 4, !tbaa !7
268  %f12 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 3
269  store float %i4, float* %f12, align 4, !tbaa !7
270  %f23 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
271  %i5 = load float, float* %f23, align 4, !tbaa !10
272  %mul = fmul float %i5, 2.000000e+00
273  %f24 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 4
274  store float %mul, float* %f24, align 4, !tbaa !10
275  %f35 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
276  %i6 = load float, float* %f35, align 4, !tbaa !11
277  %f16 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
278  %i7 = load float, float* %f16, align 4, !tbaa !7
279  %add = fadd float %i6, %i7
280  %f37 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 5
281  store float %add, float* %f37, align 4, !tbaa !11
282  %i18 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
283  %i8 = load i32, i32* %i18, align 4, !tbaa !12
284  %i19 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 0
285  store i32 %i8, i32* %i19, align 4, !tbaa !12
286  %i210 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
287  %i9 = load i32, i32* %i210, align 4, !tbaa !13
288  %mul11 = shl nsw i32 %i9, 1
289  %i212 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 1
290  store i32 %mul11, i32* %i212, align 4, !tbaa !13
291  %i313 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
292  %i10 = load i32, i32* %i313, align 4, !tbaa !14
293  %i114 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
294  %i11 = load i32, i32* %i114, align 4, !tbaa !12
295  %add15 = add nsw i32 %i10, %i11
296  %i316 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 2
297  store i32 %add15, i32* %i316, align 4, !tbaa !14
298  %i12 = bitcast %struct.S* %s to i8*
299  call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %i12)
300  ret void
301}
302
303declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
304
305declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
306
307;    void local_alloca_simplifiable_2(void) {
308;      char Bytes[1024];
309;      for (int i = 0; i < 100; ++i)
310;        Bytes[i * 10] = 0;
311;      for (int i = 0; i < 10; ++i)
312;        ((float *)Bytes)[i * 10 + 1] = 0;
313;      for (int i = 0; i < 20; ++i)
314;        ((long long int *)Bytes)[i * 10 + 2] = 0;
315;      Bytes[1023] = 0;
316;      write_arg((int *)&Bytes[500], 0);
317;      struct S R;
318;      for (int i = 0; i < 1024; ++i)
319;        globalBytes[i] = Bytes[i];
320;    }
321;
322define void @local_alloca_simplifiable_2() {
323; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind
324; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2
325; IS__TUNIT_OPM-SAME: () #[[ATTR2:[0-9]+]] {
326; IS__TUNIT_OPM-NEXT:  entry:
327; IS__TUNIT_OPM-NEXT:    [[BYTES:%.*]] = alloca [1024 x i8], align 16
328; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
329; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]])
330; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND:%.*]]
331; IS__TUNIT_OPM:       for.cond:
332; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
333; IS__TUNIT_OPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
334; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
335; IS__TUNIT_OPM:       for.cond.cleanup:
336; IS__TUNIT_OPM-NEXT:    br label [[FOR_END:%.*]]
337; IS__TUNIT_OPM:       for.body:
338; IS__TUNIT_OPM-NEXT:    [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
339; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]]
340; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC]]
341; IS__TUNIT_OPM:       for.inc:
342; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
343; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]]
344; IS__TUNIT_OPM:       for.end:
345; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND2:%.*]]
346; IS__TUNIT_OPM:       for.cond2:
347; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
348; IS__TUNIT_OPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
349; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
350; IS__TUNIT_OPM:       for.cond.cleanup4:
351; IS__TUNIT_OPM-NEXT:    br label [[FOR_END11:%.*]]
352; IS__TUNIT_OPM:       for.body5:
353; IS__TUNIT_OPM-NEXT:    [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float*
354; IS__TUNIT_OPM-NEXT:    [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
355; IS__TUNIT_OPM-NEXT:    [[I18:%.*]] = or i64 [[I17]], 1
356; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]]
357; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC9]]
358; IS__TUNIT_OPM:       for.inc9:
359; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
360; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP17:![0-9]+]]
361; IS__TUNIT_OPM:       for.end11:
362; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND13:%.*]]
363; IS__TUNIT_OPM:       for.cond13:
364; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ]
365; IS__TUNIT_OPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
366; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
367; IS__TUNIT_OPM:       for.cond.cleanup15:
368; IS__TUNIT_OPM-NEXT:    br label [[FOR_END24:%.*]]
369; IS__TUNIT_OPM:       for.body16:
370; IS__TUNIT_OPM-NEXT:    [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64*
371; IS__TUNIT_OPM-NEXT:    [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
372; IS__TUNIT_OPM-NEXT:    [[I21:%.*]] = add nuw nsw i64 [[I20]], 2
373; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]]
374; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC22]]
375; IS__TUNIT_OPM:       for.inc22:
376; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
377; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP18:![0-9]+]]
378; IS__TUNIT_OPM:       for.end24:
379; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023
380; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500
381; IS__TUNIT_OPM-NEXT:    [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32*
382; IS__TUNIT_OPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR16:[0-9]+]]
383; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND28:%.*]]
384; IS__TUNIT_OPM:       for.cond28:
385; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ]
386; IS__TUNIT_OPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
387; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]]
388; IS__TUNIT_OPM:       for.cond.cleanup30:
389; IS__TUNIT_OPM-NEXT:    br label [[FOR_END38:%.*]]
390; IS__TUNIT_OPM:       for.body31:
391; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
392; IS__TUNIT_OPM-NEXT:    store i8 0, i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]]
393; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC36]]
394; IS__TUNIT_OPM:       for.inc36:
395; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
396; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]]
397; IS__TUNIT_OPM:       for.end38:
398; IS__TUNIT_OPM-NEXT:    [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
399; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]])
400; IS__TUNIT_OPM-NEXT:    ret void
401;
402; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
403; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2
404; IS__TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] {
405; IS__TUNIT_NPM-NEXT:  entry:
406; IS__TUNIT_NPM-NEXT:    [[BYTES:%.*]] = alloca [1024 x i8], align 16
407; IS__TUNIT_NPM-NEXT:    [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
408; IS__TUNIT_NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR11]]
409; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND:%.*]]
410; IS__TUNIT_NPM:       for.cond:
411; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
412; IS__TUNIT_NPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
413; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
414; IS__TUNIT_NPM:       for.cond.cleanup:
415; IS__TUNIT_NPM-NEXT:    br label [[FOR_END:%.*]]
416; IS__TUNIT_NPM:       for.body:
417; IS__TUNIT_NPM-NEXT:    [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
418; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]]
419; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC]]
420; IS__TUNIT_NPM:       for.inc:
421; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
422; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]]
423; IS__TUNIT_NPM:       for.end:
424; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND2:%.*]]
425; IS__TUNIT_NPM:       for.cond2:
426; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
427; IS__TUNIT_NPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
428; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
429; IS__TUNIT_NPM:       for.cond.cleanup4:
430; IS__TUNIT_NPM-NEXT:    br label [[FOR_END11:%.*]]
431; IS__TUNIT_NPM:       for.body5:
432; IS__TUNIT_NPM-NEXT:    [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float*
433; IS__TUNIT_NPM-NEXT:    [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
434; IS__TUNIT_NPM-NEXT:    [[I18:%.*]] = or i64 [[I17]], 1
435; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]]
436; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC9]]
437; IS__TUNIT_NPM:       for.inc9:
438; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
439; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP17:![0-9]+]]
440; IS__TUNIT_NPM:       for.end11:
441; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND13:%.*]]
442; IS__TUNIT_NPM:       for.cond13:
443; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ]
444; IS__TUNIT_NPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
445; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
446; IS__TUNIT_NPM:       for.cond.cleanup15:
447; IS__TUNIT_NPM-NEXT:    br label [[FOR_END24:%.*]]
448; IS__TUNIT_NPM:       for.body16:
449; IS__TUNIT_NPM-NEXT:    [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64*
450; IS__TUNIT_NPM-NEXT:    [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
451; IS__TUNIT_NPM-NEXT:    [[I21:%.*]] = add nuw nsw i64 [[I20]], 2
452; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]]
453; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC22]]
454; IS__TUNIT_NPM:       for.inc22:
455; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
456; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP18:![0-9]+]]
457; IS__TUNIT_NPM:       for.end24:
458; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023
459; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500
460; IS__TUNIT_NPM-NEXT:    [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32*
461; IS__TUNIT_NPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR12]]
462; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND28:%.*]]
463; IS__TUNIT_NPM:       for.cond28:
464; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ]
465; IS__TUNIT_NPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
466; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]]
467; IS__TUNIT_NPM:       for.cond.cleanup30:
468; IS__TUNIT_NPM-NEXT:    br label [[FOR_END38:%.*]]
469; IS__TUNIT_NPM:       for.body31:
470; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
471; IS__TUNIT_NPM-NEXT:    store i8 0, i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]]
472; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC36]]
473; IS__TUNIT_NPM:       for.inc36:
474; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
475; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]]
476; IS__TUNIT_NPM:       for.end38:
477; IS__TUNIT_NPM-NEXT:    [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
478; IS__TUNIT_NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) #[[ATTR11]]
479; IS__TUNIT_NPM-NEXT:    ret void
480;
481; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2() {
482; IS__CGSCC_OPM-NEXT:  entry:
483; IS__CGSCC_OPM-NEXT:    [[BYTES:%.*]] = alloca [1024 x i8], align 16
484; IS__CGSCC_OPM-NEXT:    [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
485; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]])
486; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND:%.*]]
487; IS__CGSCC_OPM:       for.cond:
488; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
489; IS__CGSCC_OPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
490; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
491; IS__CGSCC_OPM:       for.cond.cleanup:
492; IS__CGSCC_OPM-NEXT:    br label [[FOR_END:%.*]]
493; IS__CGSCC_OPM:       for.body:
494; IS__CGSCC_OPM-NEXT:    [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
495; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]]
496; IS__CGSCC_OPM-NEXT:    store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]]
497; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC]]
498; IS__CGSCC_OPM:       for.inc:
499; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
500; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
501; IS__CGSCC_OPM:       for.end:
502; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND2:%.*]]
503; IS__CGSCC_OPM:       for.cond2:
504; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
505; IS__CGSCC_OPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
506; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
507; IS__CGSCC_OPM:       for.cond.cleanup4:
508; IS__CGSCC_OPM-NEXT:    br label [[FOR_END11:%.*]]
509; IS__CGSCC_OPM:       for.body5:
510; IS__CGSCC_OPM-NEXT:    [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float*
511; IS__CGSCC_OPM-NEXT:    [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
512; IS__CGSCC_OPM-NEXT:    [[I18:%.*]] = or i64 [[I17]], 1
513; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]]
514; IS__CGSCC_OPM-NEXT:    store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]]
515; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC9]]
516; IS__CGSCC_OPM:       for.inc9:
517; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
518; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP19:![0-9]+]]
519; IS__CGSCC_OPM:       for.end11:
520; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND13:%.*]]
521; IS__CGSCC_OPM:       for.cond13:
522; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ]
523; IS__CGSCC_OPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
524; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
525; IS__CGSCC_OPM:       for.cond.cleanup15:
526; IS__CGSCC_OPM-NEXT:    br label [[FOR_END24:%.*]]
527; IS__CGSCC_OPM:       for.body16:
528; IS__CGSCC_OPM-NEXT:    [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64*
529; IS__CGSCC_OPM-NEXT:    [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
530; IS__CGSCC_OPM-NEXT:    [[I21:%.*]] = add nuw nsw i64 [[I20]], 2
531; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]]
532; IS__CGSCC_OPM-NEXT:    store i64 0, i64* [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]]
533; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC22]]
534; IS__CGSCC_OPM:       for.inc22:
535; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
536; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP22:![0-9]+]]
537; IS__CGSCC_OPM:       for.end24:
538; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023
539; IS__CGSCC_OPM-NEXT:    store i8 0, i8* [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]]
540; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500
541; IS__CGSCC_OPM-NEXT:    [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32*
542; IS__CGSCC_OPM-NEXT:    call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I22]], i32 noundef 0) #[[ATTR15:[0-9]+]]
543; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND28:%.*]]
544; IS__CGSCC_OPM:       for.cond28:
545; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ]
546; IS__CGSCC_OPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
547; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]]
548; IS__CGSCC_OPM:       for.cond.cleanup30:
549; IS__CGSCC_OPM-NEXT:    br label [[FOR_END38:%.*]]
550; IS__CGSCC_OPM:       for.body31:
551; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDVARS_IV12]]
552; IS__CGSCC_OPM-NEXT:    [[I23:%.*]] = load i8, i8* [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]]
553; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
554; IS__CGSCC_OPM-NEXT:    store i8 [[I23]], i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]]
555; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC36]]
556; IS__CGSCC_OPM:       for.inc36:
557; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
558; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]]
559; IS__CGSCC_OPM:       for.end38:
560; IS__CGSCC_OPM-NEXT:    [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
561; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nofree noundef nonnull [[I24]])
562; IS__CGSCC_OPM-NEXT:    ret void
563;
564; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2() {
565; IS__CGSCC_NPM-NEXT:  entry:
566; IS__CGSCC_NPM-NEXT:    [[BYTES:%.*]] = alloca [1024 x i8], align 16
567; IS__CGSCC_NPM-NEXT:    [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
568; IS__CGSCC_NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR11]]
569; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND:%.*]]
570; IS__CGSCC_NPM:       for.cond:
571; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
572; IS__CGSCC_NPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
573; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
574; IS__CGSCC_NPM:       for.cond.cleanup:
575; IS__CGSCC_NPM-NEXT:    br label [[FOR_END:%.*]]
576; IS__CGSCC_NPM:       for.body:
577; IS__CGSCC_NPM-NEXT:    [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
578; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]]
579; IS__CGSCC_NPM-NEXT:    store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]]
580; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC]]
581; IS__CGSCC_NPM:       for.inc:
582; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
583; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
584; IS__CGSCC_NPM:       for.end:
585; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND2:%.*]]
586; IS__CGSCC_NPM:       for.cond2:
587; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
588; IS__CGSCC_NPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
589; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
590; IS__CGSCC_NPM:       for.cond.cleanup4:
591; IS__CGSCC_NPM-NEXT:    br label [[FOR_END11:%.*]]
592; IS__CGSCC_NPM:       for.body5:
593; IS__CGSCC_NPM-NEXT:    [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float*
594; IS__CGSCC_NPM-NEXT:    [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
595; IS__CGSCC_NPM-NEXT:    [[I18:%.*]] = or i64 [[I17]], 1
596; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]]
597; IS__CGSCC_NPM-NEXT:    store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]]
598; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC9]]
599; IS__CGSCC_NPM:       for.inc9:
600; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
601; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP19:![0-9]+]]
602; IS__CGSCC_NPM:       for.end11:
603; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND13:%.*]]
604; IS__CGSCC_NPM:       for.cond13:
605; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC22:%.*]] ], [ 0, [[FOR_END11]] ]
606; IS__CGSCC_NPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
607; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
608; IS__CGSCC_NPM:       for.cond.cleanup15:
609; IS__CGSCC_NPM-NEXT:    br label [[FOR_END24:%.*]]
610; IS__CGSCC_NPM:       for.body16:
611; IS__CGSCC_NPM-NEXT:    [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64*
612; IS__CGSCC_NPM-NEXT:    [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
613; IS__CGSCC_NPM-NEXT:    [[I21:%.*]] = add nuw nsw i64 [[I20]], 2
614; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]]
615; IS__CGSCC_NPM-NEXT:    store i64 0, i64* [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]]
616; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC22]]
617; IS__CGSCC_NPM:       for.inc22:
618; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
619; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP22:![0-9]+]]
620; IS__CGSCC_NPM:       for.end24:
621; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023
622; IS__CGSCC_NPM-NEXT:    store i8 0, i8* [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]]
623; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500
624; IS__CGSCC_NPM-NEXT:    [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32*
625; IS__CGSCC_NPM-NEXT:    call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I22]], i32 noundef 0) #[[ATTR13:[0-9]+]]
626; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND28:%.*]]
627; IS__CGSCC_NPM:       for.cond28:
628; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ]
629; IS__CGSCC_NPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
630; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY31:%.*]], label [[FOR_COND_CLEANUP30:%.*]]
631; IS__CGSCC_NPM:       for.cond.cleanup30:
632; IS__CGSCC_NPM-NEXT:    br label [[FOR_END38:%.*]]
633; IS__CGSCC_NPM:       for.body31:
634; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDVARS_IV12]]
635; IS__CGSCC_NPM-NEXT:    [[I23:%.*]] = load i8, i8* [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]]
636; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
637; IS__CGSCC_NPM-NEXT:    store i8 [[I23]], i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]]
638; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC36]]
639; IS__CGSCC_NPM:       for.inc36:
640; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
641; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]]
642; IS__CGSCC_NPM:       for.end38:
643; IS__CGSCC_NPM-NEXT:    [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
644; IS__CGSCC_NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nofree noundef nonnull [[I24]])
645; IS__CGSCC_NPM-NEXT:    ret void
646;
647entry:
648  %Bytes = alloca [1024 x i8], align 16
649  %i = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 0
650  call void @llvm.lifetime.start.p0i8(i64 1024, i8* nonnull %i)
651  br label %for.cond
652
653for.cond:                                         ; preds = %for.inc, %entry
654  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
655  %exitcond = icmp ne i64 %indvars.iv, 100
656  br i1 %exitcond, label %for.body, label %for.cond.cleanup
657
658for.cond.cleanup:                                 ; preds = %for.cond
659  br label %for.end
660
661for.body:                                         ; preds = %for.cond
662  %i15 = mul nuw nsw i64 %indvars.iv, 10
663  %arrayidx = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 %i15
664  store i8 0, i8* %arrayidx, align 2, !tbaa !15
665  br label %for.inc
666
667for.inc:                                          ; preds = %for.body
668  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
669  br label %for.cond, !llvm.loop !16
670
671for.end:                                          ; preds = %for.cond.cleanup
672  br label %for.cond2
673
674for.cond2:                                        ; preds = %for.inc9, %for.end
675  %indvars.iv2 = phi i64 [ %indvars.iv.next3, %for.inc9 ], [ 0, %for.end ]
676  %exitcond6 = icmp ne i64 %indvars.iv2, 10
677  br i1 %exitcond6, label %for.body5, label %for.cond.cleanup4
678
679for.cond.cleanup4:                                ; preds = %for.cond2
680  br label %for.end11
681
682for.body5:                                        ; preds = %for.cond2
683  %i16 = bitcast [1024 x i8]* %Bytes to float*
684  %i17 = mul nuw nsw i64 %indvars.iv2, 10
685  %i18 = or i64 %i17, 1
686  %arrayidx8 = getelementptr inbounds float, float* %i16, i64 %i18
687  store float 0.000000e+00, float* %arrayidx8, align 4, !tbaa !18
688  br label %for.inc9
689
690for.inc9:                                         ; preds = %for.body5
691  %indvars.iv.next3 = add nuw nsw i64 %indvars.iv2, 1
692  br label %for.cond2, !llvm.loop !19
693
694for.end11:                                        ; preds = %for.cond.cleanup4
695  br label %for.cond13
696
697for.cond13:                                       ; preds = %for.inc22, %for.end11
698  %indvars.iv7 = phi i64 [ %indvars.iv.next8, %for.inc22 ], [ 0, %for.end11 ]
699  %exitcond11 = icmp ne i64 %indvars.iv7, 20
700  br i1 %exitcond11, label %for.body16, label %for.cond.cleanup15
701
702for.cond.cleanup15:                               ; preds = %for.cond13
703  br label %for.end24
704
705for.body16:                                       ; preds = %for.cond13
706  %i19 = bitcast [1024 x i8]* %Bytes to i64*
707  %i20 = mul nuw nsw i64 %indvars.iv7, 10
708  %i21 = add nuw nsw i64 %i20, 2
709  %arrayidx21 = getelementptr inbounds i64, i64* %i19, i64 %i21
710  store i64 0, i64* %arrayidx21, align 16, !tbaa !20
711  br label %for.inc22
712
713for.inc22:                                        ; preds = %for.body16
714  %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7, 1
715  br label %for.cond13, !llvm.loop !22
716
717for.end24:                                        ; preds = %for.cond.cleanup15
718  %arrayidx25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 1023
719  store i8 0, i8* %arrayidx25, align 1, !tbaa !15
720  %arrayidx26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 500
721  %i22 = bitcast i8* %arrayidx26 to i32*
722  call void @write_arg(i32* nonnull %i22, i32 0)
723  br label %for.cond28
724
725for.cond28:                                       ; preds = %for.inc36, %for.end24
726  %indvars.iv12 = phi i64 [ %indvars.iv.next13, %for.inc36 ], [ 0, %for.end24 ]
727  %exitcond14 = icmp ne i64 %indvars.iv12, 1024
728  br i1 %exitcond14, label %for.body31, label %for.cond.cleanup30
729
730for.cond.cleanup30:                               ; preds = %for.cond28
731  br label %for.end38
732
733for.body31:                                       ; preds = %for.cond28
734  %arrayidx33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 %indvars.iv12
735  %i23 = load i8, i8* %arrayidx33, align 1, !tbaa !15
736  %arrayidx35 = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 %indvars.iv12
737  store i8 %i23, i8* %arrayidx35, align 1, !tbaa !15
738  br label %for.inc36
739
740for.inc36:                                        ; preds = %for.body31
741  %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12, 1
742  br label %for.cond28, !llvm.loop !23
743
744for.end38:                                        ; preds = %for.cond.cleanup30
745  %i24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 0
746  call void @llvm.lifetime.end.p0i8(i64 1024, i8* nonnull %i24)
747  ret void
748}
749
750;    int local_alloca_simplifiable_3() {
751;      int A = 1;
752;      // split
753;      A = 2;
754;      return A;
755;    }
756;
757define i32 @local_alloca_simplifiable_3() {
758; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
759; IS__TUNIT____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3
760; IS__TUNIT____-SAME: () #[[ATTR3:[0-9]+]] {
761; IS__TUNIT____-NEXT:    [[A:%.*]] = alloca i32, align 4
762; IS__TUNIT____-NEXT:    store i32 1, i32* [[A]], align 4
763; IS__TUNIT____-NEXT:    br label [[SPLIT:%.*]]
764; IS__TUNIT____:       split:
765; IS__TUNIT____-NEXT:    store i32 2, i32* [[A]], align 4
766; IS__TUNIT____-NEXT:    [[L:%.*]] = load i32, i32* [[A]], align 4
767; IS__TUNIT____-NEXT:    ret i32 [[L]]
768;
769; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
770; IS__CGSCC____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3
771; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] {
772; IS__CGSCC____-NEXT:    [[A:%.*]] = alloca i32, align 4
773; IS__CGSCC____-NEXT:    store i32 1, i32* [[A]], align 4
774; IS__CGSCC____-NEXT:    br label [[SPLIT:%.*]]
775; IS__CGSCC____:       split:
776; IS__CGSCC____-NEXT:    store i32 2, i32* [[A]], align 4
777; IS__CGSCC____-NEXT:    [[L:%.*]] = load i32, i32* [[A]], align 4
778; IS__CGSCC____-NEXT:    ret i32 [[L]]
779;
780  %A = alloca i32, align 4
781  store i32 1, i32* %A
782  br label %split
783split:
784  store i32 2, i32* %A
785  %l = load i32, i32* %A, align 4
786  ret i32 %l
787}
788;    int local_alloca_simplifiable_4() {
789;      int A;
790;      return A;
791;    }
792;
793define i32 @local_alloca_simplifiable_4() {
794; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
795; IS__TUNIT____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4
796; IS__TUNIT____-SAME: () #[[ATTR3]] {
797; IS__TUNIT____-NEXT:    ret i32 undef
798;
799; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
800; IS__CGSCC____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4
801; IS__CGSCC____-SAME: () #[[ATTR2]] {
802; IS__CGSCC____-NEXT:    ret i32 undef
803;
804  %A = alloca i32, align 4
805  %l = load i32, i32* %A, align 4
806  ret i32 %l
807}
808
809;    static int GI1 __attribute__((loader_uninitialized));
810;    int multi_obj_simplifiable_1(int cnd) {
811;      int L = GI1 = 5;
812;      int *p = cnd ? &GI1 : &L;
813;      return *p;
814;    }
815define i32 @multi_obj_simplifiable_1(i32 %cnd) {
816; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
817; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1
818; IS__TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR4:[0-9]+]] {
819; IS__TUNIT_OPM-NEXT:  entry:
820; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = alloca i32, align 4
821; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = bitcast i32* [[L]] to i8*
822; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR14]]
823; IS__TUNIT_OPM-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
824; IS__TUNIT_OPM-NEXT:    br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
825; IS__TUNIT_OPM:       cond.true:
826; IS__TUNIT_OPM-NEXT:    br label [[COND_END:%.*]]
827; IS__TUNIT_OPM:       cond.false:
828; IS__TUNIT_OPM-NEXT:    br label [[COND_END]]
829; IS__TUNIT_OPM:       cond.end:
830; IS__TUNIT_OPM-NEXT:    [[I2:%.*]] = bitcast i32* [[L]] to i8*
831; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR14]]
832; IS__TUNIT_OPM-NEXT:    ret i32 5
833;
834; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
835; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1
836; IS__TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] {
837; IS__TUNIT_NPM-NEXT:  entry:
838; IS__TUNIT_NPM-NEXT:    [[L:%.*]] = alloca i32, align 4
839; IS__TUNIT_NPM-NEXT:    [[I:%.*]] = bitcast i32* [[L]] to i8*
840; IS__TUNIT_NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]]
841; IS__TUNIT_NPM-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
842; IS__TUNIT_NPM-NEXT:    br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
843; IS__TUNIT_NPM:       cond.true:
844; IS__TUNIT_NPM-NEXT:    br label [[COND_END:%.*]]
845; IS__TUNIT_NPM:       cond.false:
846; IS__TUNIT_NPM-NEXT:    br label [[COND_END]]
847; IS__TUNIT_NPM:       cond.end:
848; IS__TUNIT_NPM-NEXT:    [[I2:%.*]] = bitcast i32* [[L]] to i8*
849; IS__TUNIT_NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR11]]
850; IS__TUNIT_NPM-NEXT:    ret i32 5
851;
852; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
853; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1
854; IS__CGSCC_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3:[0-9]+]] {
855; IS__CGSCC_OPM-NEXT:  entry:
856; IS__CGSCC_OPM-NEXT:    [[L:%.*]] = alloca i32, align 4
857; IS__CGSCC_OPM-NEXT:    [[I:%.*]] = bitcast i32* [[L]] to i8*
858; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR13]]
859; IS__CGSCC_OPM-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
860; IS__CGSCC_OPM-NEXT:    br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
861; IS__CGSCC_OPM:       cond.true:
862; IS__CGSCC_OPM-NEXT:    br label [[COND_END:%.*]]
863; IS__CGSCC_OPM:       cond.false:
864; IS__CGSCC_OPM-NEXT:    br label [[COND_END]]
865; IS__CGSCC_OPM:       cond.end:
866; IS__CGSCC_OPM-NEXT:    [[I2:%.*]] = bitcast i32* [[L]] to i8*
867; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR13]]
868; IS__CGSCC_OPM-NEXT:    ret i32 5
869;
870; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
871; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1
872; IS__CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3:[0-9]+]] {
873; IS__CGSCC_NPM-NEXT:  entry:
874; IS__CGSCC_NPM-NEXT:    [[L:%.*]] = alloca i32, align 4
875; IS__CGSCC_NPM-NEXT:    [[I:%.*]] = bitcast i32* [[L]] to i8*
876; IS__CGSCC_NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]]
877; IS__CGSCC_NPM-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
878; IS__CGSCC_NPM-NEXT:    br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
879; IS__CGSCC_NPM:       cond.true:
880; IS__CGSCC_NPM-NEXT:    br label [[COND_END:%.*]]
881; IS__CGSCC_NPM:       cond.false:
882; IS__CGSCC_NPM-NEXT:    br label [[COND_END]]
883; IS__CGSCC_NPM:       cond.end:
884; IS__CGSCC_NPM-NEXT:    [[I2:%.*]] = bitcast i32* [[L]] to i8*
885; IS__CGSCC_NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR11]]
886; IS__CGSCC_NPM-NEXT:    ret i32 5
887;
888entry:
889  %L = alloca i32, align 4
890  %i = bitcast i32* %L to i8*
891  call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i)
892  store i32 5, i32* @GI1, align 4, !tbaa !3
893  store i32 5, i32* %L, align 4, !tbaa !3
894  %tobool.not = icmp eq i32 %cnd, 0
895  br i1 %tobool.not, label %cond.false, label %cond.true
896
897cond.true:                                        ; preds = %entry
898  br label %cond.end
899
900cond.false:                                       ; preds = %entry
901  br label %cond.end
902
903cond.end:                                         ; preds = %cond.false, %cond.true
904  %cond = phi i32* [ @GI1, %cond.true ], [ %L, %cond.false ]
905  %i1 = load i32, i32* %cond, align 4, !tbaa !3
906  %i2 = bitcast i32* %L to i8*
907  call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i2)
908  ret i32 %i1
909}
910
911;    static int GI2 __attribute__((loader_uninitialized));
912;    int multi_obj_simplifiable_2(int cnd) {
913;      int L;
914;      int *p = cnd ? &GI2 : &L;
915;      *p = 5;
916;      return *p;
917;    }
918;
919define i32 @multi_obj_simplifiable_2(i32 %cnd) {
920; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
921; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2
922; IS__TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR4]] {
923; IS__TUNIT_OPM-NEXT:  entry:
924; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = alloca i32, align 4
925; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = bitcast i32* [[L]] to i8*
926; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR14]]
927; IS__TUNIT_OPM-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
928; IS__TUNIT_OPM-NEXT:    br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
929; IS__TUNIT_OPM:       cond.true:
930; IS__TUNIT_OPM-NEXT:    br label [[COND_END:%.*]]
931; IS__TUNIT_OPM:       cond.false:
932; IS__TUNIT_OPM-NEXT:    br label [[COND_END]]
933; IS__TUNIT_OPM:       cond.end:
934; IS__TUNIT_OPM-NEXT:    [[I1:%.*]] = bitcast i32* [[L]] to i8*
935; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR14]]
936; IS__TUNIT_OPM-NEXT:    ret i32 5
937;
938; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
939; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2
940; IS__TUNIT_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] {
941; IS__TUNIT_NPM-NEXT:  entry:
942; IS__TUNIT_NPM-NEXT:    [[L:%.*]] = alloca i32, align 4
943; IS__TUNIT_NPM-NEXT:    [[I:%.*]] = bitcast i32* [[L]] to i8*
944; IS__TUNIT_NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]]
945; IS__TUNIT_NPM-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
946; IS__TUNIT_NPM-NEXT:    br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
947; IS__TUNIT_NPM:       cond.true:
948; IS__TUNIT_NPM-NEXT:    br label [[COND_END:%.*]]
949; IS__TUNIT_NPM:       cond.false:
950; IS__TUNIT_NPM-NEXT:    br label [[COND_END]]
951; IS__TUNIT_NPM:       cond.end:
952; IS__TUNIT_NPM-NEXT:    [[I1:%.*]] = bitcast i32* [[L]] to i8*
953; IS__TUNIT_NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]]
954; IS__TUNIT_NPM-NEXT:    ret i32 5
955;
956; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
957; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2
958; IS__CGSCC_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] {
959; IS__CGSCC_OPM-NEXT:  entry:
960; IS__CGSCC_OPM-NEXT:    [[L:%.*]] = alloca i32, align 4
961; IS__CGSCC_OPM-NEXT:    [[I:%.*]] = bitcast i32* [[L]] to i8*
962; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR13]]
963; IS__CGSCC_OPM-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
964; IS__CGSCC_OPM-NEXT:    br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
965; IS__CGSCC_OPM:       cond.true:
966; IS__CGSCC_OPM-NEXT:    br label [[COND_END:%.*]]
967; IS__CGSCC_OPM:       cond.false:
968; IS__CGSCC_OPM-NEXT:    br label [[COND_END]]
969; IS__CGSCC_OPM:       cond.end:
970; IS__CGSCC_OPM-NEXT:    [[I1:%.*]] = bitcast i32* [[L]] to i8*
971; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR13]]
972; IS__CGSCC_OPM-NEXT:    ret i32 5
973;
974; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
975; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2
976; IS__CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] {
977; IS__CGSCC_NPM-NEXT:  entry:
978; IS__CGSCC_NPM-NEXT:    [[L:%.*]] = alloca i32, align 4
979; IS__CGSCC_NPM-NEXT:    [[I:%.*]] = bitcast i32* [[L]] to i8*
980; IS__CGSCC_NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]]
981; IS__CGSCC_NPM-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
982; IS__CGSCC_NPM-NEXT:    br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
983; IS__CGSCC_NPM:       cond.true:
984; IS__CGSCC_NPM-NEXT:    br label [[COND_END:%.*]]
985; IS__CGSCC_NPM:       cond.false:
986; IS__CGSCC_NPM-NEXT:    br label [[COND_END]]
987; IS__CGSCC_NPM:       cond.end:
988; IS__CGSCC_NPM-NEXT:    [[I1:%.*]] = bitcast i32* [[L]] to i8*
989; IS__CGSCC_NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]]
990; IS__CGSCC_NPM-NEXT:    ret i32 5
991;
992entry:
993  %L = alloca i32, align 4
994  %i = bitcast i32* %L to i8*
995  call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i)
996  %tobool.not = icmp eq i32 %cnd, 0
997  br i1 %tobool.not, label %cond.false, label %cond.true
998
999cond.true:                                        ; preds = %entry
1000  br label %cond.end
1001
1002cond.false:                                       ; preds = %entry
1003  br label %cond.end
1004
1005cond.end:                                         ; preds = %cond.false, %cond.true
1006  %cond = phi i32* [ @GI2, %cond.true ], [ %L, %cond.false ]
1007  store i32 5, i32* %cond, align 4, !tbaa !3
1008  %i1 = bitcast i32* %L to i8*
1009  %l = load i32, i32* %cond, align 4, !tbaa !3
1010  call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i1)
1011  ret i32 %l
1012}
1013
1014;    static struct S Gs __attribute__((loader_uninitialized));
1015;    struct S static_global_simplifiable_1(void) {
1016;      Gs.f1 = 1.1;
1017;      Gs.f2 = 2.2;
1018;      Gs.f3 = 3.3;
1019;      write_arg(&Gs.i1, 1);
1020;      write_arg(&Gs.i2, 2);
1021;      write_arg(&Gs.i3, 3);
1022;      struct S r;
1023;      r.f1 = Gs.f1;
1024;      r.f2 = Gs.f2 * 2;
1025;      r.f3 = Gs.f3 + Gs.f1;
1026;      r.i1 = Gs.i1;
1027;      r.i2 = Gs.i2 * 2;
1028;      r.i3 = Gs.i3 + Gs.i1;
1029;      return r;
1030;    }
1031;
1032define void @static_global_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result) {
1033; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1034; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1
1035; IS__TUNIT_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR5:[0-9]+]] {
1036; IS__TUNIT_OPM-NEXT:  entry:
1037; 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) #[[ATTR15]]
1038; 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) #[[ATTR15]]
1039; 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) #[[ATTR15]]
1040; IS__TUNIT_OPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1041; IS__TUNIT_OPM-NEXT:    store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1042; IS__TUNIT_OPM-NEXT:    [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
1043; IS__TUNIT_OPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1044; IS__TUNIT_OPM-NEXT:    store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]]
1045; IS__TUNIT_OPM-NEXT:    [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
1046; IS__TUNIT_OPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1047; IS__TUNIT_OPM-NEXT:    store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]]
1048; IS__TUNIT_OPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1049; IS__TUNIT_OPM-NEXT:    store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]]
1050; IS__TUNIT_OPM-NEXT:    [[MUL1:%.*]] = shl nsw i32 2, 1
1051; IS__TUNIT_OPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1052; IS__TUNIT_OPM-NEXT:    store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]]
1053; IS__TUNIT_OPM-NEXT:    [[ADD2:%.*]] = add nsw i32 3, 1
1054; IS__TUNIT_OPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1055; IS__TUNIT_OPM-NEXT:    store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]]
1056; IS__TUNIT_OPM-NEXT:    ret void
1057;
1058; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1059; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1
1060; IS__TUNIT_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] {
1061; IS__TUNIT_NPM-NEXT:  entry:
1062; 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) #[[ATTR12]]
1063; 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) #[[ATTR12]]
1064; 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) #[[ATTR12]]
1065; IS__TUNIT_NPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1066; IS__TUNIT_NPM-NEXT:    store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1067; IS__TUNIT_NPM-NEXT:    [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
1068; IS__TUNIT_NPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1069; IS__TUNIT_NPM-NEXT:    store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]]
1070; IS__TUNIT_NPM-NEXT:    [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
1071; IS__TUNIT_NPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1072; IS__TUNIT_NPM-NEXT:    store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]]
1073; IS__TUNIT_NPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1074; IS__TUNIT_NPM-NEXT:    store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]]
1075; IS__TUNIT_NPM-NEXT:    [[MUL1:%.*]] = shl nsw i32 2, 1
1076; IS__TUNIT_NPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1077; IS__TUNIT_NPM-NEXT:    store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]]
1078; IS__TUNIT_NPM-NEXT:    [[ADD2:%.*]] = add nsw i32 3, 1
1079; IS__TUNIT_NPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1080; IS__TUNIT_NPM-NEXT:    store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]]
1081; IS__TUNIT_NPM-NEXT:    ret void
1082;
1083; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1084; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1
1085; IS__CGSCC_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] {
1086; IS__CGSCC_OPM-NEXT:  entry:
1087; 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) #[[ATTR14]]
1088; 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) #[[ATTR14]]
1089; 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) #[[ATTR14]]
1090; IS__CGSCC_OPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1091; IS__CGSCC_OPM-NEXT:    store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1092; IS__CGSCC_OPM-NEXT:    [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
1093; IS__CGSCC_OPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1094; IS__CGSCC_OPM-NEXT:    store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]]
1095; IS__CGSCC_OPM-NEXT:    [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
1096; IS__CGSCC_OPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1097; IS__CGSCC_OPM-NEXT:    store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]]
1098; IS__CGSCC_OPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1099; IS__CGSCC_OPM-NEXT:    store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]]
1100; IS__CGSCC_OPM-NEXT:    [[MUL1:%.*]] = shl nsw i32 2, 1
1101; IS__CGSCC_OPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1102; IS__CGSCC_OPM-NEXT:    store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]]
1103; IS__CGSCC_OPM-NEXT:    [[ADD2:%.*]] = add nsw i32 3, 1
1104; IS__CGSCC_OPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1105; IS__CGSCC_OPM-NEXT:    store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]]
1106; IS__CGSCC_OPM-NEXT:    ret void
1107;
1108; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1109; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1
1110; IS__CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] {
1111; IS__CGSCC_NPM-NEXT:  entry:
1112; 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) #[[ATTR12]]
1113; 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) #[[ATTR12]]
1114; 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) #[[ATTR12]]
1115; IS__CGSCC_NPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1116; IS__CGSCC_NPM-NEXT:    store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1117; IS__CGSCC_NPM-NEXT:    [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00
1118; IS__CGSCC_NPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1119; IS__CGSCC_NPM-NEXT:    store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]]
1120; IS__CGSCC_NPM-NEXT:    [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000
1121; IS__CGSCC_NPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1122; IS__CGSCC_NPM-NEXT:    store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]]
1123; IS__CGSCC_NPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1124; IS__CGSCC_NPM-NEXT:    store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]]
1125; IS__CGSCC_NPM-NEXT:    [[MUL1:%.*]] = shl nsw i32 2, 1
1126; IS__CGSCC_NPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1127; IS__CGSCC_NPM-NEXT:    store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]]
1128; IS__CGSCC_NPM-NEXT:    [[ADD2:%.*]] = add nsw i32 3, 1
1129; IS__CGSCC_NPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1130; IS__CGSCC_NPM-NEXT:    store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]]
1131; IS__CGSCC_NPM-NEXT:    ret void
1132;
1133entry:
1134  store float 0x3FF19999A0000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7
1135  store float 0x40019999A0000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 4), align 4, !tbaa !10
1136  store float 0x400A666660000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 5), align 4, !tbaa !11
1137  call void @write_arg(i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 0), i32 1)
1138  call void @write_arg(i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 1), i32 2)
1139  call void @write_arg(i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 2), i32 3)
1140  %i = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7
1141  %f1 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 3
1142  store float %i, float* %f1, align 4, !tbaa !7
1143  %i4 = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 4), align 4, !tbaa !10
1144  %mul = fmul float %i4, 2.000000e+00
1145  %f2 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 4
1146  store float %mul, float* %f2, align 4, !tbaa !10
1147  %i5 = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 5), align 4, !tbaa !11
1148  %i6 = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7
1149  %add = fadd float %i5, %i6
1150  %f3 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 5
1151  store float %add, float* %f3, align 4, !tbaa !11
1152  %i7 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 0), align 4, !tbaa !12
1153  %i1 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 0
1154  store i32 %i7, i32* %i1, align 4, !tbaa !12
1155  %i8 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 1), align 4, !tbaa !13
1156  %mul1 = shl nsw i32 %i8, 1
1157  %i2 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 1
1158  store i32 %mul1, i32* %i2, align 4, !tbaa !13
1159  %i9 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 2), align 4, !tbaa !14
1160  %i10 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 0), align 4, !tbaa !12
1161  %add2 = add nsw i32 %i9, %i10
1162  %i3 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 2
1163  store i32 %add2, i32* %i3, align 4, !tbaa !14
1164  ret void
1165}
1166
1167;    static char GBytes[1024];
1168;    void static_global_simplifiable_2(void) {
1169;      for (int i = 0; i < 100; ++i)
1170;        GBytes[i * 10] = 0;
1171;      for (int i = 0; i < 10; ++i)
1172;        ((float *)GBytes)[i * 10 + 1] = 0;
1173;      for (int i = 0; i < 20; ++i)
1174;        ((long long int *)GBytes)[i * 10 + 2] = 0;
1175;      GBytes[1023] = 0;
1176;      write_arg((int *)&GBytes[500], 0);
1177;      struct S R;
1178;      for (int i = 0; i < 1024; ++i)
1179;        globalBytes[i] = GBytes[i];
1180;    }
1181;
1182define void @static_global_simplifiable_2() {
1183; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly
1184; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2
1185; IS__TUNIT_OPM-SAME: () #[[ATTR6:[0-9]+]] {
1186; IS__TUNIT_OPM-NEXT:  entry:
1187; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND:%.*]]
1188; IS__TUNIT_OPM:       for.cond:
1189; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1190; IS__TUNIT_OPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1191; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1192; IS__TUNIT_OPM:       for.cond.cleanup:
1193; IS__TUNIT_OPM-NEXT:    br label [[FOR_END:%.*]]
1194; IS__TUNIT_OPM:       for.body:
1195; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1196; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]]
1197; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC]]
1198; IS__TUNIT_OPM:       for.inc:
1199; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1200; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
1201; IS__TUNIT_OPM:       for.end:
1202; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND2:%.*]]
1203; IS__TUNIT_OPM:       for.cond2:
1204; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1205; IS__TUNIT_OPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1206; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1207; IS__TUNIT_OPM:       for.cond.cleanup4:
1208; IS__TUNIT_OPM-NEXT:    br label [[FOR_END11:%.*]]
1209; IS__TUNIT_OPM:       for.body5:
1210; IS__TUNIT_OPM-NEXT:    [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1211; IS__TUNIT_OPM-NEXT:    [[I16:%.*]] = or i64 [[I15]], 1
1212; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]]
1213; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC9]]
1214; IS__TUNIT_OPM:       for.inc9:
1215; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1216; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP22:![0-9]+]]
1217; IS__TUNIT_OPM:       for.end11:
1218; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND13:%.*]]
1219; IS__TUNIT_OPM:       for.cond13:
1220; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1221; IS__TUNIT_OPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1222; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
1223; IS__TUNIT_OPM:       for.cond.cleanup15:
1224; IS__TUNIT_OPM-NEXT:    br label [[FOR_END23:%.*]]
1225; IS__TUNIT_OPM:       for.body16:
1226; IS__TUNIT_OPM-NEXT:    [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
1227; IS__TUNIT_OPM-NEXT:    [[I18:%.*]] = add nuw nsw i64 [[I17]], 2
1228; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]]
1229; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC21]]
1230; IS__TUNIT_OPM:       for.inc21:
1231; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
1232; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]]
1233; IS__TUNIT_OPM:       for.end23:
1234; 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) #[[ATTR16]]
1235; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND25:%.*]]
1236; IS__TUNIT_OPM:       for.cond25:
1237; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ]
1238; IS__TUNIT_OPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
1239; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]]
1240; IS__TUNIT_OPM:       for.cond.cleanup27:
1241; IS__TUNIT_OPM-NEXT:    br label [[FOR_END35:%.*]]
1242; IS__TUNIT_OPM:       for.body28:
1243; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
1244; IS__TUNIT_OPM-NEXT:    store i8 0, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
1245; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC33]]
1246; IS__TUNIT_OPM:       for.inc33:
1247; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
1248; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND25]], !llvm.loop [[LOOP24:![0-9]+]]
1249; IS__TUNIT_OPM:       for.end35:
1250; IS__TUNIT_OPM-NEXT:    ret void
1251;
1252; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1253; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2
1254; IS__TUNIT_NPM-SAME: () #[[ATTR4]] {
1255; IS__TUNIT_NPM-NEXT:  entry:
1256; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND:%.*]]
1257; IS__TUNIT_NPM:       for.cond:
1258; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1259; IS__TUNIT_NPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1260; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1261; IS__TUNIT_NPM:       for.cond.cleanup:
1262; IS__TUNIT_NPM-NEXT:    br label [[FOR_END:%.*]]
1263; IS__TUNIT_NPM:       for.body:
1264; IS__TUNIT_NPM-NEXT:    [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1265; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]]
1266; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC]]
1267; IS__TUNIT_NPM:       for.inc:
1268; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1269; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
1270; IS__TUNIT_NPM:       for.end:
1271; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND2:%.*]]
1272; IS__TUNIT_NPM:       for.cond2:
1273; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1274; IS__TUNIT_NPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1275; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1276; IS__TUNIT_NPM:       for.cond.cleanup4:
1277; IS__TUNIT_NPM-NEXT:    br label [[FOR_END11:%.*]]
1278; IS__TUNIT_NPM:       for.body5:
1279; IS__TUNIT_NPM-NEXT:    [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1280; IS__TUNIT_NPM-NEXT:    [[I16:%.*]] = or i64 [[I15]], 1
1281; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]]
1282; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC9]]
1283; IS__TUNIT_NPM:       for.inc9:
1284; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1285; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP22:![0-9]+]]
1286; IS__TUNIT_NPM:       for.end11:
1287; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND13:%.*]]
1288; IS__TUNIT_NPM:       for.cond13:
1289; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1290; IS__TUNIT_NPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1291; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
1292; IS__TUNIT_NPM:       for.cond.cleanup15:
1293; IS__TUNIT_NPM-NEXT:    br label [[FOR_END23:%.*]]
1294; IS__TUNIT_NPM:       for.body16:
1295; IS__TUNIT_NPM-NEXT:    [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
1296; IS__TUNIT_NPM-NEXT:    [[I18:%.*]] = add nuw nsw i64 [[I17]], 2
1297; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]]
1298; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC21]]
1299; IS__TUNIT_NPM:       for.inc21:
1300; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
1301; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]]
1302; IS__TUNIT_NPM:       for.end23:
1303; 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) #[[ATTR12]]
1304; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND25:%.*]]
1305; IS__TUNIT_NPM:       for.cond25:
1306; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ]
1307; IS__TUNIT_NPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
1308; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]]
1309; IS__TUNIT_NPM:       for.cond.cleanup27:
1310; IS__TUNIT_NPM-NEXT:    br label [[FOR_END35:%.*]]
1311; IS__TUNIT_NPM:       for.body28:
1312; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
1313; IS__TUNIT_NPM-NEXT:    store i8 0, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
1314; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC33]]
1315; IS__TUNIT_NPM:       for.inc33:
1316; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
1317; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND25]], !llvm.loop [[LOOP24:![0-9]+]]
1318; IS__TUNIT_NPM:       for.end35:
1319; IS__TUNIT_NPM-NEXT:    ret void
1320;
1321; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2() {
1322; IS__CGSCC_OPM-NEXT:  entry:
1323; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND:%.*]]
1324; IS__CGSCC_OPM:       for.cond:
1325; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1326; IS__CGSCC_OPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1327; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1328; IS__CGSCC_OPM:       for.cond.cleanup:
1329; IS__CGSCC_OPM-NEXT:    br label [[FOR_END:%.*]]
1330; IS__CGSCC_OPM:       for.body:
1331; IS__CGSCC_OPM-NEXT:    [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1332; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]]
1333; IS__CGSCC_OPM-NEXT:    store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15]]
1334; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC]]
1335; IS__CGSCC_OPM:       for.inc:
1336; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1337; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
1338; IS__CGSCC_OPM:       for.end:
1339; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND2:%.*]]
1340; IS__CGSCC_OPM:       for.cond2:
1341; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1342; IS__CGSCC_OPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1343; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1344; IS__CGSCC_OPM:       for.cond.cleanup4:
1345; IS__CGSCC_OPM-NEXT:    br label [[FOR_END11:%.*]]
1346; IS__CGSCC_OPM:       for.body5:
1347; IS__CGSCC_OPM-NEXT:    [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1348; IS__CGSCC_OPM-NEXT:    [[I16:%.*]] = or i64 [[I15]], 1
1349; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]]
1350; IS__CGSCC_OPM-NEXT:    store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
1351; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC9]]
1352; IS__CGSCC_OPM:       for.inc9:
1353; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1354; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP25:![0-9]+]]
1355; IS__CGSCC_OPM:       for.end11:
1356; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND13:%.*]]
1357; IS__CGSCC_OPM:       for.cond13:
1358; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1359; IS__CGSCC_OPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1360; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
1361; IS__CGSCC_OPM:       for.cond.cleanup15:
1362; IS__CGSCC_OPM-NEXT:    br label [[FOR_END23:%.*]]
1363; IS__CGSCC_OPM:       for.body16:
1364; IS__CGSCC_OPM-NEXT:    [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
1365; IS__CGSCC_OPM-NEXT:    [[I18:%.*]] = add nuw nsw i64 [[I17]], 2
1366; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]]
1367; IS__CGSCC_OPM-NEXT:    store i64 0, i64* [[ARRAYIDX20]], align 16, !tbaa [[TBAA20]]
1368; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC21]]
1369; IS__CGSCC_OPM:       for.inc21:
1370; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
1371; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP26:![0-9]+]]
1372; IS__CGSCC_OPM:       for.end23:
1373; 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]]
1374; 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) #[[ATTR15]]
1375; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND25:%.*]]
1376; IS__CGSCC_OPM:       for.cond25:
1377; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ]
1378; IS__CGSCC_OPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
1379; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]]
1380; IS__CGSCC_OPM:       for.cond.cleanup27:
1381; IS__CGSCC_OPM-NEXT:    br label [[FOR_END35:%.*]]
1382; IS__CGSCC_OPM:       for.body28:
1383; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX30:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[INDVARS_IV12]]
1384; IS__CGSCC_OPM-NEXT:    [[I19:%.*]] = load i8, i8* [[ARRAYIDX30]], align 1, !tbaa [[TBAA15]]
1385; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
1386; IS__CGSCC_OPM-NEXT:    store i8 [[I19]], i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
1387; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC33]]
1388; IS__CGSCC_OPM:       for.inc33:
1389; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
1390; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND25]], !llvm.loop [[LOOP27:![0-9]+]]
1391; IS__CGSCC_OPM:       for.end35:
1392; IS__CGSCC_OPM-NEXT:    ret void
1393;
1394; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2() {
1395; IS__CGSCC_NPM-NEXT:  entry:
1396; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND:%.*]]
1397; IS__CGSCC_NPM:       for.cond:
1398; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1399; IS__CGSCC_NPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1400; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1401; IS__CGSCC_NPM:       for.cond.cleanup:
1402; IS__CGSCC_NPM-NEXT:    br label [[FOR_END:%.*]]
1403; IS__CGSCC_NPM:       for.body:
1404; IS__CGSCC_NPM-NEXT:    [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1405; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]]
1406; IS__CGSCC_NPM-NEXT:    store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15]]
1407; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC]]
1408; IS__CGSCC_NPM:       for.inc:
1409; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1410; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
1411; IS__CGSCC_NPM:       for.end:
1412; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND2:%.*]]
1413; IS__CGSCC_NPM:       for.cond2:
1414; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1415; IS__CGSCC_NPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1416; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1417; IS__CGSCC_NPM:       for.cond.cleanup4:
1418; IS__CGSCC_NPM-NEXT:    br label [[FOR_END11:%.*]]
1419; IS__CGSCC_NPM:       for.body5:
1420; IS__CGSCC_NPM-NEXT:    [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1421; IS__CGSCC_NPM-NEXT:    [[I16:%.*]] = or i64 [[I15]], 1
1422; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]]
1423; IS__CGSCC_NPM-NEXT:    store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
1424; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC9]]
1425; IS__CGSCC_NPM:       for.inc9:
1426; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1427; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP25:![0-9]+]]
1428; IS__CGSCC_NPM:       for.end11:
1429; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND13:%.*]]
1430; IS__CGSCC_NPM:       for.cond13:
1431; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1432; IS__CGSCC_NPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1433; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
1434; IS__CGSCC_NPM:       for.cond.cleanup15:
1435; IS__CGSCC_NPM-NEXT:    br label [[FOR_END23:%.*]]
1436; IS__CGSCC_NPM:       for.body16:
1437; IS__CGSCC_NPM-NEXT:    [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
1438; IS__CGSCC_NPM-NEXT:    [[I18:%.*]] = add nuw nsw i64 [[I17]], 2
1439; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]]
1440; IS__CGSCC_NPM-NEXT:    store i64 0, i64* [[ARRAYIDX20]], align 16, !tbaa [[TBAA20]]
1441; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC21]]
1442; IS__CGSCC_NPM:       for.inc21:
1443; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
1444; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP26:![0-9]+]]
1445; IS__CGSCC_NPM:       for.end23:
1446; 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]]
1447; 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) #[[ATTR13]]
1448; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND25:%.*]]
1449; IS__CGSCC_NPM:       for.cond25:
1450; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ]
1451; IS__CGSCC_NPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
1452; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]]
1453; IS__CGSCC_NPM:       for.cond.cleanup27:
1454; IS__CGSCC_NPM-NEXT:    br label [[FOR_END35:%.*]]
1455; IS__CGSCC_NPM:       for.body28:
1456; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX30:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[INDVARS_IV12]]
1457; IS__CGSCC_NPM-NEXT:    [[I19:%.*]] = load i8, i8* [[ARRAYIDX30]], align 1, !tbaa [[TBAA15]]
1458; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
1459; IS__CGSCC_NPM-NEXT:    store i8 [[I19]], i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
1460; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC33]]
1461; IS__CGSCC_NPM:       for.inc33:
1462; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
1463; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND25]], !llvm.loop [[LOOP27:![0-9]+]]
1464; IS__CGSCC_NPM:       for.end35:
1465; IS__CGSCC_NPM-NEXT:    ret void
1466;
1467entry:
1468  br label %for.cond
1469
1470for.cond:                                         ; preds = %for.inc, %entry
1471  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
1472  %exitcond = icmp ne i64 %indvars.iv, 100
1473  br i1 %exitcond, label %for.body, label %for.cond.cleanup
1474
1475for.cond.cleanup:                                 ; preds = %for.cond
1476  br label %for.end
1477
1478for.body:                                         ; preds = %for.cond
1479  %i = mul nuw nsw i64 %indvars.iv, 10
1480  %arrayidx = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 %i
1481  store i8 0, i8* %arrayidx, align 2, !tbaa !15
1482  br label %for.inc
1483
1484for.inc:                                          ; preds = %for.body
1485  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
1486  br label %for.cond, !llvm.loop !24
1487
1488for.end:                                          ; preds = %for.cond.cleanup
1489  br label %for.cond2
1490
1491for.cond2:                                        ; preds = %for.inc9, %for.end
1492  %indvars.iv2 = phi i64 [ %indvars.iv.next3, %for.inc9 ], [ 0, %for.end ]
1493  %exitcond6 = icmp ne i64 %indvars.iv2, 10
1494  br i1 %exitcond6, label %for.body5, label %for.cond.cleanup4
1495
1496for.cond.cleanup4:                                ; preds = %for.cond2
1497  br label %for.end11
1498
1499for.body5:                                        ; preds = %for.cond2
1500  %i15 = mul nuw nsw i64 %indvars.iv2, 10
1501  %i16 = or i64 %i15, 1
1502  %arrayidx8 = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 %i16
1503  store float 0.000000e+00, float* %arrayidx8, align 4, !tbaa !18
1504  br label %for.inc9
1505
1506for.inc9:                                         ; preds = %for.body5
1507  %indvars.iv.next3 = add nuw nsw i64 %indvars.iv2, 1
1508  br label %for.cond2, !llvm.loop !25
1509
1510for.end11:                                        ; preds = %for.cond.cleanup4
1511  br label %for.cond13
1512
1513for.cond13:                                       ; preds = %for.inc21, %for.end11
1514  %indvars.iv7 = phi i64 [ %indvars.iv.next8, %for.inc21 ], [ 0, %for.end11 ]
1515  %exitcond11 = icmp ne i64 %indvars.iv7, 20
1516  br i1 %exitcond11, label %for.body16, label %for.cond.cleanup15
1517
1518for.cond.cleanup15:                               ; preds = %for.cond13
1519  br label %for.end23
1520
1521for.body16:                                       ; preds = %for.cond13
1522  %i17 = mul nuw nsw i64 %indvars.iv7, 10
1523  %i18 = add nuw nsw i64 %i17, 2
1524  %arrayidx20 = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 %i18
1525  store i64 0, i64* %arrayidx20, align 16, !tbaa !20
1526  br label %for.inc21
1527
1528for.inc21:                                        ; preds = %for.body16
1529  %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7, 1
1530  br label %for.cond13, !llvm.loop !26
1531
1532for.end23:                                        ; preds = %for.cond.cleanup15
1533  store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 1023), align 1, !tbaa !15
1534  call void @write_arg(i32* bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 0)
1535  br label %for.cond25
1536
1537for.cond25:                                       ; preds = %for.inc33, %for.end23
1538  %indvars.iv12 = phi i64 [ %indvars.iv.next13, %for.inc33 ], [ 0, %for.end23 ]
1539  %exitcond14 = icmp ne i64 %indvars.iv12, 1024
1540  br i1 %exitcond14, label %for.body28, label %for.cond.cleanup27
1541
1542for.cond.cleanup27:                               ; preds = %for.cond25
1543  br label %for.end35
1544
1545for.body28:                                       ; preds = %for.cond25
1546  %arrayidx30 = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 %indvars.iv12
1547  %i19 = load i8, i8* %arrayidx30, align 1, !tbaa !15
1548  %arrayidx32 = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 %indvars.iv12
1549  store i8 %i19, i8* %arrayidx32, align 1, !tbaa !15
1550  br label %for.inc33
1551
1552for.inc33:                                        ; preds = %for.body28
1553  %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12, 1
1554  br label %for.cond25, !llvm.loop !27
1555
1556for.end35:                                        ; preds = %for.cond.cleanup27
1557  ret void
1558}
1559
1560;    static int Flag3;
1561;    int static_global_simplifiable_3() {
1562;      Flag3 = 1;
1563;      return Flag3;
1564;    }
1565define i32 @static_global_simplifiable_3() {
1566; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
1567; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3
1568; IS__TUNIT_OPM-SAME: () #[[ATTR7:[0-9]+]] {
1569; IS__TUNIT_OPM-NEXT:    store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]]
1570; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]]
1571; IS__TUNIT_OPM-NEXT:    ret i32 [[I]]
1572;
1573; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
1574; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3
1575; NOT_TUNIT_OPM-SAME: () #[[ATTR5:[0-9]+]] {
1576; NOT_TUNIT_OPM-NEXT:    store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]]
1577; NOT_TUNIT_OPM-NEXT:    [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]]
1578; NOT_TUNIT_OPM-NEXT:    ret i32 [[I]]
1579;
1580  store i32 1, i32* @Flag3, align 4, !tbaa !3
1581  %i = load i32, i32* @Flag3, align 4, !tbaa !3
1582  ret i32 %i
1583}
1584
1585;    struct S noalias_arg_simplifiable_1(struct S s) {
1586;      s.f1 = 1.1;
1587;      s.f2 = 2.2;
1588;      s.f3 = 3.3;
1589;      write_arg(&s.i1, 1);
1590;      write_arg(&s.i2, 2);
1591;      write_arg(&s.i3, 3);
1592;      struct S r;
1593;      r.f1 = s.f1;
1594;      r.f2 = s.f2 * 2;
1595;      r.f3 = s.f3 + s.f1;
1596;      r.i1 = s.i1;
1597;      r.i2 = s.i2 * 2;
1598;      r.i3 = s.i3 + s.i1;
1599;      return r;
1600;    }
1601;
1602define void @noalias_arg_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result, %struct.S* byval(%struct.S) align 8 %s) {
1603; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn
1604; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1
1605; 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:%.*]]) #[[ATTR8:[0-9]+]] {
1606; IS__TUNIT_OPM-NEXT:  entry:
1607; IS__TUNIT_OPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1608; IS__TUNIT_OPM-NEXT:    store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1609; IS__TUNIT_OPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1610; IS__TUNIT_OPM-NEXT:    store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]]
1611; IS__TUNIT_OPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1612; IS__TUNIT_OPM-NEXT:    store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]]
1613; IS__TUNIT_OPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1614; IS__TUNIT_OPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR15]]
1615; IS__TUNIT_OPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1616; IS__TUNIT_OPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR15]]
1617; IS__TUNIT_OPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1618; IS__TUNIT_OPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR15]]
1619; IS__TUNIT_OPM-NEXT:    [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1620; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]]
1621; IS__TUNIT_OPM-NEXT:    [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1622; IS__TUNIT_OPM-NEXT:    store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]]
1623; IS__TUNIT_OPM-NEXT:    [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1624; IS__TUNIT_OPM-NEXT:    [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]]
1625; IS__TUNIT_OPM-NEXT:    [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00
1626; IS__TUNIT_OPM-NEXT:    [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1627; IS__TUNIT_OPM-NEXT:    store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]]
1628; IS__TUNIT_OPM-NEXT:    [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1629; IS__TUNIT_OPM-NEXT:    [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]]
1630; IS__TUNIT_OPM-NEXT:    [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1631; IS__TUNIT_OPM-NEXT:    [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]]
1632; IS__TUNIT_OPM-NEXT:    [[ADD:%.*]] = fadd float [[I5]], [[I6]]
1633; IS__TUNIT_OPM-NEXT:    [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1634; IS__TUNIT_OPM-NEXT:    store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]]
1635; IS__TUNIT_OPM-NEXT:    [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1636; IS__TUNIT_OPM-NEXT:    [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]]
1637; IS__TUNIT_OPM-NEXT:    [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1638; IS__TUNIT_OPM-NEXT:    store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]]
1639; IS__TUNIT_OPM-NEXT:    [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1640; IS__TUNIT_OPM-NEXT:    [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]]
1641; IS__TUNIT_OPM-NEXT:    [[MUL11:%.*]] = shl nsw i32 [[I8]], 1
1642; IS__TUNIT_OPM-NEXT:    [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1643; IS__TUNIT_OPM-NEXT:    store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]]
1644; IS__TUNIT_OPM-NEXT:    [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1645; IS__TUNIT_OPM-NEXT:    [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]]
1646; IS__TUNIT_OPM-NEXT:    [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1647; IS__TUNIT_OPM-NEXT:    [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]]
1648; IS__TUNIT_OPM-NEXT:    [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]]
1649; IS__TUNIT_OPM-NEXT:    [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1650; IS__TUNIT_OPM-NEXT:    store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]]
1651; IS__TUNIT_OPM-NEXT:    ret void
1652;
1653; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn
1654; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1
1655; 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:%.*]]) #[[ATTR6:[0-9]+]] {
1656; IS__TUNIT_NPM-NEXT:  entry:
1657; IS__TUNIT_NPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1658; IS__TUNIT_NPM-NEXT:    store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1659; IS__TUNIT_NPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1660; IS__TUNIT_NPM-NEXT:    store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]]
1661; IS__TUNIT_NPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1662; IS__TUNIT_NPM-NEXT:    store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]]
1663; IS__TUNIT_NPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1664; IS__TUNIT_NPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12]]
1665; IS__TUNIT_NPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1666; IS__TUNIT_NPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]]
1667; IS__TUNIT_NPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1668; IS__TUNIT_NPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]]
1669; IS__TUNIT_NPM-NEXT:    [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1670; IS__TUNIT_NPM-NEXT:    [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]]
1671; IS__TUNIT_NPM-NEXT:    [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1672; IS__TUNIT_NPM-NEXT:    store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]]
1673; IS__TUNIT_NPM-NEXT:    [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1674; IS__TUNIT_NPM-NEXT:    [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]]
1675; IS__TUNIT_NPM-NEXT:    [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00
1676; IS__TUNIT_NPM-NEXT:    [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1677; IS__TUNIT_NPM-NEXT:    store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]]
1678; IS__TUNIT_NPM-NEXT:    [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1679; IS__TUNIT_NPM-NEXT:    [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]]
1680; IS__TUNIT_NPM-NEXT:    [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1681; IS__TUNIT_NPM-NEXT:    [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]]
1682; IS__TUNIT_NPM-NEXT:    [[ADD:%.*]] = fadd float [[I5]], [[I6]]
1683; IS__TUNIT_NPM-NEXT:    [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1684; IS__TUNIT_NPM-NEXT:    store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]]
1685; IS__TUNIT_NPM-NEXT:    [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1686; IS__TUNIT_NPM-NEXT:    [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]]
1687; IS__TUNIT_NPM-NEXT:    [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1688; IS__TUNIT_NPM-NEXT:    store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]]
1689; IS__TUNIT_NPM-NEXT:    [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1690; IS__TUNIT_NPM-NEXT:    [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]]
1691; IS__TUNIT_NPM-NEXT:    [[MUL11:%.*]] = shl nsw i32 [[I8]], 1
1692; IS__TUNIT_NPM-NEXT:    [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1693; IS__TUNIT_NPM-NEXT:    store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]]
1694; IS__TUNIT_NPM-NEXT:    [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1695; IS__TUNIT_NPM-NEXT:    [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]]
1696; IS__TUNIT_NPM-NEXT:    [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1697; IS__TUNIT_NPM-NEXT:    [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]]
1698; IS__TUNIT_NPM-NEXT:    [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]]
1699; IS__TUNIT_NPM-NEXT:    [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1700; IS__TUNIT_NPM-NEXT:    store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]]
1701; IS__TUNIT_NPM-NEXT:    ret void
1702;
1703; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn
1704; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1
1705; 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]+]] {
1706; IS__CGSCC_OPM-NEXT:  entry:
1707; IS__CGSCC_OPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1708; IS__CGSCC_OPM-NEXT:    store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1709; IS__CGSCC_OPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1710; IS__CGSCC_OPM-NEXT:    store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]]
1711; IS__CGSCC_OPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1712; IS__CGSCC_OPM-NEXT:    store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]]
1713; IS__CGSCC_OPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1714; IS__CGSCC_OPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR14]]
1715; IS__CGSCC_OPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1716; IS__CGSCC_OPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR14]]
1717; IS__CGSCC_OPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1718; IS__CGSCC_OPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR14]]
1719; IS__CGSCC_OPM-NEXT:    [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1720; IS__CGSCC_OPM-NEXT:    [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]]
1721; IS__CGSCC_OPM-NEXT:    [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1722; IS__CGSCC_OPM-NEXT:    store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]]
1723; IS__CGSCC_OPM-NEXT:    [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1724; IS__CGSCC_OPM-NEXT:    [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]]
1725; IS__CGSCC_OPM-NEXT:    [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00
1726; IS__CGSCC_OPM-NEXT:    [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1727; IS__CGSCC_OPM-NEXT:    store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]]
1728; IS__CGSCC_OPM-NEXT:    [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1729; IS__CGSCC_OPM-NEXT:    [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]]
1730; IS__CGSCC_OPM-NEXT:    [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1731; IS__CGSCC_OPM-NEXT:    [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]]
1732; IS__CGSCC_OPM-NEXT:    [[ADD:%.*]] = fadd float [[I5]], [[I6]]
1733; IS__CGSCC_OPM-NEXT:    [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1734; IS__CGSCC_OPM-NEXT:    store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]]
1735; IS__CGSCC_OPM-NEXT:    [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1736; IS__CGSCC_OPM-NEXT:    [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]]
1737; IS__CGSCC_OPM-NEXT:    [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1738; IS__CGSCC_OPM-NEXT:    store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]]
1739; IS__CGSCC_OPM-NEXT:    [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1740; IS__CGSCC_OPM-NEXT:    [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]]
1741; IS__CGSCC_OPM-NEXT:    [[MUL11:%.*]] = shl nsw i32 [[I8]], 1
1742; IS__CGSCC_OPM-NEXT:    [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1743; IS__CGSCC_OPM-NEXT:    store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]]
1744; IS__CGSCC_OPM-NEXT:    [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1745; IS__CGSCC_OPM-NEXT:    [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]]
1746; IS__CGSCC_OPM-NEXT:    [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1747; IS__CGSCC_OPM-NEXT:    [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]]
1748; IS__CGSCC_OPM-NEXT:    [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]]
1749; IS__CGSCC_OPM-NEXT:    [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1750; IS__CGSCC_OPM-NEXT:    store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]]
1751; IS__CGSCC_OPM-NEXT:    ret void
1752;
1753; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn
1754; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1
1755; 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]+]] {
1756; IS__CGSCC_NPM-NEXT:  entry:
1757; IS__CGSCC_NPM-NEXT:    [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1758; IS__CGSCC_NPM-NEXT:    store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
1759; IS__CGSCC_NPM-NEXT:    [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1760; IS__CGSCC_NPM-NEXT:    store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]]
1761; IS__CGSCC_NPM-NEXT:    [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1762; IS__CGSCC_NPM-NEXT:    store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]]
1763; IS__CGSCC_NPM-NEXT:    [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1764; IS__CGSCC_NPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12]]
1765; IS__CGSCC_NPM-NEXT:    [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1766; IS__CGSCC_NPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]]
1767; IS__CGSCC_NPM-NEXT:    [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1768; IS__CGSCC_NPM-NEXT:    call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]]
1769; IS__CGSCC_NPM-NEXT:    [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1770; IS__CGSCC_NPM-NEXT:    [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]]
1771; IS__CGSCC_NPM-NEXT:    [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
1772; IS__CGSCC_NPM-NEXT:    store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]]
1773; IS__CGSCC_NPM-NEXT:    [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
1774; IS__CGSCC_NPM-NEXT:    [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]]
1775; IS__CGSCC_NPM-NEXT:    [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00
1776; IS__CGSCC_NPM-NEXT:    [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
1777; IS__CGSCC_NPM-NEXT:    store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]]
1778; IS__CGSCC_NPM-NEXT:    [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
1779; IS__CGSCC_NPM-NEXT:    [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]]
1780; IS__CGSCC_NPM-NEXT:    [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
1781; IS__CGSCC_NPM-NEXT:    [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]]
1782; IS__CGSCC_NPM-NEXT:    [[ADD:%.*]] = fadd float [[I5]], [[I6]]
1783; IS__CGSCC_NPM-NEXT:    [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
1784; IS__CGSCC_NPM-NEXT:    store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]]
1785; IS__CGSCC_NPM-NEXT:    [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1786; IS__CGSCC_NPM-NEXT:    [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]]
1787; IS__CGSCC_NPM-NEXT:    [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
1788; IS__CGSCC_NPM-NEXT:    store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]]
1789; IS__CGSCC_NPM-NEXT:    [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
1790; IS__CGSCC_NPM-NEXT:    [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]]
1791; IS__CGSCC_NPM-NEXT:    [[MUL11:%.*]] = shl nsw i32 [[I8]], 1
1792; IS__CGSCC_NPM-NEXT:    [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
1793; IS__CGSCC_NPM-NEXT:    store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]]
1794; IS__CGSCC_NPM-NEXT:    [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
1795; IS__CGSCC_NPM-NEXT:    [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]]
1796; IS__CGSCC_NPM-NEXT:    [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
1797; IS__CGSCC_NPM-NEXT:    [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]]
1798; IS__CGSCC_NPM-NEXT:    [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]]
1799; IS__CGSCC_NPM-NEXT:    [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
1800; IS__CGSCC_NPM-NEXT:    store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]]
1801; IS__CGSCC_NPM-NEXT:    ret void
1802;
1803entry:
1804  %f1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
1805  store float 0x3FF19999A0000000, float* %f1, align 4, !tbaa !7
1806  %f2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
1807  store float 0x40019999A0000000, float* %f2, align 8, !tbaa !10
1808  %f3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
1809  store float 0x400A666660000000, float* %f3, align 4, !tbaa !11
1810  %i1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
1811  call void @write_arg(i32* nonnull %i1, i32 1)
1812  %i2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
1813  call void @write_arg(i32* nonnull %i2, i32 2)
1814  %i3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
1815  call void @write_arg(i32* nonnull %i3, i32 3)
1816  %f11 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
1817  %i = load float, float* %f11, align 4, !tbaa !7
1818  %f12 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 3
1819  store float %i, float* %f12, align 4, !tbaa !7
1820  %f23 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
1821  %i4 = load float, float* %f23, align 8, !tbaa !10
1822  %mul = fmul float %i4, 2.000000e+00
1823  %f24 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 4
1824  store float %mul, float* %f24, align 4, !tbaa !10
1825  %f35 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
1826  %i5 = load float, float* %f35, align 4, !tbaa !11
1827  %f16 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
1828  %i6 = load float, float* %f16, align 4, !tbaa !7
1829  %add = fadd float %i5, %i6
1830  %f37 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 5
1831  store float %add, float* %f37, align 4, !tbaa !11
1832  %i18 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
1833  %i7 = load i32, i32* %i18, align 8, !tbaa !12
1834  %i19 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 0
1835  store i32 %i7, i32* %i19, align 4, !tbaa !12
1836  %i210 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
1837  %i8 = load i32, i32* %i210, align 4, !tbaa !13
1838  %mul11 = shl nsw i32 %i8, 1
1839  %i212 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 1
1840  store i32 %mul11, i32* %i212, align 4, !tbaa !13
1841  %i313 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
1842  %i9 = load i32, i32* %i313, align 8, !tbaa !14
1843  %i114 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
1844  %i10 = load i32, i32* %i114, align 8, !tbaa !12
1845  %add15 = add nsw i32 %i9, %i10
1846  %i316 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 2
1847  store i32 %add15, i32* %i316, align 4, !tbaa !14
1848  ret void
1849}
1850
1851;    void noalias_arg_simplifiable_2(char Bytes[1024]) {
1852;      for (int i = 0; i < 100; ++i)
1853;        Bytes[i * 10] = 0;
1854;      for (int i = 0; i < 10; ++i)
1855;        ((float *)Bytes)[i * 10 + 1] = 0;
1856;      for (int i = 0; i < 20; ++i)
1857;        ((long long int *)Bytes)[i * 10 + 2] = 0;
1858;      Bytes[1023] = 0;
1859;      write_arg((int *)&Bytes[500], 0);
1860;      struct S R;
1861;      for (int i = 0; i < 1024; ++i)
1862;        globalBytes[i] = Bytes[i];
1863;    }
1864;
1865define void @noalias_arg_simplifiable_2(i8* %Bytes) {
1866; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind
1867; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2
1868; IS__TUNIT_OPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR9:[0-9]+]] {
1869; IS__TUNIT_OPM-NEXT:  entry:
1870; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND:%.*]]
1871; IS__TUNIT_OPM:       for.cond:
1872; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1873; IS__TUNIT_OPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1874; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1875; IS__TUNIT_OPM:       for.cond.cleanup:
1876; IS__TUNIT_OPM-NEXT:    br label [[FOR_END:%.*]]
1877; IS__TUNIT_OPM:       for.body:
1878; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1879; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]]
1880; IS__TUNIT_OPM-NEXT:    store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA19]]
1881; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC]]
1882; IS__TUNIT_OPM:       for.inc:
1883; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1884; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]]
1885; IS__TUNIT_OPM:       for.end:
1886; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND2:%.*]]
1887; IS__TUNIT_OPM:       for.cond2:
1888; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1889; IS__TUNIT_OPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1890; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1891; IS__TUNIT_OPM:       for.cond.cleanup4:
1892; IS__TUNIT_OPM-NEXT:    br label [[FOR_END11:%.*]]
1893; IS__TUNIT_OPM:       for.body5:
1894; IS__TUNIT_OPM-NEXT:    [[I15:%.*]] = bitcast i8* [[BYTES]] to float*
1895; IS__TUNIT_OPM-NEXT:    [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1896; IS__TUNIT_OPM-NEXT:    [[I17:%.*]] = or i64 [[I16]], 1
1897; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]]
1898; IS__TUNIT_OPM-NEXT:    store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]]
1899; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC9]]
1900; IS__TUNIT_OPM:       for.inc9:
1901; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1902; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP27:![0-9]+]]
1903; IS__TUNIT_OPM:       for.end11:
1904; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND13:%.*]]
1905; IS__TUNIT_OPM:       for.cond13:
1906; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1907; IS__TUNIT_OPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1908; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
1909; IS__TUNIT_OPM:       for.cond.cleanup15:
1910; IS__TUNIT_OPM-NEXT:    br label [[FOR_END23:%.*]]
1911; IS__TUNIT_OPM:       for.body16:
1912; IS__TUNIT_OPM-NEXT:    [[I18:%.*]] = bitcast i8* [[BYTES]] to i64*
1913; IS__TUNIT_OPM-NEXT:    [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
1914; IS__TUNIT_OPM-NEXT:    [[I20:%.*]] = add nuw nsw i64 [[I19]], 2
1915; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]]
1916; IS__TUNIT_OPM-NEXT:    store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]]
1917; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC21]]
1918; IS__TUNIT_OPM:       for.inc21:
1919; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
1920; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]]
1921; IS__TUNIT_OPM:       for.end23:
1922; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023
1923; IS__TUNIT_OPM-NEXT:    store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]]
1924; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500
1925; IS__TUNIT_OPM-NEXT:    [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32*
1926; IS__TUNIT_OPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR16]]
1927; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND27:%.*]]
1928; IS__TUNIT_OPM:       for.cond27:
1929; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ]
1930; IS__TUNIT_OPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
1931; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]]
1932; IS__TUNIT_OPM:       for.cond.cleanup29:
1933; IS__TUNIT_OPM-NEXT:    br label [[FOR_END37:%.*]]
1934; IS__TUNIT_OPM:       for.body30:
1935; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]]
1936; IS__TUNIT_OPM-NEXT:    [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
1937; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
1938; IS__TUNIT_OPM-NEXT:    store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]]
1939; IS__TUNIT_OPM-NEXT:    br label [[FOR_INC35]]
1940; IS__TUNIT_OPM:       for.inc35:
1941; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
1942; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]]
1943; IS__TUNIT_OPM:       for.end37:
1944; IS__TUNIT_OPM-NEXT:    ret void
1945;
1946; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn
1947; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2
1948; IS__TUNIT_NPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR5]] {
1949; IS__TUNIT_NPM-NEXT:  entry:
1950; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND:%.*]]
1951; IS__TUNIT_NPM:       for.cond:
1952; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
1953; IS__TUNIT_NPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
1954; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
1955; IS__TUNIT_NPM:       for.cond.cleanup:
1956; IS__TUNIT_NPM-NEXT:    br label [[FOR_END:%.*]]
1957; IS__TUNIT_NPM:       for.body:
1958; IS__TUNIT_NPM-NEXT:    [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
1959; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]]
1960; IS__TUNIT_NPM-NEXT:    store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA19]]
1961; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC]]
1962; IS__TUNIT_NPM:       for.inc:
1963; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1964; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]]
1965; IS__TUNIT_NPM:       for.end:
1966; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND2:%.*]]
1967; IS__TUNIT_NPM:       for.cond2:
1968; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
1969; IS__TUNIT_NPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
1970; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
1971; IS__TUNIT_NPM:       for.cond.cleanup4:
1972; IS__TUNIT_NPM-NEXT:    br label [[FOR_END11:%.*]]
1973; IS__TUNIT_NPM:       for.body5:
1974; IS__TUNIT_NPM-NEXT:    [[I15:%.*]] = bitcast i8* [[BYTES]] to float*
1975; IS__TUNIT_NPM-NEXT:    [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
1976; IS__TUNIT_NPM-NEXT:    [[I17:%.*]] = or i64 [[I16]], 1
1977; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]]
1978; IS__TUNIT_NPM-NEXT:    store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]]
1979; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC9]]
1980; IS__TUNIT_NPM:       for.inc9:
1981; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
1982; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP27:![0-9]+]]
1983; IS__TUNIT_NPM:       for.end11:
1984; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND13:%.*]]
1985; IS__TUNIT_NPM:       for.cond13:
1986; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
1987; IS__TUNIT_NPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
1988; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
1989; IS__TUNIT_NPM:       for.cond.cleanup15:
1990; IS__TUNIT_NPM-NEXT:    br label [[FOR_END23:%.*]]
1991; IS__TUNIT_NPM:       for.body16:
1992; IS__TUNIT_NPM-NEXT:    [[I18:%.*]] = bitcast i8* [[BYTES]] to i64*
1993; IS__TUNIT_NPM-NEXT:    [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
1994; IS__TUNIT_NPM-NEXT:    [[I20:%.*]] = add nuw nsw i64 [[I19]], 2
1995; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]]
1996; IS__TUNIT_NPM-NEXT:    store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]]
1997; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC21]]
1998; IS__TUNIT_NPM:       for.inc21:
1999; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
2000; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]]
2001; IS__TUNIT_NPM:       for.end23:
2002; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023
2003; IS__TUNIT_NPM-NEXT:    store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]]
2004; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500
2005; IS__TUNIT_NPM-NEXT:    [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32*
2006; IS__TUNIT_NPM-NEXT:    call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR12]]
2007; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND27:%.*]]
2008; IS__TUNIT_NPM:       for.cond27:
2009; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ]
2010; IS__TUNIT_NPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
2011; IS__TUNIT_NPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]]
2012; IS__TUNIT_NPM:       for.cond.cleanup29:
2013; IS__TUNIT_NPM-NEXT:    br label [[FOR_END37:%.*]]
2014; IS__TUNIT_NPM:       for.body30:
2015; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]]
2016; IS__TUNIT_NPM-NEXT:    [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
2017; IS__TUNIT_NPM-NEXT:    [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
2018; IS__TUNIT_NPM-NEXT:    store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]]
2019; IS__TUNIT_NPM-NEXT:    br label [[FOR_INC35]]
2020; IS__TUNIT_NPM:       for.inc35:
2021; IS__TUNIT_NPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
2022; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]]
2023; IS__TUNIT_NPM:       for.end37:
2024; IS__TUNIT_NPM-NEXT:    ret void
2025;
2026; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2
2027; IS__CGSCC_OPM-SAME: (i8* [[BYTES:%.*]]) {
2028; IS__CGSCC_OPM-NEXT:  entry:
2029; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND:%.*]]
2030; IS__CGSCC_OPM:       for.cond:
2031; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
2032; IS__CGSCC_OPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
2033; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
2034; IS__CGSCC_OPM:       for.cond.cleanup:
2035; IS__CGSCC_OPM-NEXT:    br label [[FOR_END:%.*]]
2036; IS__CGSCC_OPM:       for.body:
2037; IS__CGSCC_OPM-NEXT:    [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
2038; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]]
2039; IS__CGSCC_OPM-NEXT:    store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA15]]
2040; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC]]
2041; IS__CGSCC_OPM:       for.inc:
2042; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
2043; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]]
2044; IS__CGSCC_OPM:       for.end:
2045; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND2:%.*]]
2046; IS__CGSCC_OPM:       for.cond2:
2047; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
2048; IS__CGSCC_OPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
2049; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
2050; IS__CGSCC_OPM:       for.cond.cleanup4:
2051; IS__CGSCC_OPM-NEXT:    br label [[FOR_END11:%.*]]
2052; IS__CGSCC_OPM:       for.body5:
2053; IS__CGSCC_OPM-NEXT:    [[I15:%.*]] = bitcast i8* [[BYTES]] to float*
2054; IS__CGSCC_OPM-NEXT:    [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
2055; IS__CGSCC_OPM-NEXT:    [[I17:%.*]] = or i64 [[I16]], 1
2056; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]]
2057; IS__CGSCC_OPM-NEXT:    store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
2058; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC9]]
2059; IS__CGSCC_OPM:       for.inc9:
2060; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
2061; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP29:![0-9]+]]
2062; IS__CGSCC_OPM:       for.end11:
2063; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND13:%.*]]
2064; IS__CGSCC_OPM:       for.cond13:
2065; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
2066; IS__CGSCC_OPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
2067; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
2068; IS__CGSCC_OPM:       for.cond.cleanup15:
2069; IS__CGSCC_OPM-NEXT:    br label [[FOR_END23:%.*]]
2070; IS__CGSCC_OPM:       for.body16:
2071; IS__CGSCC_OPM-NEXT:    [[I18:%.*]] = bitcast i8* [[BYTES]] to i64*
2072; IS__CGSCC_OPM-NEXT:    [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
2073; IS__CGSCC_OPM-NEXT:    [[I20:%.*]] = add nuw nsw i64 [[I19]], 2
2074; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]]
2075; IS__CGSCC_OPM-NEXT:    store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA20]]
2076; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC21]]
2077; IS__CGSCC_OPM:       for.inc21:
2078; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
2079; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]]
2080; IS__CGSCC_OPM:       for.end23:
2081; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023
2082; IS__CGSCC_OPM-NEXT:    store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]]
2083; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500
2084; IS__CGSCC_OPM-NEXT:    [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32*
2085; IS__CGSCC_OPM-NEXT:    call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR15]]
2086; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND27:%.*]]
2087; IS__CGSCC_OPM:       for.cond27:
2088; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ]
2089; IS__CGSCC_OPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
2090; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]]
2091; IS__CGSCC_OPM:       for.cond.cleanup29:
2092; IS__CGSCC_OPM-NEXT:    br label [[FOR_END37:%.*]]
2093; IS__CGSCC_OPM:       for.body30:
2094; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]]
2095; IS__CGSCC_OPM-NEXT:    [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
2096; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
2097; IS__CGSCC_OPM-NEXT:    store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA15]]
2098; IS__CGSCC_OPM-NEXT:    br label [[FOR_INC35]]
2099; IS__CGSCC_OPM:       for.inc35:
2100; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
2101; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]]
2102; IS__CGSCC_OPM:       for.end37:
2103; IS__CGSCC_OPM-NEXT:    ret void
2104;
2105; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2
2106; IS__CGSCC_NPM-SAME: (i8* [[BYTES:%.*]]) {
2107; IS__CGSCC_NPM-NEXT:  entry:
2108; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND:%.*]]
2109; IS__CGSCC_NPM:       for.cond:
2110; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
2111; IS__CGSCC_NPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100
2112; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]]
2113; IS__CGSCC_NPM:       for.cond.cleanup:
2114; IS__CGSCC_NPM-NEXT:    br label [[FOR_END:%.*]]
2115; IS__CGSCC_NPM:       for.body:
2116; IS__CGSCC_NPM-NEXT:    [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
2117; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]]
2118; IS__CGSCC_NPM-NEXT:    store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA15]]
2119; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC]]
2120; IS__CGSCC_NPM:       for.inc:
2121; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
2122; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]]
2123; IS__CGSCC_NPM:       for.end:
2124; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND2:%.*]]
2125; IS__CGSCC_NPM:       for.cond2:
2126; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ]
2127; IS__CGSCC_NPM-NEXT:    [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10
2128; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]]
2129; IS__CGSCC_NPM:       for.cond.cleanup4:
2130; IS__CGSCC_NPM-NEXT:    br label [[FOR_END11:%.*]]
2131; IS__CGSCC_NPM:       for.body5:
2132; IS__CGSCC_NPM-NEXT:    [[I15:%.*]] = bitcast i8* [[BYTES]] to float*
2133; IS__CGSCC_NPM-NEXT:    [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
2134; IS__CGSCC_NPM-NEXT:    [[I17:%.*]] = or i64 [[I16]], 1
2135; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]]
2136; IS__CGSCC_NPM-NEXT:    store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
2137; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC9]]
2138; IS__CGSCC_NPM:       for.inc9:
2139; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
2140; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND2]], !llvm.loop [[LOOP29:![0-9]+]]
2141; IS__CGSCC_NPM:       for.end11:
2142; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND13:%.*]]
2143; IS__CGSCC_NPM:       for.cond13:
2144; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ]
2145; IS__CGSCC_NPM-NEXT:    [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20
2146; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]]
2147; IS__CGSCC_NPM:       for.cond.cleanup15:
2148; IS__CGSCC_NPM-NEXT:    br label [[FOR_END23:%.*]]
2149; IS__CGSCC_NPM:       for.body16:
2150; IS__CGSCC_NPM-NEXT:    [[I18:%.*]] = bitcast i8* [[BYTES]] to i64*
2151; IS__CGSCC_NPM-NEXT:    [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
2152; IS__CGSCC_NPM-NEXT:    [[I20:%.*]] = add nuw nsw i64 [[I19]], 2
2153; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]]
2154; IS__CGSCC_NPM-NEXT:    store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA20]]
2155; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC21]]
2156; IS__CGSCC_NPM:       for.inc21:
2157; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
2158; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]]
2159; IS__CGSCC_NPM:       for.end23:
2160; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023
2161; IS__CGSCC_NPM-NEXT:    store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]]
2162; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500
2163; IS__CGSCC_NPM-NEXT:    [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32*
2164; IS__CGSCC_NPM-NEXT:    call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR13]]
2165; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND27:%.*]]
2166; IS__CGSCC_NPM:       for.cond27:
2167; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ]
2168; IS__CGSCC_NPM-NEXT:    [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024
2169; IS__CGSCC_NPM-NEXT:    br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]]
2170; IS__CGSCC_NPM:       for.cond.cleanup29:
2171; IS__CGSCC_NPM-NEXT:    br label [[FOR_END37:%.*]]
2172; IS__CGSCC_NPM:       for.body30:
2173; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]]
2174; IS__CGSCC_NPM-NEXT:    [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
2175; IS__CGSCC_NPM-NEXT:    [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
2176; IS__CGSCC_NPM-NEXT:    store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA15]]
2177; IS__CGSCC_NPM-NEXT:    br label [[FOR_INC35]]
2178; IS__CGSCC_NPM:       for.inc35:
2179; IS__CGSCC_NPM-NEXT:    [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
2180; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]]
2181; IS__CGSCC_NPM:       for.end37:
2182; IS__CGSCC_NPM-NEXT:    ret void
2183;
2184entry:
2185  br label %for.cond
2186
2187for.cond:                                         ; preds = %for.inc, %entry
2188  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
2189  %exitcond = icmp ne i64 %indvars.iv, 100
2190  br i1 %exitcond, label %for.body, label %for.cond.cleanup
2191
2192for.cond.cleanup:                                 ; preds = %for.cond
2193  br label %for.end
2194
2195for.body:                                         ; preds = %for.cond
2196  %i = mul nuw nsw i64 %indvars.iv, 10
2197  %arrayidx = getelementptr inbounds i8, i8* %Bytes, i64 %i
2198  store i8 0, i8* %arrayidx, align 1, !tbaa !15
2199  br label %for.inc
2200
2201for.inc:                                          ; preds = %for.body
2202  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
2203  br label %for.cond, !llvm.loop !28
2204
2205for.end:                                          ; preds = %for.cond.cleanup
2206  br label %for.cond2
2207
2208for.cond2:                                        ; preds = %for.inc9, %for.end
2209  %indvars.iv2 = phi i64 [ %indvars.iv.next3, %for.inc9 ], [ 0, %for.end ]
2210  %exitcond6 = icmp ne i64 %indvars.iv2, 10
2211  br i1 %exitcond6, label %for.body5, label %for.cond.cleanup4
2212
2213for.cond.cleanup4:                                ; preds = %for.cond2
2214  br label %for.end11
2215
2216for.body5:                                        ; preds = %for.cond2
2217  %i15 = bitcast i8* %Bytes to float*
2218  %i16 = mul nuw nsw i64 %indvars.iv2, 10
2219  %i17 = or i64 %i16, 1
2220  %arrayidx8 = getelementptr inbounds float, float* %i15, i64 %i17
2221  store float 0.000000e+00, float* %arrayidx8, align 4, !tbaa !18
2222  br label %for.inc9
2223
2224for.inc9:                                         ; preds = %for.body5
2225  %indvars.iv.next3 = add nuw nsw i64 %indvars.iv2, 1
2226  br label %for.cond2, !llvm.loop !29
2227
2228for.end11:                                        ; preds = %for.cond.cleanup4
2229  br label %for.cond13
2230
2231for.cond13:                                       ; preds = %for.inc21, %for.end11
2232  %indvars.iv7 = phi i64 [ %indvars.iv.next8, %for.inc21 ], [ 0, %for.end11 ]
2233  %exitcond11 = icmp ne i64 %indvars.iv7, 20
2234  br i1 %exitcond11, label %for.body16, label %for.cond.cleanup15
2235
2236for.cond.cleanup15:                               ; preds = %for.cond13
2237  br label %for.end23
2238
2239for.body16:                                       ; preds = %for.cond13
2240  %i18 = bitcast i8* %Bytes to i64*
2241  %i19 = mul nuw nsw i64 %indvars.iv7, 10
2242  %i20 = add nuw nsw i64 %i19, 2
2243  %arrayidx20 = getelementptr inbounds i64, i64* %i18, i64 %i20
2244  store i64 0, i64* %arrayidx20, align 8, !tbaa !20
2245  br label %for.inc21
2246
2247for.inc21:                                        ; preds = %for.body16
2248  %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7, 1
2249  br label %for.cond13, !llvm.loop !30
2250
2251for.end23:                                        ; preds = %for.cond.cleanup15
2252  %arrayidx24 = getelementptr inbounds i8, i8* %Bytes, i64 1023
2253  store i8 0, i8* %arrayidx24, align 1, !tbaa !15
2254  %arrayidx25 = getelementptr inbounds i8, i8* %Bytes, i64 500
2255  %i21 = bitcast i8* %arrayidx25 to i32*
2256  call void @write_arg(i32* nonnull %i21, i32 0)
2257  br label %for.cond27
2258
2259for.cond27:                                       ; preds = %for.inc35, %for.end23
2260  %indvars.iv12 = phi i64 [ %indvars.iv.next13, %for.inc35 ], [ 0, %for.end23 ]
2261  %exitcond14 = icmp ne i64 %indvars.iv12, 1024
2262  br i1 %exitcond14, label %for.body30, label %for.cond.cleanup29
2263
2264for.cond.cleanup29:                               ; preds = %for.cond27
2265  br label %for.end37
2266
2267for.body30:                                       ; preds = %for.cond27
2268  %arrayidx32 = getelementptr inbounds i8, i8* %Bytes, i64 %indvars.iv12
2269  %i22 = load i8, i8* %arrayidx32, align 1, !tbaa !15
2270  %arrayidx34 = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 %indvars.iv12
2271  store i8 %i22, i8* %arrayidx34, align 1, !tbaa !15
2272  br label %for.inc35
2273
2274for.inc35:                                        ; preds = %for.body30
2275  %indvars.iv.next13 = add nuw nsw i64 %indvars.iv12, 1
2276  br label %for.cond27, !llvm.loop !31
2277
2278for.end37:                                        ; preds = %for.cond.cleanup29
2279  ret void
2280}
2281
2282;    int local_alloca_not_simplifiable_1() {
2283;      int X, Y, Z;
2284;      X = Y = 1;
2285;      escape(&X);
2286;      write_random(&Y);
2287;      Z = X ? 1 : 2;
2288;      return X + Y + Z;
2289;    }
2290;
2291define i32 @local_alloca_not_simplifiable_1() {
2292; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() {
2293; IS__TUNIT_OPM-NEXT:  entry:
2294; IS__TUNIT_OPM-NEXT:    [[X:%.*]] = alloca i32, align 4
2295; IS__TUNIT_OPM-NEXT:    [[Y:%.*]] = alloca i32, align 4
2296; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = bitcast i32* [[X]] to i8*
2297; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR14]]
2298; IS__TUNIT_OPM-NEXT:    [[I1:%.*]] = bitcast i32* [[Y]] to i8*
2299; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR14]]
2300; IS__TUNIT_OPM-NEXT:    store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2301; IS__TUNIT_OPM-NEXT:    store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]]
2302; IS__TUNIT_OPM-NEXT:    [[I2:%.*]] = bitcast i32* [[X]] to i8*
2303; IS__TUNIT_OPM-NEXT:    call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]])
2304; IS__TUNIT_OPM-NEXT:    call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]])
2305; IS__TUNIT_OPM-NEXT:    [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]]
2306; IS__TUNIT_OPM-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0
2307; IS__TUNIT_OPM-NEXT:    [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1
2308; IS__TUNIT_OPM-NEXT:    [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2309; IS__TUNIT_OPM-NEXT:    [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]]
2310; IS__TUNIT_OPM-NEXT:    [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]]
2311; IS__TUNIT_OPM-NEXT:    [[I5:%.*]] = bitcast i32* [[Y]] to i8*
2312; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]])
2313; IS__TUNIT_OPM-NEXT:    [[I6:%.*]] = bitcast i32* [[X]] to i8*
2314; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]])
2315; IS__TUNIT_OPM-NEXT:    ret i32 [[ADD1]]
2316;
2317; IS________NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() {
2318; IS________NPM-NEXT:  entry:
2319; IS________NPM-NEXT:    [[X:%.*]] = alloca i32, align 4
2320; IS________NPM-NEXT:    [[Y:%.*]] = alloca i32, align 4
2321; IS________NPM-NEXT:    [[I:%.*]] = bitcast i32* [[X]] to i8*
2322; IS________NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11:[0-9]+]]
2323; IS________NPM-NEXT:    [[I1:%.*]] = bitcast i32* [[Y]] to i8*
2324; IS________NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]]
2325; IS________NPM-NEXT:    store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2326; IS________NPM-NEXT:    store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]]
2327; IS________NPM-NEXT:    [[I2:%.*]] = bitcast i32* [[X]] to i8*
2328; IS________NPM-NEXT:    call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]])
2329; IS________NPM-NEXT:    call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]])
2330; IS________NPM-NEXT:    [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]]
2331; IS________NPM-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0
2332; IS________NPM-NEXT:    [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1
2333; IS________NPM-NEXT:    [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2334; IS________NPM-NEXT:    [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]]
2335; IS________NPM-NEXT:    [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]]
2336; IS________NPM-NEXT:    [[I5:%.*]] = bitcast i32* [[Y]] to i8*
2337; IS________NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]])
2338; IS________NPM-NEXT:    [[I6:%.*]] = bitcast i32* [[X]] to i8*
2339; IS________NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]])
2340; IS________NPM-NEXT:    ret i32 [[ADD1]]
2341;
2342; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() {
2343; IS__CGSCC_OPM-NEXT:  entry:
2344; IS__CGSCC_OPM-NEXT:    [[X:%.*]] = alloca i32, align 4
2345; IS__CGSCC_OPM-NEXT:    [[Y:%.*]] = alloca i32, align 4
2346; IS__CGSCC_OPM-NEXT:    [[I:%.*]] = bitcast i32* [[X]] to i8*
2347; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR13]]
2348; IS__CGSCC_OPM-NEXT:    [[I1:%.*]] = bitcast i32* [[Y]] to i8*
2349; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR13]]
2350; IS__CGSCC_OPM-NEXT:    store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2351; IS__CGSCC_OPM-NEXT:    store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]]
2352; IS__CGSCC_OPM-NEXT:    [[I2:%.*]] = bitcast i32* [[X]] to i8*
2353; IS__CGSCC_OPM-NEXT:    call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]])
2354; IS__CGSCC_OPM-NEXT:    call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]])
2355; IS__CGSCC_OPM-NEXT:    [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]]
2356; IS__CGSCC_OPM-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0
2357; IS__CGSCC_OPM-NEXT:    [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1
2358; IS__CGSCC_OPM-NEXT:    [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]]
2359; IS__CGSCC_OPM-NEXT:    [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]]
2360; IS__CGSCC_OPM-NEXT:    [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]]
2361; IS__CGSCC_OPM-NEXT:    [[I5:%.*]] = bitcast i32* [[Y]] to i8*
2362; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]])
2363; IS__CGSCC_OPM-NEXT:    [[I6:%.*]] = bitcast i32* [[X]] to i8*
2364; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]])
2365; IS__CGSCC_OPM-NEXT:    ret i32 [[ADD1]]
2366;
2367entry:
2368  %X = alloca i32, align 4
2369  %Y = alloca i32, align 4
2370  %i = bitcast i32* %X to i8*
2371  call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i)
2372  %i1 = bitcast i32* %Y to i8*
2373  call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i1)
2374  store i32 1, i32* %Y, align 4, !tbaa !3
2375  store i32 1, i32* %X, align 4, !tbaa !3
2376  %i2 = bitcast i32* %X to i8*
2377  call void @escape(i8* nonnull %i2)
2378  call void @write_random(i32* nonnull %Y)
2379  %i3 = load i32, i32* %X, align 4, !tbaa !3
2380  %tobool.not = icmp eq i32 %i3, 0
2381  %cond = select i1 %tobool.not, i32 2, i32 1
2382  %i4 = load i32, i32* %Y, align 4, !tbaa !3
2383  %add = add nsw i32 %i3, %i4
2384  %add1 = add nsw i32 %add, %cond
2385  %i5 = bitcast i32* %Y to i8*
2386  call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i5)
2387  %i6 = bitcast i32* %X to i8*
2388  call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i6)
2389  ret i32 %add1
2390}
2391
2392; We could simplify these if we separate accessed bins wrt. alignment (here mod 4).
2393define i32 @unknown_access_mixed_simplifiable(i32 %arg1, i32 %arg2) {
2394; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2395; IS__TUNIT____-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable
2396; IS__TUNIT____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR3]] {
2397; IS__TUNIT____-NEXT:  entry:
2398; IS__TUNIT____-NEXT:    [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4
2399; IS__TUNIT____-NEXT:    [[BC:%.*]] = bitcast %struct.S* [[S]] to i32*
2400; IS__TUNIT____-NEXT:    [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
2401; IS__TUNIT____-NEXT:    [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]]
2402; IS__TUNIT____-NEXT:    [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]]
2403; IS__TUNIT____-NEXT:    store i32 7, i32* [[GEP1]], align 4
2404; IS__TUNIT____-NEXT:    store i32 7, i32* [[GEP2]], align 4
2405; IS__TUNIT____-NEXT:    store i32 7, i32* [[GEP3]], align 4
2406; IS__TUNIT____-NEXT:    [[L1:%.*]] = load i32, i32* [[GEP1]], align 4
2407; IS__TUNIT____-NEXT:    [[L2:%.*]] = load i32, i32* [[GEP2]], align 4
2408; IS__TUNIT____-NEXT:    [[L3:%.*]] = load i32, i32* [[GEP3]], align 4
2409; IS__TUNIT____-NEXT:    [[ADD1:%.*]] = add i32 [[L1]], [[L2]]
2410; IS__TUNIT____-NEXT:    [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]]
2411; IS__TUNIT____-NEXT:    ret i32 [[ADD2]]
2412;
2413; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2414; IS__CGSCC____-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable
2415; IS__CGSCC____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR2]] {
2416; IS__CGSCC____-NEXT:  entry:
2417; IS__CGSCC____-NEXT:    [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4
2418; IS__CGSCC____-NEXT:    [[BC:%.*]] = bitcast %struct.S* [[S]] to i32*
2419; IS__CGSCC____-NEXT:    [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
2420; IS__CGSCC____-NEXT:    [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]]
2421; IS__CGSCC____-NEXT:    [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]]
2422; IS__CGSCC____-NEXT:    store i32 7, i32* [[GEP1]], align 4
2423; IS__CGSCC____-NEXT:    store i32 7, i32* [[GEP2]], align 4
2424; IS__CGSCC____-NEXT:    store i32 7, i32* [[GEP3]], align 4
2425; IS__CGSCC____-NEXT:    [[L1:%.*]] = load i32, i32* [[GEP1]], align 4
2426; IS__CGSCC____-NEXT:    [[L2:%.*]] = load i32, i32* [[GEP2]], align 4
2427; IS__CGSCC____-NEXT:    [[L3:%.*]] = load i32, i32* [[GEP3]], align 4
2428; IS__CGSCC____-NEXT:    [[ADD1:%.*]] = add i32 [[L1]], [[L2]]
2429; IS__CGSCC____-NEXT:    [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]]
2430; IS__CGSCC____-NEXT:    ret i32 [[ADD2]]
2431;
2432entry:
2433  %s = alloca %struct.S, align 4
2434  %bc = bitcast %struct.S* %s to i32*
2435  %gep1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
2436  %gep2 = getelementptr inbounds i32, i32* %bc, i32 %arg1
2437  %gep3 = getelementptr inbounds i32, i32* %bc, i32 %arg2
2438  store i32 7, i32* %gep1
2439  store i32 7, i32* %gep2
2440  store i32 7, i32* %gep3
2441  %l1 = load i32, i32* %gep1
2442  %l2 = load i32, i32* %gep2
2443  %l3 = load i32, i32* %gep3
2444  %add1 = add i32 %l1, %l2
2445  %add2 = add i32 %add1, %l3
2446  ret i32 %add2
2447}
2448
2449; The access to bc4b could go anywhere, nothing is simplifiable.
2450define i32 @unknown_access_mixed_not_simplifiable(i32 %arg1, i32 %arg2, i32 %arg3) {
2451; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2452; IS__TUNIT____-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable
2453; IS__TUNIT____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR3]] {
2454; IS__TUNIT____-NEXT:  entry:
2455; IS__TUNIT____-NEXT:    [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4
2456; IS__TUNIT____-NEXT:    [[BC:%.*]] = bitcast %struct.S* [[S]] to i32*
2457; IS__TUNIT____-NEXT:    [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
2458; IS__TUNIT____-NEXT:    [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]]
2459; IS__TUNIT____-NEXT:    [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]]
2460; IS__TUNIT____-NEXT:    [[BC4A:%.*]] = bitcast %struct.S* [[S]] to i8*
2461; IS__TUNIT____-NEXT:    [[GEP4:%.*]] = getelementptr inbounds i8, i8* [[BC4A]], i32 [[ARG3]]
2462; IS__TUNIT____-NEXT:    [[BC4B:%.*]] = bitcast i8* [[GEP4]] to i32*
2463; IS__TUNIT____-NEXT:    store i32 7, i32* [[GEP1]], align 4
2464; IS__TUNIT____-NEXT:    store i32 7, i32* [[GEP2]], align 4
2465; IS__TUNIT____-NEXT:    store i32 7, i32* [[GEP3]], align 4
2466; IS__TUNIT____-NEXT:    store i32 7, i32* [[BC4B]], align 4
2467; IS__TUNIT____-NEXT:    [[L1:%.*]] = load i32, i32* [[GEP1]], align 4
2468; IS__TUNIT____-NEXT:    [[L2:%.*]] = load i32, i32* [[GEP2]], align 4
2469; IS__TUNIT____-NEXT:    [[L3:%.*]] = load i32, i32* [[GEP3]], align 4
2470; IS__TUNIT____-NEXT:    [[L4:%.*]] = load i32, i32* [[BC4B]], align 4
2471; IS__TUNIT____-NEXT:    [[ADD1:%.*]] = add i32 [[L1]], [[L2]]
2472; IS__TUNIT____-NEXT:    [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]]
2473; IS__TUNIT____-NEXT:    [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]]
2474; IS__TUNIT____-NEXT:    ret i32 [[ADD3]]
2475;
2476; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2477; IS__CGSCC____-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable
2478; IS__CGSCC____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR2]] {
2479; IS__CGSCC____-NEXT:  entry:
2480; IS__CGSCC____-NEXT:    [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4
2481; IS__CGSCC____-NEXT:    [[BC:%.*]] = bitcast %struct.S* [[S]] to i32*
2482; IS__CGSCC____-NEXT:    [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
2483; IS__CGSCC____-NEXT:    [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]]
2484; IS__CGSCC____-NEXT:    [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]]
2485; IS__CGSCC____-NEXT:    [[BC4A:%.*]] = bitcast %struct.S* [[S]] to i8*
2486; IS__CGSCC____-NEXT:    [[GEP4:%.*]] = getelementptr inbounds i8, i8* [[BC4A]], i32 [[ARG3]]
2487; IS__CGSCC____-NEXT:    [[BC4B:%.*]] = bitcast i8* [[GEP4]] to i32*
2488; IS__CGSCC____-NEXT:    store i32 7, i32* [[GEP1]], align 4
2489; IS__CGSCC____-NEXT:    store i32 7, i32* [[GEP2]], align 4
2490; IS__CGSCC____-NEXT:    store i32 7, i32* [[GEP3]], align 4
2491; IS__CGSCC____-NEXT:    store i32 7, i32* [[BC4B]], align 4
2492; IS__CGSCC____-NEXT:    [[L1:%.*]] = load i32, i32* [[GEP1]], align 4
2493; IS__CGSCC____-NEXT:    [[L2:%.*]] = load i32, i32* [[GEP2]], align 4
2494; IS__CGSCC____-NEXT:    [[L3:%.*]] = load i32, i32* [[GEP3]], align 4
2495; IS__CGSCC____-NEXT:    [[L4:%.*]] = load i32, i32* [[BC4B]], align 4
2496; IS__CGSCC____-NEXT:    [[ADD1:%.*]] = add i32 [[L1]], [[L2]]
2497; IS__CGSCC____-NEXT:    [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]]
2498; IS__CGSCC____-NEXT:    [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]]
2499; IS__CGSCC____-NEXT:    ret i32 [[ADD3]]
2500;
2501entry:
2502  %s = alloca %struct.S, align 4
2503  %bc = bitcast %struct.S* %s to i32*
2504  %gep1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
2505  %gep2 = getelementptr inbounds i32, i32* %bc, i32 %arg1
2506  %gep3 = getelementptr inbounds i32, i32* %bc, i32 %arg2
2507  %bc4a = bitcast %struct.S* %s to i8*
2508  %gep4 = getelementptr inbounds i8, i8* %bc4a, i32 %arg3
2509  %bc4b = bitcast i8* %gep4 to i32*
2510  store i32 7, i32* %gep1
2511  store i32 7, i32* %gep2
2512  store i32 7, i32* %gep3
2513  store i32 7, i32* %bc4b
2514  %l1 = load i32, i32* %gep1
2515  %l2 = load i32, i32* %gep2
2516  %l3 = load i32, i32* %gep3
2517  %l4 = load i32, i32* %bc4b
2518  %add1 = add i32 %l1, %l2
2519  %add2 = add i32 %add1, %l3
2520  %add3 = add i32 %add2, %l4
2521  ret i32 %add3
2522}
2523
2524declare void @escape(i8*)
2525
2526;    int Flag0 = 0;
2527;    int global_not_simplifiable_1(int cnd) {
2528;      return Flag0;
2529;    }
2530;
2531define i32 @global_not_simplifiable_1(i32 %cnd) {
2532; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
2533; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1
2534; IS__TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR10:[0-9]+]] {
2535; IS__TUNIT_OPM-NEXT:  entry:
2536; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]]
2537; IS__TUNIT_OPM-NEXT:    ret i32 [[I]]
2538;
2539; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
2540; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1
2541; NOT_TUNIT_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] {
2542; NOT_TUNIT_OPM-NEXT:  entry:
2543; NOT_TUNIT_OPM-NEXT:    [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]]
2544; NOT_TUNIT_OPM-NEXT:    ret i32 [[I]]
2545;
2546entry:
2547  %i = load i32, i32* @Flag0, align 4, !tbaa !3
2548  ret i32 %i
2549}
2550
2551;    static int Flag1 __attribute__((loader_uninitialized));
2552;    int static_global_not_simplifiable_1(int cnd) {
2553;      int v = Flag1;
2554;      sync();
2555;      if (cnd)
2556;        Flag1 = 1;
2557;      return v;
2558;    }
2559;
2560define i32 @static_global_not_simplifiable_1(i32 %cnd) {
2561; CHECK-LABEL: define {{[^@]+}}@static_global_not_simplifiable_1
2562; CHECK-SAME: (i32 [[CND:%.*]]) {
2563; CHECK-NEXT:  entry:
2564; CHECK-NEXT:    call void @sync()
2565; CHECK-NEXT:    [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
2566; CHECK-NEXT:    br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
2567; CHECK:       if.then:
2568; CHECK-NEXT:    store i32 1, i32* @Flag1, align 4, !tbaa [[TBAA3]]
2569; CHECK-NEXT:    br label [[IF_END]]
2570; CHECK:       if.end:
2571; CHECK-NEXT:    ret i32 1
2572;
2573entry:
2574  %i = load i32, i32* @Flag1, align 4, !tbaa !3
2575  call void @sync()
2576  %tobool.not = icmp eq i32 %cnd, 0
2577  br i1 %tobool.not, label %if.end, label %if.then
2578
2579if.then:                                          ; preds = %entry
2580  store i32 1, i32* @Flag1, align 4, !tbaa !3
2581  br label %if.end
2582
2583if.end:                                           ; preds = %if.then, %entry
2584  ret i32 %i
2585}
2586
2587declare void @sync()
2588
2589;    static int Flag2 __attribute__((loader_uninitialized));
2590;    int static_global_not_simplifiable_2(int cnd) {
2591;      Flag2 = 1;
2592;      sync();
2593;      int v = Flag2;
2594;      Flag2 = 2;
2595;      return v;
2596;    }
2597define i32 @static_global_not_simplifiable_2(i32 %cnd) {
2598; CHECK-LABEL: define {{[^@]+}}@static_global_not_simplifiable_2
2599; CHECK-SAME: (i32 [[CND:%.*]]) {
2600; CHECK-NEXT:  entry:
2601; CHECK-NEXT:    store i32 1, i32* @Flag2, align 4, !tbaa [[TBAA3]]
2602; CHECK-NEXT:    call void @sync()
2603; CHECK-NEXT:    [[I:%.*]] = load i32, i32* @Flag2, align 4, !tbaa [[TBAA3]]
2604; CHECK-NEXT:    store i32 2, i32* @Flag2, align 4, !tbaa [[TBAA3]]
2605; CHECK-NEXT:    ret i32 [[I]]
2606;
2607entry:
2608  store i32 1, i32* @Flag2, align 4, !tbaa !3
2609  call void @sync()
2610  %i = load i32, i32* @Flag2, align 4, !tbaa !3
2611  store i32 2, i32* @Flag2, align 4, !tbaa !3
2612  ret i32 %i
2613}
2614
2615;    int write_read{,_static,_static_undef}_global(void) {
2616;      Gint{,static,_static_undef}1 = 7;
2617;      return Gint1;
2618;    }
2619;    void write{,_static,_static_undef}_global(void) {
2620;      Gint{,static,_static_undef}2 = 7;
2621;    }
2622;    int read{,_static,_static_undef}_global(void) {
2623;      return Gint{,static,_static_undef}2;
2624;    }
2625;
2626; FIXME: We could replace these loads.
2627define i32 @write_read_global() {
2628; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
2629; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_global
2630; IS__TUNIT_OPM-SAME: () #[[ATTR7]] {
2631; IS__TUNIT_OPM-NEXT:    store i32 7, i32* @Gint1, align 4
2632; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = load i32, i32* @Gint1, align 4
2633; IS__TUNIT_OPM-NEXT:    ret i32 [[L]]
2634;
2635; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
2636; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_global
2637; NOT_TUNIT_OPM-SAME: () #[[ATTR5]] {
2638; NOT_TUNIT_OPM-NEXT:    store i32 7, i32* @Gint1, align 4
2639; NOT_TUNIT_OPM-NEXT:    [[L:%.*]] = load i32, i32* @Gint1, align 4
2640; NOT_TUNIT_OPM-NEXT:    ret i32 [[L]]
2641;
2642  store i32 7, i32* @Gint1
2643  %l = load i32, i32* @Gint1
2644  ret i32 %l
2645}
2646define void @write_global() {
2647; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2648; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_global
2649; IS__TUNIT_OPM-SAME: () #[[ATTR5]] {
2650; IS__TUNIT_OPM-NEXT:    store i32 7, i32* @Gint2, align 4
2651; IS__TUNIT_OPM-NEXT:    ret void
2652;
2653; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2654; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@write_global
2655; NOT_TUNIT_OPM-SAME: () #[[ATTR4:[0-9]+]] {
2656; NOT_TUNIT_OPM-NEXT:    store i32 7, i32* @Gint2, align 4
2657; NOT_TUNIT_OPM-NEXT:    ret void
2658;
2659  store i32 7, i32* @Gint2
2660  ret void
2661}
2662define i32 @read_global() {
2663; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
2664; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@read_global
2665; IS__TUNIT_OPM-SAME: () #[[ATTR10]] {
2666; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = load i32, i32* @Gint2, align 4
2667; IS__TUNIT_OPM-NEXT:    ret i32 [[L]]
2668;
2669; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
2670; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@read_global
2671; NOT_TUNIT_OPM-SAME: () #[[ATTR7]] {
2672; NOT_TUNIT_OPM-NEXT:    [[L:%.*]] = load i32, i32* @Gint2, align 4
2673; NOT_TUNIT_OPM-NEXT:    ret i32 [[L]]
2674;
2675  %l = load i32, i32* @Gint2
2676  ret i32 %l
2677}
2678; FIXME: We could replace these loads.
2679define i32 @write_read_static_global() {
2680; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
2681; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_global
2682; IS__TUNIT_OPM-SAME: () #[[ATTR7]] {
2683; IS__TUNIT_OPM-NEXT:    store i32 7, i32* @Gstatic_int1, align 4
2684; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4
2685; IS__TUNIT_OPM-NEXT:    ret i32 [[L]]
2686;
2687; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
2688; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_global
2689; NOT_TUNIT_OPM-SAME: () #[[ATTR5]] {
2690; NOT_TUNIT_OPM-NEXT:    store i32 7, i32* @Gstatic_int1, align 4
2691; NOT_TUNIT_OPM-NEXT:    [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4
2692; NOT_TUNIT_OPM-NEXT:    ret i32 [[L]]
2693;
2694  store i32 7, i32* @Gstatic_int1
2695  %l = load i32, i32* @Gstatic_int1
2696  ret i32 %l
2697}
2698define void @write_static_global() {
2699; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2700; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_static_global
2701; IS__TUNIT_OPM-SAME: () #[[ATTR5]] {
2702; IS__TUNIT_OPM-NEXT:    store i32 7, i32* @Gstatic_int2, align 4
2703; IS__TUNIT_OPM-NEXT:    ret void
2704;
2705; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2706; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@write_static_global
2707; NOT_TUNIT_OPM-SAME: () #[[ATTR4]] {
2708; NOT_TUNIT_OPM-NEXT:    store i32 7, i32* @Gstatic_int2, align 4
2709; NOT_TUNIT_OPM-NEXT:    ret void
2710;
2711  store i32 7, i32* @Gstatic_int2
2712  ret void
2713}
2714define i32 @read_static_global() {
2715; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
2716; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@read_static_global
2717; IS__TUNIT_OPM-SAME: () #[[ATTR10]] {
2718; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4
2719; IS__TUNIT_OPM-NEXT:    ret i32 [[L]]
2720;
2721; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
2722; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@read_static_global
2723; NOT_TUNIT_OPM-SAME: () #[[ATTR7]] {
2724; NOT_TUNIT_OPM-NEXT:    [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4
2725; NOT_TUNIT_OPM-NEXT:    ret i32 [[L]]
2726;
2727  %l = load i32, i32* @Gstatic_int2
2728  ret i32 %l
2729}
2730define i32 @write_read_static_undef_global() {
2731; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2732; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_undef_global
2733; IS__TUNIT_OPM-SAME: () #[[ATTR5]] {
2734; IS__TUNIT_OPM-NEXT:    ret i32 7
2735;
2736; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2737; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@write_read_static_undef_global
2738; NOT_TUNIT_OPM-SAME: () #[[ATTR4]] {
2739; NOT_TUNIT_OPM-NEXT:    ret i32 7
2740;
2741  store i32 7, i32* @Gstatic_undef_int1
2742  %l = load i32, i32* @Gstatic_undef_int1
2743  ret i32 %l
2744}
2745define void @write_static_undef_global() {
2746; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2747; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@write_static_undef_global
2748; IS__TUNIT_OPM-SAME: () #[[ATTR5]] {
2749; IS__TUNIT_OPM-NEXT:    ret void
2750;
2751; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2752; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@write_static_undef_global
2753; IS__TUNIT_NPM-SAME: () #[[ATTR4]] {
2754; IS__TUNIT_NPM-NEXT:    ret void
2755;
2756; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
2757; IS__CGSCC____-LABEL: define {{[^@]+}}@write_static_undef_global
2758; IS__CGSCC____-SAME: () #[[ATTR4]] {
2759; IS__CGSCC____-NEXT:    store i32 7, i32* @Gstatic_undef_int2, align 4
2760; IS__CGSCC____-NEXT:    ret void
2761;
2762  store i32 7, i32* @Gstatic_undef_int2
2763  ret void
2764}
2765define i32 @read_static_undef_global() {
2766; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2767; IS__TUNIT____-LABEL: define {{[^@]+}}@read_static_undef_global
2768; IS__TUNIT____-SAME: () #[[ATTR3]] {
2769; IS__TUNIT____-NEXT:    ret i32 7
2770;
2771; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2772; IS__CGSCC____-LABEL: define {{[^@]+}}@read_static_undef_global
2773; IS__CGSCC____-SAME: () #[[ATTR2]] {
2774; IS__CGSCC____-NEXT:    ret i32 7
2775;
2776  %l = load i32, i32* @Gstatic_undef_int2
2777  ret i32 %l
2778}
2779
2780define i32 @single_read_of_static_global() {
2781; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2782; IS__TUNIT____-LABEL: define {{[^@]+}}@single_read_of_static_global
2783; IS__TUNIT____-SAME: () #[[ATTR3]] {
2784; IS__TUNIT____-NEXT:    ret i32 0
2785;
2786; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2787; IS__CGSCC____-LABEL: define {{[^@]+}}@single_read_of_static_global
2788; IS__CGSCC____-SAME: () #[[ATTR2]] {
2789; IS__CGSCC____-NEXT:    ret i32 0
2790;
2791  %l = load i32, i32* @Gstatic_int3
2792  ret i32 %l
2793}
2794
2795define i8 @phi_store() {
2796; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone
2797; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_store
2798; IS__TUNIT_OPM-SAME: () #[[ATTR11:[0-9]+]] {
2799; IS__TUNIT_OPM-NEXT:  entry:
2800; IS__TUNIT_OPM-NEXT:    [[A:%.*]] = alloca i16, align 2
2801; IS__TUNIT_OPM-NEXT:    [[B:%.*]] = bitcast i16* [[A]] to i8*
2802; IS__TUNIT_OPM-NEXT:    br label [[LOOP:%.*]]
2803; IS__TUNIT_OPM:       loop:
2804; IS__TUNIT_OPM-NEXT:    [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
2805; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2806; IS__TUNIT_OPM-NEXT:    [[G]] = getelementptr i8, i8* [[P]], i64 1
2807; IS__TUNIT_OPM-NEXT:    [[O]] = add nsw i8 [[I]], 1
2808; IS__TUNIT_OPM-NEXT:    [[C:%.*]] = icmp eq i8 [[O]], 2
2809; IS__TUNIT_OPM-NEXT:    br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2810; IS__TUNIT_OPM:       end:
2811; IS__TUNIT_OPM-NEXT:    [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1
2812; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = load i8, i8* [[S]], align 1
2813; IS__TUNIT_OPM-NEXT:    ret i8 [[L]]
2814;
2815; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2816; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@phi_store
2817; IS__TUNIT_NPM-SAME: () #[[ATTR3]] {
2818; IS__TUNIT_NPM-NEXT:  entry:
2819; IS__TUNIT_NPM-NEXT:    [[A:%.*]] = alloca i16, align 2
2820; IS__TUNIT_NPM-NEXT:    [[B:%.*]] = bitcast i16* [[A]] to i8*
2821; IS__TUNIT_NPM-NEXT:    br label [[LOOP:%.*]]
2822; IS__TUNIT_NPM:       loop:
2823; IS__TUNIT_NPM-NEXT:    [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
2824; IS__TUNIT_NPM-NEXT:    [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2825; IS__TUNIT_NPM-NEXT:    [[G]] = getelementptr i8, i8* [[P]], i64 1
2826; IS__TUNIT_NPM-NEXT:    [[O]] = add nsw i8 [[I]], 1
2827; IS__TUNIT_NPM-NEXT:    [[C:%.*]] = icmp eq i8 [[O]], 2
2828; IS__TUNIT_NPM-NEXT:    br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2829; IS__TUNIT_NPM:       end:
2830; IS__TUNIT_NPM-NEXT:    [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1
2831; IS__TUNIT_NPM-NEXT:    [[L:%.*]] = load i8, i8* [[S]], align 1
2832; IS__TUNIT_NPM-NEXT:    ret i8 [[L]]
2833;
2834; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone
2835; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_store
2836; IS__CGSCC_OPM-SAME: () #[[ATTR8:[0-9]+]] {
2837; IS__CGSCC_OPM-NEXT:  entry:
2838; IS__CGSCC_OPM-NEXT:    [[A:%.*]] = alloca i16, align 2
2839; IS__CGSCC_OPM-NEXT:    [[B:%.*]] = bitcast i16* [[A]] to i8*
2840; IS__CGSCC_OPM-NEXT:    br label [[LOOP:%.*]]
2841; IS__CGSCC_OPM:       loop:
2842; IS__CGSCC_OPM-NEXT:    [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
2843; IS__CGSCC_OPM-NEXT:    [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2844; IS__CGSCC_OPM-NEXT:    [[G]] = getelementptr i8, i8* [[P]], i64 1
2845; IS__CGSCC_OPM-NEXT:    [[O]] = add nsw i8 [[I]], 1
2846; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = icmp eq i8 [[O]], 2
2847; IS__CGSCC_OPM-NEXT:    br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2848; IS__CGSCC_OPM:       end:
2849; IS__CGSCC_OPM-NEXT:    [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1
2850; IS__CGSCC_OPM-NEXT:    [[L:%.*]] = load i8, i8* [[S]], align 1
2851; IS__CGSCC_OPM-NEXT:    ret i8 [[L]]
2852;
2853; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
2854; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@phi_store
2855; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
2856; IS__CGSCC_NPM-NEXT:  entry:
2857; IS__CGSCC_NPM-NEXT:    [[A:%.*]] = alloca i16, align 2
2858; IS__CGSCC_NPM-NEXT:    [[B:%.*]] = bitcast i16* [[A]] to i8*
2859; IS__CGSCC_NPM-NEXT:    br label [[LOOP:%.*]]
2860; IS__CGSCC_NPM:       loop:
2861; IS__CGSCC_NPM-NEXT:    [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
2862; IS__CGSCC_NPM-NEXT:    [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2863; IS__CGSCC_NPM-NEXT:    [[G]] = getelementptr i8, i8* [[P]], i64 1
2864; IS__CGSCC_NPM-NEXT:    [[O]] = add nsw i8 [[I]], 1
2865; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = icmp eq i8 [[O]], 2
2866; IS__CGSCC_NPM-NEXT:    br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2867; IS__CGSCC_NPM:       end:
2868; IS__CGSCC_NPM-NEXT:    [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1
2869; IS__CGSCC_NPM-NEXT:    [[L:%.*]] = load i8, i8* [[S]], align 1
2870; IS__CGSCC_NPM-NEXT:    ret i8 [[L]]
2871;
2872entry:
2873  %a = alloca i16
2874  %b = bitcast i16* %a to i8*
2875  br label %loop
2876loop:
2877  %p = phi i8* [%b, %entry], [%g, %loop]
2878  %i = phi i8 [0, %entry], [%o, %loop]
2879  store i8 1, i8* %p
2880  %g = getelementptr i8, i8* %p, i64 1
2881  %o = add nsw i8 %i, 1
2882  %c = icmp eq i8 %o, 2
2883  br i1 %c, label %end, label %loop
2884end:
2885  %s = getelementptr i8, i8* %b, i64 1
2886  %l = load i8, i8* %s
2887  ret i8 %l
2888}
2889
2890; FIXME: This function returns 1.
2891define i8 @phi_no_store_1() {
2892; IS________OPM: Function Attrs: nofree norecurse nosync nounwind
2893; IS________OPM-LABEL: define {{[^@]+}}@phi_no_store_1
2894; IS________OPM-SAME: () #[[ATTR9:[0-9]+]] {
2895; IS________OPM-NEXT:  entry:
2896; IS________OPM-NEXT:    br label [[LOOP:%.*]]
2897; IS________OPM:       loop:
2898; IS________OPM-NEXT:    [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
2899; IS________OPM-NEXT:    [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2900; IS________OPM-NEXT:    [[G]] = getelementptr i8, i8* [[P]], i64 1
2901; IS________OPM-NEXT:    [[O]] = add nsw i8 [[I]], 1
2902; IS________OPM-NEXT:    [[C:%.*]] = icmp eq i8 [[O]], 3
2903; IS________OPM-NEXT:    br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2904; IS________OPM:       end:
2905; IS________OPM-NEXT:    [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2
2906; IS________OPM-NEXT:    [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1
2907; IS________OPM-NEXT:    [[ADD:%.*]] = add i8 [[L11]], [[L12]]
2908; IS________OPM-NEXT:    ret i8 [[ADD]]
2909;
2910; IS________NPM: Function Attrs: nofree norecurse nosync nounwind willreturn
2911; IS________NPM-LABEL: define {{[^@]+}}@phi_no_store_1
2912; IS________NPM-SAME: () #[[ATTR5]] {
2913; IS________NPM-NEXT:  entry:
2914; IS________NPM-NEXT:    br label [[LOOP:%.*]]
2915; IS________NPM:       loop:
2916; IS________NPM-NEXT:    [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
2917; IS________NPM-NEXT:    [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2918; IS________NPM-NEXT:    [[G]] = getelementptr i8, i8* [[P]], i64 1
2919; IS________NPM-NEXT:    [[O]] = add nsw i8 [[I]], 1
2920; IS________NPM-NEXT:    [[C:%.*]] = icmp eq i8 [[O]], 3
2921; IS________NPM-NEXT:    br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2922; IS________NPM:       end:
2923; IS________NPM-NEXT:    [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2
2924; IS________NPM-NEXT:    [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1
2925; IS________NPM-NEXT:    [[ADD:%.*]] = add i8 [[L11]], [[L12]]
2926; IS________NPM-NEXT:    ret i8 [[ADD]]
2927;
2928entry:
2929  %b = bitcast i32* @a1 to i8*
2930  br label %loop
2931loop:
2932  %p = phi i8* [%b, %entry], [%g, %loop]
2933  %i = phi i8 [0, %entry], [%o, %loop]
2934  store i8 1, i8* %p
2935  %g = getelementptr i8, i8* %p, i64 1
2936  %o = add nsw i8 %i, 1
2937  %c = icmp eq i8 %o, 3
2938  br i1 %c, label %end, label %loop
2939end:
2940  %s11 = getelementptr i8, i8* %b, i64 2
2941  %l11 = load i8, i8* %s11
2942  %s12 = getelementptr i8, i8* %b, i64 3
2943  %l12 = load i8, i8* %s12
2944  %add = add i8 %l11, %l12
2945  ret i8 %add
2946}
2947
2948; FIXME: This function returns 1.
2949define i8 @phi_no_store_2() {
2950; IS________OPM: Function Attrs: nofree norecurse nosync nounwind
2951; IS________OPM-LABEL: define {{[^@]+}}@phi_no_store_2
2952; IS________OPM-SAME: () #[[ATTR9]] {
2953; IS________OPM-NEXT:  entry:
2954; IS________OPM-NEXT:    br label [[LOOP:%.*]]
2955; IS________OPM:       loop:
2956; IS________OPM-NEXT:    [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ]
2957; IS________OPM-NEXT:    [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2958; IS________OPM-NEXT:    store i8 1, i8* [[P]], align 2
2959; IS________OPM-NEXT:    [[O]] = add nsw i8 [[I]], 1
2960; IS________OPM-NEXT:    [[C:%.*]] = icmp eq i8 [[O]], 7
2961; IS________OPM-NEXT:    br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2962; IS________OPM:       end:
2963; IS________OPM-NEXT:    [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2
2964; IS________OPM-NEXT:    [[ADD:%.*]] = add i8 [[L21]], 0
2965; IS________OPM-NEXT:    ret i8 [[ADD]]
2966;
2967; IS________NPM: Function Attrs: nofree norecurse nosync nounwind willreturn
2968; IS________NPM-LABEL: define {{[^@]+}}@phi_no_store_2
2969; IS________NPM-SAME: () #[[ATTR5]] {
2970; IS________NPM-NEXT:  entry:
2971; IS________NPM-NEXT:    br label [[LOOP:%.*]]
2972; IS________NPM:       loop:
2973; IS________NPM-NEXT:    [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), [[LOOP]] ]
2974; IS________NPM-NEXT:    [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
2975; IS________NPM-NEXT:    store i8 1, i8* [[P]], align 2
2976; IS________NPM-NEXT:    [[O]] = add nsw i8 [[I]], 1
2977; IS________NPM-NEXT:    [[C:%.*]] = icmp eq i8 [[O]], 7
2978; IS________NPM-NEXT:    br i1 [[C]], label [[END:%.*]], label [[LOOP]]
2979; IS________NPM:       end:
2980; IS________NPM-NEXT:    [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2
2981; IS________NPM-NEXT:    [[ADD:%.*]] = add i8 [[L21]], 0
2982; IS________NPM-NEXT:    ret i8 [[ADD]]
2983;
2984entry:
2985  %b = bitcast i32* @a2 to i8*
2986  br label %loop
2987loop:
2988  %p = phi i8* [%b, %entry], [%g, %loop]
2989  %i = phi i8 [0, %entry], [%o, %loop]
2990  store i8 1, i8* %p
2991  %g = getelementptr i8, i8* %b, i64 2
2992  %o = add nsw i8 %i, 1
2993  %c = icmp eq i8 %o, 7
2994  br i1 %c, label %end, label %loop
2995end:
2996  %s21 = getelementptr i8, i8* %b, i64 2
2997  %l21 = load i8, i8* %s21
2998  %s22 = getelementptr i8, i8* %b, i64 3
2999  %l22 = load i8, i8* %s22
3000  %add = add i8 %l21, %l22
3001  ret i8 %add
3002}
3003
3004define i8 @phi_no_store_3() {
3005; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly
3006; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@phi_no_store_3
3007; IS__TUNIT_OPM-SAME: () #[[ATTR6]] {
3008; IS__TUNIT_OPM-NEXT:  entry:
3009; IS__TUNIT_OPM-NEXT:    br label [[LOOP:%.*]]
3010; IS__TUNIT_OPM:       loop:
3011; IS__TUNIT_OPM-NEXT:    [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ]
3012; IS__TUNIT_OPM-NEXT:    [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3013; IS__TUNIT_OPM-NEXT:    [[O]] = add nsw i8 [[I]], 1
3014; IS__TUNIT_OPM-NEXT:    [[C:%.*]] = icmp eq i8 [[O]], 7
3015; IS__TUNIT_OPM-NEXT:    br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3016; IS__TUNIT_OPM:       end:
3017; IS__TUNIT_OPM-NEXT:    ret i8 1
3018;
3019; IS________NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
3020; IS________NPM-LABEL: define {{[^@]+}}@phi_no_store_3
3021; IS________NPM-SAME: () #[[ATTR4]] {
3022; IS________NPM-NEXT:  entry:
3023; IS________NPM-NEXT:    br label [[LOOP:%.*]]
3024; IS________NPM:       loop:
3025; IS________NPM-NEXT:    [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ]
3026; IS________NPM-NEXT:    [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3027; IS________NPM-NEXT:    [[O]] = add nsw i8 [[I]], 1
3028; IS________NPM-NEXT:    [[C:%.*]] = icmp eq i8 [[O]], 7
3029; IS________NPM-NEXT:    br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3030; IS________NPM:       end:
3031; IS________NPM-NEXT:    ret i8 1
3032;
3033; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly
3034; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@phi_no_store_3
3035; IS__CGSCC_OPM-SAME: () #[[ATTR10:[0-9]+]] {
3036; IS__CGSCC_OPM-NEXT:  entry:
3037; IS__CGSCC_OPM-NEXT:    br label [[LOOP:%.*]]
3038; IS__CGSCC_OPM:       loop:
3039; IS__CGSCC_OPM-NEXT:    [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), [[LOOP]] ]
3040; IS__CGSCC_OPM-NEXT:    [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
3041; IS__CGSCC_OPM-NEXT:    [[O]] = add nsw i8 [[I]], 1
3042; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = icmp eq i8 [[O]], 7
3043; IS__CGSCC_OPM-NEXT:    br i1 [[C]], label [[END:%.*]], label [[LOOP]]
3044; IS__CGSCC_OPM:       end:
3045; IS__CGSCC_OPM-NEXT:    ret i8 1
3046;
3047entry:
3048  %b = bitcast i32* @a3 to i8*
3049  %s30 = getelementptr i8, i8* %b, i64 3
3050  store i8 0, i8* %s30
3051  br label %loop
3052loop:
3053  %p = phi i8* [%b, %entry], [%g, %loop]
3054  %i = phi i8 [0, %entry], [%o, %loop]
3055  store i8 1, i8* %p
3056  %g = getelementptr i8, i8* %b, i64 2
3057  %o = add nsw i8 %i, 1
3058  %c = icmp eq i8 %o, 7
3059  br i1 %c, label %end, label %loop
3060end:
3061  %s31 = getelementptr i8, i8* %b, i64 2
3062  %l31 = load i8, i8* %s31
3063  %s32 = getelementptr i8, i8* %b, i64 3
3064  %l32 = load i8, i8* %s32
3065  %add = add i8 %l31, %l32
3066  ret i8 %add
3067}
3068
3069define i8 @cast_and_load_1() {
3070; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
3071; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_1
3072; IS__TUNIT_OPM-SAME: () #[[ATTR7]] {
3073; IS__TUNIT_OPM-NEXT:    store i32 42, i32* @bytes1, align 4
3074; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4
3075; IS__TUNIT_OPM-NEXT:    ret i8 [[L]]
3076;
3077; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
3078; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_1
3079; NOT_TUNIT_OPM-SAME: () #[[ATTR5]] {
3080; NOT_TUNIT_OPM-NEXT:    store i32 42, i32* @bytes1, align 4
3081; NOT_TUNIT_OPM-NEXT:    [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4
3082; NOT_TUNIT_OPM-NEXT:    ret i8 [[L]]
3083;
3084  store i32 42, i32* @bytes1
3085  %bc = bitcast i32* @bytes1 to i8*
3086  %l = load i8, i8* %bc
3087  ret i8 %l
3088}
3089
3090define i64 @cast_and_load_2() {
3091; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
3092; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_2
3093; IS__TUNIT_OPM-SAME: () #[[ATTR7]] {
3094; IS__TUNIT_OPM-NEXT:    store i32 42, i32* @bytes2, align 4
3095; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4
3096; IS__TUNIT_OPM-NEXT:    ret i64 [[L]]
3097;
3098; NOT_TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
3099; NOT_TUNIT_OPM-LABEL: define {{[^@]+}}@cast_and_load_2
3100; NOT_TUNIT_OPM-SAME: () #[[ATTR5]] {
3101; NOT_TUNIT_OPM-NEXT:    store i32 42, i32* @bytes2, align 4
3102; NOT_TUNIT_OPM-NEXT:    [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4
3103; NOT_TUNIT_OPM-NEXT:    ret i64 [[L]]
3104;
3105  store i32 42, i32* @bytes2
3106  %bc = bitcast i32* @bytes2 to i64*
3107  %l = load i64, i64* %bc
3108  ret i64 %l
3109}
3110
3111define void @recursive_load_store(i64 %N, i32 %v) {
3112; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly
3113; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@recursive_load_store
3114; IS__TUNIT_OPM-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR6]] {
3115; IS__TUNIT_OPM-NEXT:  entry:
3116; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND:%.*]]
3117; IS__TUNIT_OPM:       for.cond:
3118; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ]
3119; IS__TUNIT_OPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]]
3120; IS__TUNIT_OPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]]
3121; IS__TUNIT_OPM:       for.body:
3122; IS__TUNIT_OPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
3123; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND]]
3124; IS__TUNIT_OPM:       for.end:
3125; IS__TUNIT_OPM-NEXT:    ret void
3126;
3127; IS________NPM: Function Attrs: nofree norecurse nosync nounwind writeonly
3128; IS________NPM-LABEL: define {{[^@]+}}@recursive_load_store
3129; IS________NPM-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR8:[0-9]+]] {
3130; IS________NPM-NEXT:  entry:
3131; IS________NPM-NEXT:    br label [[FOR_COND:%.*]]
3132; IS________NPM:       for.cond:
3133; IS________NPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ]
3134; IS________NPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]]
3135; IS________NPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]]
3136; IS________NPM:       for.body:
3137; IS________NPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
3138; IS________NPM-NEXT:    br label [[FOR_COND]]
3139; IS________NPM:       for.end:
3140; IS________NPM-NEXT:    ret void
3141;
3142; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly
3143; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@recursive_load_store
3144; IS__CGSCC_OPM-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR10]] {
3145; IS__CGSCC_OPM-NEXT:  entry:
3146; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND:%.*]]
3147; IS__CGSCC_OPM:       for.cond:
3148; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY:%.*]] ], [ 0, [[ENTRY:%.*]] ]
3149; IS__CGSCC_OPM-NEXT:    [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], [[N]]
3150; IS__CGSCC_OPM-NEXT:    br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_END:%.*]]
3151; IS__CGSCC_OPM:       for.body:
3152; IS__CGSCC_OPM-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
3153; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND]]
3154; IS__CGSCC_OPM:       for.end:
3155; IS__CGSCC_OPM-NEXT:    ret void
3156;
3157entry:
3158  store i32 %v, i32* @rec_storage
3159  br label %for.cond
3160
3161for.cond:
3162  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
3163  %exitcond = icmp ne i64 %indvars.iv, %N
3164  br i1 %exitcond, label %for.body, label %for.end
3165
3166for.body:
3167  %ll = load i32, i32* @rec_storage
3168  store i32 %ll, i32* @rec_storage
3169  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
3170  br label %for.cond
3171
3172for.end:
3173  %lr = load i32, i32* @rec_storage
3174  store i32 %lr, i32* @rec_storage
3175  ret void
3176}
3177
3178define dso_local i32 @round_trip_malloc(i32 %x) {
3179; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_malloc
3180; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) {
3181; IS__TUNIT_OPM-NEXT:  entry:
3182; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR17:[0-9]+]]
3183; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3184; IS__TUNIT_OPM-NEXT:    store i32 [[X]], i32* [[TMP0]], align 4
3185; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3186; IS__TUNIT_OPM-NEXT:    call void @free(i8* noundef [[CALL]]) #[[ATTR17]]
3187; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP1]]
3188;
3189; IS________NPM-LABEL: define {{[^@]+}}@round_trip_malloc
3190; IS________NPM-SAME: (i32 [[X:%.*]]) {
3191; IS________NPM-NEXT:  entry:
3192; IS________NPM-NEXT:    [[TMP0:%.*]] = alloca i8, i64 4, align 1
3193; IS________NPM-NEXT:    [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32*
3194; IS________NPM-NEXT:    store i32 [[X]], i32* [[TMP1]], align 4
3195; IS________NPM-NEXT:    [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4
3196; IS________NPM-NEXT:    ret i32 [[TMP2]]
3197;
3198; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_malloc
3199; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) {
3200; IS__CGSCC_OPM-NEXT:  entry:
3201; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR16:[0-9]+]]
3202; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3203; IS__CGSCC_OPM-NEXT:    store i32 [[X]], i32* [[TMP0]], align 4
3204; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3205; IS__CGSCC_OPM-NEXT:    call void @free(i8* noundef [[CALL]]) #[[ATTR16]]
3206; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP1]]
3207;
3208entry:
3209  %call = call noalias i8* @malloc(i64 4) norecurse
3210  %0 = bitcast i8* %call to i32*
3211  store i32 %x, i32* %0, align 4
3212  %1 = load i32, i32* %0, align 4
3213  %2 = bitcast i32* %0 to i8*
3214  call void @free(i8* %2) norecurse
3215  ret i32 %1
3216}
3217
3218define dso_local i32 @round_trip_malloc_constant() {
3219; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_malloc_constant() {
3220; IS__TUNIT_OPM-NEXT:  entry:
3221; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR17]]
3222; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3223; IS__TUNIT_OPM-NEXT:    store i32 7, i32* [[TMP0]], align 4
3224; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3225; IS__TUNIT_OPM-NEXT:    call void @free(i8* noundef [[CALL]]) #[[ATTR17]]
3226; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP1]]
3227;
3228; IS________NPM-LABEL: define {{[^@]+}}@round_trip_malloc_constant() {
3229; IS________NPM-NEXT:  entry:
3230; IS________NPM-NEXT:    ret i32 7
3231;
3232; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_malloc_constant() {
3233; IS__CGSCC_OPM-NEXT:  entry:
3234; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR16]]
3235; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3236; IS__CGSCC_OPM-NEXT:    store i32 7, i32* [[TMP0]], align 4
3237; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3238; IS__CGSCC_OPM-NEXT:    call void @free(i8* noundef [[CALL]]) #[[ATTR16]]
3239; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP1]]
3240;
3241entry:
3242  %call = call noalias i8* @malloc(i64 4) norecurse
3243  %0 = bitcast i8* %call to i32*
3244  store i32 7, i32* %0, align 4
3245  %1 = load i32, i32* %0, align 4
3246  %2 = bitcast i32* %0 to i8*
3247  call void @free(i8* %2) norecurse
3248  ret i32 %1
3249}
3250
3251declare noalias i8* @malloc(i64)
3252
3253declare void @free(i8*)
3254
3255define dso_local i32 @conditional_malloc(i32 %x) {
3256; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@conditional_malloc
3257; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) {
3258; IS__TUNIT_OPM-NEXT:  entry:
3259; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR17]]
3260; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3261; IS__TUNIT_OPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
3262; IS__TUNIT_OPM-NEXT:    br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
3263; IS__TUNIT_OPM:       if.then:
3264; IS__TUNIT_OPM-NEXT:    store i32 [[X]], i32* [[TMP0]], align 4
3265; IS__TUNIT_OPM-NEXT:    br label [[IF_END]]
3266; IS__TUNIT_OPM:       if.end:
3267; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3268; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP1]]
3269;
3270; IS________NPM-LABEL: define {{[^@]+}}@conditional_malloc
3271; IS________NPM-SAME: (i32 [[X:%.*]]) {
3272; IS________NPM-NEXT:  entry:
3273; IS________NPM-NEXT:    [[TMP0:%.*]] = alloca i8, i64 4, align 1
3274; IS________NPM-NEXT:    [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32*
3275; IS________NPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
3276; IS________NPM-NEXT:    br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
3277; IS________NPM:       if.then:
3278; IS________NPM-NEXT:    store i32 [[X]], i32* [[TMP1]], align 4
3279; IS________NPM-NEXT:    br label [[IF_END]]
3280; IS________NPM:       if.end:
3281; IS________NPM-NEXT:    [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4
3282; IS________NPM-NEXT:    ret i32 [[TMP2]]
3283;
3284; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@conditional_malloc
3285; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) {
3286; IS__CGSCC_OPM-NEXT:  entry:
3287; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR16]]
3288; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3289; IS__CGSCC_OPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
3290; IS__CGSCC_OPM-NEXT:    br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
3291; IS__CGSCC_OPM:       if.then:
3292; IS__CGSCC_OPM-NEXT:    store i32 [[X]], i32* [[TMP0]], align 4
3293; IS__CGSCC_OPM-NEXT:    br label [[IF_END]]
3294; IS__CGSCC_OPM:       if.end:
3295; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3296; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP1]]
3297;
3298entry:
3299  %call = call noalias i8* @malloc(i64 4) norecurse
3300  %0 = bitcast i8* %call to i32*
3301  %tobool = icmp ne i32 %x, 0
3302  br i1 %tobool, label %if.then, label %if.end
3303
3304if.then:                                          ; preds = %entry
3305  store i32 %x, i32* %0, align 4
3306  br label %if.end
3307
3308if.end:                                           ; preds = %if.then, %entry
3309  %1 = load i32, i32* %0, align 4
3310  ret i32 %1
3311}
3312
3313define dso_local i32 @round_trip_calloc(i32 %x) {
3314; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_calloc
3315; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) {
3316; IS__TUNIT_OPM-NEXT:  entry:
3317; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 4, i64 noundef 1) #[[ATTR17]]
3318; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3319; IS__TUNIT_OPM-NEXT:    store i32 [[X]], i32* [[TMP0]], align 4
3320; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3321; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP1]]
3322;
3323; IS________NPM-LABEL: define {{[^@]+}}@round_trip_calloc
3324; IS________NPM-SAME: (i32 [[X:%.*]]) {
3325; IS________NPM-NEXT:  entry:
3326; IS________NPM-NEXT:    [[TMP0:%.*]] = alloca i8, i64 4, align 1
3327; IS________NPM-NEXT:    call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false)
3328; IS________NPM-NEXT:    [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32*
3329; IS________NPM-NEXT:    store i32 [[X]], i32* [[TMP1]], align 4
3330; IS________NPM-NEXT:    [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4
3331; IS________NPM-NEXT:    ret i32 [[TMP2]]
3332;
3333; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_calloc
3334; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) {
3335; IS__CGSCC_OPM-NEXT:  entry:
3336; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 4, i64 noundef 1) #[[ATTR16]]
3337; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3338; IS__CGSCC_OPM-NEXT:    store i32 [[X]], i32* [[TMP0]], align 4
3339; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3340; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP1]]
3341;
3342entry:
3343  %call = call noalias i8* @calloc(i64 4, i64 1) norecurse
3344  %0 = bitcast i8* %call to i32*
3345  store i32 %x, i32* %0, align 4
3346  %1 = load i32, i32* %0, align 4
3347  ret i32 %1
3348}
3349
3350define dso_local i32 @round_trip_calloc_constant() {
3351; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_calloc_constant() {
3352; IS__TUNIT_OPM-NEXT:  entry:
3353; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 4, i64 noundef 1) #[[ATTR17]]
3354; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3355; IS__TUNIT_OPM-NEXT:    store i32 11, i32* [[TMP0]], align 4
3356; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3357; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP1]]
3358;
3359; IS________NPM-LABEL: define {{[^@]+}}@round_trip_calloc_constant() {
3360; IS________NPM-NEXT:  entry:
3361; IS________NPM-NEXT:    [[TMP0:%.*]] = alloca i8, i64 4, align 1
3362; IS________NPM-NEXT:    call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false)
3363; IS________NPM-NEXT:    [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32*
3364; IS________NPM-NEXT:    store i32 11, i32* [[TMP1]], align 4
3365; IS________NPM-NEXT:    [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4
3366; IS________NPM-NEXT:    ret i32 [[TMP2]]
3367;
3368; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_calloc_constant() {
3369; IS__CGSCC_OPM-NEXT:  entry:
3370; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 4, i64 noundef 1) #[[ATTR16]]
3371; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3372; IS__CGSCC_OPM-NEXT:    store i32 11, i32* [[TMP0]], align 4
3373; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3374; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP1]]
3375;
3376entry:
3377  %call = call noalias i8* @calloc(i64 4, i64 1) norecurse
3378  %0 = bitcast i8* %call to i32*
3379  store i32 11, i32* %0, align 4
3380  %1 = load i32, i32* %0, align 4
3381  ret i32 %1
3382}
3383
3384declare noalias i8* @calloc(i64, i64)
3385
3386define dso_local i32 @conditional_calloc(i32 %x) {
3387; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@conditional_calloc
3388; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) {
3389; IS__TUNIT_OPM-NEXT:  entry:
3390; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 1, i64 noundef 4) #[[ATTR17]]
3391; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3392; IS__TUNIT_OPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
3393; IS__TUNIT_OPM-NEXT:    br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3394; IS__TUNIT_OPM:       if.then:
3395; IS__TUNIT_OPM-NEXT:    store i32 [[X]], i32* [[TMP0]], align 4
3396; IS__TUNIT_OPM-NEXT:    br label [[IF_END]]
3397; IS__TUNIT_OPM:       if.end:
3398; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3399; IS__TUNIT_OPM-NEXT:    [[TMP2:%.*]] = bitcast i32* [[TMP0]] to i8*
3400; IS__TUNIT_OPM-NEXT:    call void @free(i8* [[TMP2]]) #[[ATTR17]]
3401; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP1]]
3402;
3403; IS________NPM-LABEL: define {{[^@]+}}@conditional_calloc
3404; IS________NPM-SAME: (i32 [[X:%.*]]) {
3405; IS________NPM-NEXT:  entry:
3406; IS________NPM-NEXT:    [[TMP0:%.*]] = alloca i8, i64 4, align 1
3407; IS________NPM-NEXT:    call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false)
3408; IS________NPM-NEXT:    [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32*
3409; IS________NPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
3410; IS________NPM-NEXT:    br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3411; IS________NPM:       if.then:
3412; IS________NPM-NEXT:    store i32 [[X]], i32* [[TMP1]], align 4
3413; IS________NPM-NEXT:    br label [[IF_END]]
3414; IS________NPM:       if.end:
3415; IS________NPM-NEXT:    [[TMP2:%.*]] = load i32, i32* [[TMP1]], align 4
3416; IS________NPM-NEXT:    [[TMP3:%.*]] = bitcast i32* [[TMP1]] to i8*
3417; IS________NPM-NEXT:    ret i32 [[TMP2]]
3418;
3419; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@conditional_calloc
3420; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) {
3421; IS__CGSCC_OPM-NEXT:  entry:
3422; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 1, i64 noundef 4) #[[ATTR16]]
3423; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3424; IS__CGSCC_OPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
3425; IS__CGSCC_OPM-NEXT:    br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3426; IS__CGSCC_OPM:       if.then:
3427; IS__CGSCC_OPM-NEXT:    store i32 [[X]], i32* [[TMP0]], align 4
3428; IS__CGSCC_OPM-NEXT:    br label [[IF_END]]
3429; IS__CGSCC_OPM:       if.end:
3430; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3431; IS__CGSCC_OPM-NEXT:    [[TMP2:%.*]] = bitcast i32* [[TMP0]] to i8*
3432; IS__CGSCC_OPM-NEXT:    call void @free(i8* [[TMP2]]) #[[ATTR16]]
3433; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP1]]
3434;
3435entry:
3436  %call = call noalias i8* @calloc(i64 1, i64 4) norecurse
3437  %0 = bitcast i8* %call to i32*
3438  %tobool = icmp ne i32 %x, 0
3439  br i1 %tobool, label %if.end, label %if.then
3440
3441if.then:                                          ; preds = %entry
3442  store i32 %x, i32* %0, align 4
3443  br label %if.end
3444
3445if.end:                                           ; preds = %if.then, %entry
3446  %1 = load i32, i32* %0, align 4
3447  %2 = bitcast i32* %0 to i8*
3448  call void @free(i8* %2) norecurse
3449  ret i32 %1
3450}
3451
3452define dso_local i32 @conditional_calloc_zero(i1 %c) {
3453; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@conditional_calloc_zero
3454; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) {
3455; IS__TUNIT_OPM-NEXT:  entry:
3456; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 1, i64 noundef 4) #[[ATTR17]]
3457; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3458; IS__TUNIT_OPM-NEXT:    br i1 [[C]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3459; IS__TUNIT_OPM:       if.then:
3460; IS__TUNIT_OPM-NEXT:    store i32 0, i32* [[TMP0]], align 4
3461; IS__TUNIT_OPM-NEXT:    br label [[IF_END]]
3462; IS__TUNIT_OPM:       if.end:
3463; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3464; IS__TUNIT_OPM-NEXT:    [[TMP2:%.*]] = bitcast i32* [[TMP0]] to i8*
3465; IS__TUNIT_OPM-NEXT:    call void @free(i8* [[TMP2]]) #[[ATTR17]]
3466; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP1]]
3467;
3468; IS________NPM-LABEL: define {{[^@]+}}@conditional_calloc_zero
3469; IS________NPM-SAME: (i1 [[C:%.*]]) {
3470; IS________NPM-NEXT:  entry:
3471; IS________NPM-NEXT:    [[TMP0:%.*]] = alloca i8, i64 4, align 1
3472; IS________NPM-NEXT:    call void @llvm.memset.p0i8.i64(i8* [[TMP0]], i8 0, i64 4, i1 false)
3473; IS________NPM-NEXT:    [[TMP1:%.*]] = bitcast i8* [[TMP0]] to i32*
3474; IS________NPM-NEXT:    br i1 [[C]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3475; IS________NPM:       if.then:
3476; IS________NPM-NEXT:    br label [[IF_END]]
3477; IS________NPM:       if.end:
3478; IS________NPM-NEXT:    [[TMP2:%.*]] = bitcast i32* [[TMP1]] to i8*
3479; IS________NPM-NEXT:    ret i32 0
3480;
3481; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@conditional_calloc_zero
3482; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) {
3483; IS__CGSCC_OPM-NEXT:  entry:
3484; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @calloc(i64 noundef 1, i64 noundef 4) #[[ATTR16]]
3485; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3486; IS__CGSCC_OPM-NEXT:    br i1 [[C]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3487; IS__CGSCC_OPM:       if.then:
3488; IS__CGSCC_OPM-NEXT:    store i32 0, i32* [[TMP0]], align 4
3489; IS__CGSCC_OPM-NEXT:    br label [[IF_END]]
3490; IS__CGSCC_OPM:       if.end:
3491; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
3492; IS__CGSCC_OPM-NEXT:    [[TMP2:%.*]] = bitcast i32* [[TMP0]] to i8*
3493; IS__CGSCC_OPM-NEXT:    call void @free(i8* [[TMP2]]) #[[ATTR16]]
3494; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP1]]
3495;
3496entry:
3497  %call = call noalias i8* @calloc(i64 1, i64 4) norecurse
3498  %0 = bitcast i8* %call to i32*
3499  br i1 %c, label %if.end, label %if.then
3500
3501if.then:                                          ; preds = %entry
3502  store i32 0, i32* %0, align 4
3503  br label %if.end
3504
3505if.end:                                           ; preds = %if.then, %entry
3506  %1 = load i32, i32* %0, align 4
3507  %2 = bitcast i32* %0 to i8*
3508  call void @free(i8* %2) norecurse
3509  ret i32 %1
3510}
3511
3512define dso_local i32* @malloc_like(i32 %s) {
3513; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@malloc_like
3514; IS__TUNIT_OPM-SAME: (i32 [[S:%.*]]) {
3515; IS__TUNIT_OPM-NEXT:  entry:
3516; IS__TUNIT_OPM-NEXT:    [[CONV:%.*]] = sext i32 [[S]] to i64
3517; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR17]]
3518; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3519; IS__TUNIT_OPM-NEXT:    ret i32* [[TMP0]]
3520;
3521; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@malloc_like
3522; IS__TUNIT_NPM-SAME: (i32 [[S:%.*]]) {
3523; IS__TUNIT_NPM-NEXT:  entry:
3524; IS__TUNIT_NPM-NEXT:    [[CONV:%.*]] = sext i32 [[S]] to i64
3525; IS__TUNIT_NPM-NEXT:    [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR13:[0-9]+]]
3526; IS__TUNIT_NPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3527; IS__TUNIT_NPM-NEXT:    ret i32* [[TMP0]]
3528;
3529; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@malloc_like
3530; IS__CGSCC_OPM-SAME: (i32 [[S:%.*]]) {
3531; IS__CGSCC_OPM-NEXT:  entry:
3532; IS__CGSCC_OPM-NEXT:    [[CONV:%.*]] = sext i32 [[S]] to i64
3533; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR16]]
3534; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3535; IS__CGSCC_OPM-NEXT:    ret i32* [[TMP0]]
3536;
3537; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@malloc_like
3538; IS__CGSCC_NPM-SAME: (i32 [[S:%.*]]) {
3539; IS__CGSCC_NPM-NEXT:  entry:
3540; IS__CGSCC_NPM-NEXT:    [[CONV:%.*]] = sext i32 [[S]] to i64
3541; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR14:[0-9]+]]
3542; IS__CGSCC_NPM-NEXT:    [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
3543; IS__CGSCC_NPM-NEXT:    ret i32* [[TMP0]]
3544;
3545entry:
3546  %conv = sext i32 %s to i64
3547  %call = call noalias i8* @malloc(i64 %conv) norecurse
3548  %0 = bitcast i8* %call to i32*
3549  ret i32* %0
3550}
3551
3552define dso_local i32 @round_trip_malloc_like(i32 %x) {
3553; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_malloc_like
3554; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) {
3555; IS__TUNIT_OPM-NEXT:  entry:
3556; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR17]]
3557; IS__TUNIT_OPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3558; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3559; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3560; IS__TUNIT_OPM-NEXT:    call void @free(i8* noundef [[TMP1]]) #[[ATTR17]]
3561; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP0]]
3562;
3563; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@round_trip_malloc_like
3564; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) {
3565; IS__TUNIT_NPM-NEXT:  entry:
3566; IS__TUNIT_NPM-NEXT:    [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR13]]
3567; IS__TUNIT_NPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3568; IS__TUNIT_NPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3569; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3570; IS__TUNIT_NPM-NEXT:    call void @free(i8* noundef [[TMP1]]) #[[ATTR13]]
3571; IS__TUNIT_NPM-NEXT:    ret i32 [[TMP0]]
3572;
3573; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_malloc_like
3574; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) {
3575; IS__CGSCC_OPM-NEXT:  entry:
3576; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR16]]
3577; IS__CGSCC_OPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3578; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3579; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3580; IS__CGSCC_OPM-NEXT:    call void @free(i8* noundef [[TMP1]]) #[[ATTR16]]
3581; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP0]]
3582;
3583; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@round_trip_malloc_like
3584; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) {
3585; IS__CGSCC_NPM-NEXT:  entry:
3586; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR14]]
3587; IS__CGSCC_NPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3588; IS__CGSCC_NPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3589; IS__CGSCC_NPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3590; IS__CGSCC_NPM-NEXT:    call void @free(i8* noundef [[TMP1]]) #[[ATTR14]]
3591; IS__CGSCC_NPM-NEXT:    ret i32 [[TMP0]]
3592;
3593entry:
3594  %call = call i32* @malloc_like(i32 4) norecurse
3595  store i32 %x, i32* %call, align 4
3596  %0 = load i32, i32* %call, align 4
3597  %1 = bitcast i32* %call to i8*
3598  call void @free(i8* %1) norecurse
3599  ret i32 %0
3600}
3601
3602define dso_local i32 @round_trip_unknown_alloc(i32 %x) {
3603; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@round_trip_unknown_alloc
3604; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) {
3605; IS__TUNIT_OPM-NEXT:  entry:
3606; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR17]]
3607; IS__TUNIT_OPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3608; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3609; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3610; IS__TUNIT_OPM-NEXT:    call void @free(i8* noundef [[TMP1]]) #[[ATTR17]]
3611; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP0]]
3612;
3613; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@round_trip_unknown_alloc
3614; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) {
3615; IS__TUNIT_NPM-NEXT:  entry:
3616; IS__TUNIT_NPM-NEXT:    [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR13]]
3617; IS__TUNIT_NPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3618; IS__TUNIT_NPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3619; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3620; IS__TUNIT_NPM-NEXT:    call void @free(i8* noundef [[TMP1]]) #[[ATTR13]]
3621; IS__TUNIT_NPM-NEXT:    ret i32 [[TMP0]]
3622;
3623; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@round_trip_unknown_alloc
3624; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) {
3625; IS__CGSCC_OPM-NEXT:  entry:
3626; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR16]]
3627; IS__CGSCC_OPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3628; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3629; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3630; IS__CGSCC_OPM-NEXT:    call void @free(i8* noundef [[TMP1]]) #[[ATTR16]]
3631; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP0]]
3632;
3633; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@round_trip_unknown_alloc
3634; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) {
3635; IS__CGSCC_NPM-NEXT:  entry:
3636; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR14]]
3637; IS__CGSCC_NPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3638; IS__CGSCC_NPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3639; IS__CGSCC_NPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3640; IS__CGSCC_NPM-NEXT:    call void @free(i8* noundef [[TMP1]]) #[[ATTR14]]
3641; IS__CGSCC_NPM-NEXT:    ret i32 [[TMP0]]
3642;
3643entry:
3644  %call = call i32* @unknown_alloc(i32 4) norecurse
3645  store i32 %x, i32* %call, align 4
3646  %0 = load i32, i32* %call, align 4
3647  %1 = bitcast i32* %call to i8*
3648  call void @free(i8* %1) norecurse
3649  ret i32 %0
3650}
3651
3652declare noalias i32* @unknown_alloc(i32)
3653
3654define dso_local i32 @conditional_unknown_alloc(i32 %x) {
3655; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@conditional_unknown_alloc
3656; IS__TUNIT_OPM-SAME: (i32 [[X:%.*]]) {
3657; IS__TUNIT_OPM-NEXT:  entry:
3658; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR17]]
3659; IS__TUNIT_OPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
3660; IS__TUNIT_OPM-NEXT:    br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3661; IS__TUNIT_OPM:       if.then:
3662; IS__TUNIT_OPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3663; IS__TUNIT_OPM-NEXT:    br label [[IF_END]]
3664; IS__TUNIT_OPM:       if.end:
3665; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3666; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3667; IS__TUNIT_OPM-NEXT:    call void @free(i8* [[TMP1]]) #[[ATTR17]]
3668; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP0]]
3669;
3670; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@conditional_unknown_alloc
3671; IS__TUNIT_NPM-SAME: (i32 [[X:%.*]]) {
3672; IS__TUNIT_NPM-NEXT:  entry:
3673; IS__TUNIT_NPM-NEXT:    [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR13]]
3674; IS__TUNIT_NPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
3675; IS__TUNIT_NPM-NEXT:    br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3676; IS__TUNIT_NPM:       if.then:
3677; IS__TUNIT_NPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3678; IS__TUNIT_NPM-NEXT:    br label [[IF_END]]
3679; IS__TUNIT_NPM:       if.end:
3680; IS__TUNIT_NPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3681; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3682; IS__TUNIT_NPM-NEXT:    call void @free(i8* [[TMP1]]) #[[ATTR13]]
3683; IS__TUNIT_NPM-NEXT:    ret i32 [[TMP0]]
3684;
3685; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@conditional_unknown_alloc
3686; IS__CGSCC_OPM-SAME: (i32 [[X:%.*]]) {
3687; IS__CGSCC_OPM-NEXT:  entry:
3688; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR16]]
3689; IS__CGSCC_OPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
3690; IS__CGSCC_OPM-NEXT:    br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3691; IS__CGSCC_OPM:       if.then:
3692; IS__CGSCC_OPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3693; IS__CGSCC_OPM-NEXT:    br label [[IF_END]]
3694; IS__CGSCC_OPM:       if.end:
3695; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3696; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3697; IS__CGSCC_OPM-NEXT:    call void @free(i8* [[TMP1]]) #[[ATTR16]]
3698; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP0]]
3699;
3700; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@conditional_unknown_alloc
3701; IS__CGSCC_NPM-SAME: (i32 [[X:%.*]]) {
3702; IS__CGSCC_NPM-NEXT:  entry:
3703; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR14]]
3704; IS__CGSCC_NPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
3705; IS__CGSCC_NPM-NEXT:    br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3706; IS__CGSCC_NPM:       if.then:
3707; IS__CGSCC_NPM-NEXT:    store i32 [[X]], i32* [[CALL]], align 4
3708; IS__CGSCC_NPM-NEXT:    br label [[IF_END]]
3709; IS__CGSCC_NPM:       if.end:
3710; IS__CGSCC_NPM-NEXT:    [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
3711; IS__CGSCC_NPM-NEXT:    [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
3712; IS__CGSCC_NPM-NEXT:    call void @free(i8* [[TMP1]]) #[[ATTR14]]
3713; IS__CGSCC_NPM-NEXT:    ret i32 [[TMP0]]
3714;
3715entry:
3716  %call = call noalias i32* @unknown_alloc(i32 4) norecurse
3717  %tobool = icmp ne i32 %x, 0
3718  br i1 %tobool, label %if.end, label %if.then
3719
3720if.then:                                          ; preds = %entry
3721  store i32 %x, i32* %call, align 4
3722  br label %if.end
3723
3724if.end:                                           ; preds = %if.then, %entry
3725  %0 = load i32, i32* %call, align 4
3726  %1 = bitcast i32* %call to i8*
3727  call void @free(i8* %1) norecurse
3728  ret i32 %0
3729}
3730
3731%struct.STy = type { float*, double*, %struct.STy* }
3732
3733@global = internal global %struct.STy zeroinitializer, align 8
3734
3735; We mark %dst as writeonly and %src as readonly, that is (for now) all we can expect.
3736define dso_local void @test_nested_memory(float* %dst, double* %src) {
3737; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test_nested_memory
3738; IS__TUNIT_OPM-SAME: (float* nocapture nofree writeonly [[DST:%.*]], double* nocapture nofree readonly [[SRC:%.*]]) {
3739; IS__TUNIT_OPM-NEXT:  entry:
3740; IS__TUNIT_OPM-NEXT:    [[LOCAL:%.*]] = alloca [[STRUCT_STY:%.*]], align 8
3741; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = bitcast %struct.STy* [[LOCAL]] to i8*
3742; IS__TUNIT_OPM-NEXT:    [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[LOCAL]], i64 0, i32 2
3743; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call noalias dereferenceable_or_null(24) i8* @malloc(i64 noundef 24)
3744; IS__TUNIT_OPM-NEXT:    [[DST1:%.*]] = bitcast i8* [[CALL]] to float**
3745; IS__TUNIT_OPM-NEXT:    store float* [[DST]], float** [[DST1]], align 8
3746; IS__TUNIT_OPM-NEXT:    [[SRC2:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 8
3747; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = bitcast i8* [[SRC2]] to double**
3748; IS__TUNIT_OPM-NEXT:    store double* [[SRC]], double** [[TMP1]], align 8
3749; IS__TUNIT_OPM-NEXT:    store i8* [[CALL]], i8** bitcast (%struct.STy** getelementptr inbounds ([[STRUCT_STY]], %struct.STy* @global, i64 0, i32 2) to i8**), align 8
3750; IS__TUNIT_OPM-NEXT:    call fastcc void @nested_memory_callee() #[[ATTR18:[0-9]+]]
3751; IS__TUNIT_OPM-NEXT:    ret void
3752;
3753; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_nested_memory
3754; IS__TUNIT_NPM-SAME: (float* nocapture nofree writeonly [[DST:%.*]], double* nocapture nofree readonly [[SRC:%.*]]) {
3755; IS__TUNIT_NPM-NEXT:  entry:
3756; IS__TUNIT_NPM-NEXT:    [[LOCAL:%.*]] = alloca [[STRUCT_STY:%.*]], align 8
3757; IS__TUNIT_NPM-NEXT:    [[TMP0:%.*]] = bitcast %struct.STy* [[LOCAL]] to i8*
3758; IS__TUNIT_NPM-NEXT:    [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[LOCAL]], i64 0, i32 2
3759; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = alloca i8, i64 24, align 1
3760; IS__TUNIT_NPM-NEXT:    [[DST1:%.*]] = bitcast i8* [[TMP1]] to float**
3761; IS__TUNIT_NPM-NEXT:    store float* [[DST]], float** [[DST1]], align 8
3762; IS__TUNIT_NPM-NEXT:    [[SRC2:%.*]] = getelementptr inbounds i8, i8* [[TMP1]], i64 8
3763; IS__TUNIT_NPM-NEXT:    [[TMP2:%.*]] = bitcast i8* [[SRC2]] to double**
3764; IS__TUNIT_NPM-NEXT:    store double* [[SRC]], double** [[TMP2]], align 8
3765; IS__TUNIT_NPM-NEXT:    store i8* [[TMP1]], i8** bitcast (%struct.STy** getelementptr inbounds ([[STRUCT_STY]], %struct.STy* @global, i64 0, i32 2) to i8**), align 8
3766; IS__TUNIT_NPM-NEXT:    call fastcc void @nested_memory_callee() #[[ATTR14:[0-9]+]]
3767; IS__TUNIT_NPM-NEXT:    ret void
3768;
3769; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_nested_memory
3770; IS__CGSCC_OPM-SAME: (float* nocapture nofree writeonly [[DST:%.*]], double* nocapture nofree readonly [[SRC:%.*]]) {
3771; IS__CGSCC_OPM-NEXT:  entry:
3772; IS__CGSCC_OPM-NEXT:    [[LOCAL:%.*]] = alloca [[STRUCT_STY:%.*]], align 8
3773; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = bitcast %struct.STy* [[LOCAL]] to i8*
3774; IS__CGSCC_OPM-NEXT:    [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[LOCAL]], i64 0, i32 2
3775; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias dereferenceable_or_null(24) i8* @malloc(i64 noundef 24)
3776; IS__CGSCC_OPM-NEXT:    [[DST1:%.*]] = bitcast i8* [[CALL]] to float**
3777; IS__CGSCC_OPM-NEXT:    store float* [[DST]], float** [[DST1]], align 8
3778; IS__CGSCC_OPM-NEXT:    [[SRC2:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 8
3779; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = bitcast i8* [[SRC2]] to double**
3780; IS__CGSCC_OPM-NEXT:    store double* [[SRC]], double** [[TMP1]], align 8
3781; IS__CGSCC_OPM-NEXT:    store i8* [[CALL]], i8** bitcast (%struct.STy** getelementptr inbounds ([[STRUCT_STY]], %struct.STy* @global, i64 0, i32 2) to i8**), align 8
3782; IS__CGSCC_OPM-NEXT:    call fastcc void @nested_memory_callee() #[[ATTR15]]
3783; IS__CGSCC_OPM-NEXT:    ret void
3784;
3785; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_nested_memory
3786; IS__CGSCC_NPM-SAME: (float* nocapture nofree writeonly [[DST:%.*]], double* nocapture nofree readonly [[SRC:%.*]]) {
3787; IS__CGSCC_NPM-NEXT:  entry:
3788; IS__CGSCC_NPM-NEXT:    [[LOCAL:%.*]] = alloca [[STRUCT_STY:%.*]], align 8
3789; IS__CGSCC_NPM-NEXT:    [[TMP0:%.*]] = bitcast %struct.STy* [[LOCAL]] to i8*
3790; IS__CGSCC_NPM-NEXT:    [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[LOCAL]], i64 0, i32 2
3791; IS__CGSCC_NPM-NEXT:    [[TMP1:%.*]] = alloca i8, i64 24, align 1
3792; IS__CGSCC_NPM-NEXT:    [[DST1:%.*]] = bitcast i8* [[TMP1]] to float**
3793; IS__CGSCC_NPM-NEXT:    store float* [[DST]], float** [[DST1]], align 8
3794; IS__CGSCC_NPM-NEXT:    [[SRC2:%.*]] = getelementptr inbounds i8, i8* [[TMP1]], i64 8
3795; IS__CGSCC_NPM-NEXT:    [[TMP2:%.*]] = bitcast i8* [[SRC2]] to double**
3796; IS__CGSCC_NPM-NEXT:    store double* [[SRC]], double** [[TMP2]], align 8
3797; IS__CGSCC_NPM-NEXT:    store i8* [[TMP1]], i8** bitcast (%struct.STy** getelementptr inbounds ([[STRUCT_STY]], %struct.STy* @global, i64 0, i32 2) to i8**), align 8
3798; IS__CGSCC_NPM-NEXT:    call fastcc void @nested_memory_callee() #[[ATTR13]]
3799; IS__CGSCC_NPM-NEXT:    ret void
3800;
3801entry:
3802  %local = alloca %struct.STy, align 8
3803  %0 = bitcast %struct.STy* %local to i8*
3804  %inner = getelementptr inbounds %struct.STy, %struct.STy* %local, i64 0, i32 2
3805  store %struct.STy* @global, %struct.STy** %inner, align 8
3806  %call = call noalias dereferenceable_or_null(24) i8* @malloc(i64 24) #4
3807  %dst1 = bitcast i8* %call to float**
3808  store float* %dst, float** %dst1, align 8
3809  %src2 = getelementptr inbounds i8, i8* %call, i64 8
3810  %1 = bitcast i8* %src2 to double**
3811  store double* %src, double** %1, align 8
3812  store i8* %call, i8** bitcast (%struct.STy** getelementptr inbounds (%struct.STy, %struct.STy* @global, i64 0, i32 2) to i8**), align 8
3813  call fastcc void @nested_memory_callee(%struct.STy* nonnull %local)
3814  ret void
3815}
3816
3817define internal fastcc void @nested_memory_callee(%struct.STy* nocapture readonly %S) nofree norecurse nounwind uwtable {
3818; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn uwtable
3819; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nested_memory_callee
3820; IS__TUNIT_OPM-SAME: () #[[ATTR12:[0-9]+]] {
3821; IS__TUNIT_OPM-NEXT:  entry:
3822; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = load %struct.STy*, %struct.STy** getelementptr inbounds ([[STRUCT_STY:%.*]], %struct.STy* @global, i64 0, i32 2), align 8
3823; IS__TUNIT_OPM-NEXT:    [[SRC:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 1
3824; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = load double*, double** [[SRC]], align 8
3825; IS__TUNIT_OPM-NEXT:    [[TMP2:%.*]] = load double, double* [[TMP1]], align 8
3826; IS__TUNIT_OPM-NEXT:    [[CONV:%.*]] = fptrunc double [[TMP2]] to float
3827; IS__TUNIT_OPM-NEXT:    [[DST:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 0
3828; IS__TUNIT_OPM-NEXT:    [[TMP3:%.*]] = load float*, float** [[DST]], align 8
3829; IS__TUNIT_OPM-NEXT:    store float [[CONV]], float* [[TMP3]], align 4
3830; IS__TUNIT_OPM-NEXT:    ret void
3831;
3832; IS________NPM: Function Attrs: nofree norecurse nosync nounwind willreturn uwtable
3833; IS________NPM-LABEL: define {{[^@]+}}@nested_memory_callee
3834; IS________NPM-SAME: () #[[ATTR9:[0-9]+]] {
3835; IS________NPM-NEXT:  entry:
3836; IS________NPM-NEXT:    [[TMP0:%.*]] = load %struct.STy*, %struct.STy** getelementptr inbounds ([[STRUCT_STY:%.*]], %struct.STy* @global, i64 0, i32 2), align 8
3837; IS________NPM-NEXT:    [[SRC:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 1
3838; IS________NPM-NEXT:    [[TMP1:%.*]] = load double*, double** [[SRC]], align 8
3839; IS________NPM-NEXT:    [[TMP2:%.*]] = load double, double* [[TMP1]], align 8
3840; IS________NPM-NEXT:    [[CONV:%.*]] = fptrunc double [[TMP2]] to float
3841; IS________NPM-NEXT:    [[DST:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 0
3842; IS________NPM-NEXT:    [[TMP3:%.*]] = load float*, float** [[DST]], align 8
3843; IS________NPM-NEXT:    store float [[CONV]], float* [[TMP3]], align 4
3844; IS________NPM-NEXT:    ret void
3845;
3846; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn uwtable
3847; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nested_memory_callee
3848; IS__CGSCC_OPM-SAME: () #[[ATTR11:[0-9]+]] {
3849; IS__CGSCC_OPM-NEXT:  entry:
3850; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = load %struct.STy*, %struct.STy** getelementptr inbounds ([[STRUCT_STY:%.*]], %struct.STy* @global, i64 0, i32 2), align 8
3851; IS__CGSCC_OPM-NEXT:    [[SRC:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 1
3852; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = load double*, double** [[SRC]], align 8
3853; IS__CGSCC_OPM-NEXT:    [[TMP2:%.*]] = load double, double* [[TMP1]], align 8
3854; IS__CGSCC_OPM-NEXT:    [[CONV:%.*]] = fptrunc double [[TMP2]] to float
3855; IS__CGSCC_OPM-NEXT:    [[DST:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP0]], i64 0, i32 0
3856; IS__CGSCC_OPM-NEXT:    [[TMP3:%.*]] = load float*, float** [[DST]], align 8
3857; IS__CGSCC_OPM-NEXT:    store float [[CONV]], float* [[TMP3]], align 4
3858; IS__CGSCC_OPM-NEXT:    ret void
3859;
3860entry:
3861  %inner = getelementptr inbounds %struct.STy, %struct.STy* %S, i64 0, i32 2
3862  %0 = load %struct.STy*, %struct.STy** %inner, align 8
3863  %inner1 = getelementptr inbounds %struct.STy, %struct.STy* %0, i64 0, i32 2
3864  %1 = load %struct.STy*, %struct.STy** %inner1, align 8
3865  %src = getelementptr inbounds %struct.STy, %struct.STy* %1, i64 0, i32 1
3866  %2 = load double*, double** %src, align 8
3867  %3 = load double, double* %2, align 8
3868  %conv = fptrunc double %3 to float
3869  %dst = getelementptr inbounds %struct.STy, %struct.STy* %1, i64 0, i32 0
3870  %4 = load float*, float** %dst, align 8
3871  store float %conv, float* %4, align 4
3872  ret void
3873}
3874
3875; Make sure the access %1 is not forwarded to the loads %2 and %3 as the indices are
3876; varying and the accesses thus not "exact". This used to simplify %cmp12 to true.
3877define hidden void @no_propagation_of_unknown_index_access(i32* %in, i32* %out, i32 %idx) #0 {
3878; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind
3879; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access
3880; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly [[IN:%.*]], i32* nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR13:[0-9]+]] {
3881; IS__TUNIT_OPM-NEXT:  entry:
3882; IS__TUNIT_OPM-NEXT:    [[BUF:%.*]] = alloca [128 x i32], align 16
3883; IS__TUNIT_OPM-NEXT:    [[TMP0:%.*]] = bitcast [128 x i32]* [[BUF]] to i8*
3884; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]])
3885; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND:%.*]]
3886; IS__TUNIT_OPM:       for.cond:
3887; IS__TUNIT_OPM-NEXT:    [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ]
3888; IS__TUNIT_OPM-NEXT:    [[CMP:%.*]] = icmp slt i32 [[I_0]], 128
3889; IS__TUNIT_OPM-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]]
3890; IS__TUNIT_OPM:       for.cond.cleanup:
3891; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND4:%.*]]
3892; IS__TUNIT_OPM:       for.body:
3893; IS__TUNIT_OPM-NEXT:    [[IDXPROM:%.*]] = sext i32 [[I_0]] to i64
3894; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[IN]], i64 [[IDXPROM]]
3895; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX]], align 4
3896; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX2:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM]]
3897; IS__TUNIT_OPM-NEXT:    store i32 [[TMP1]], i32* [[ARRAYIDX2]], align 4
3898; IS__TUNIT_OPM-NEXT:    [[INC]] = add nsw i32 [[I_0]], 1
3899; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[TBAA10]]
3900; IS__TUNIT_OPM:       for.cond4:
3901; IS__TUNIT_OPM-NEXT:    [[I3_0:%.*]] = phi i32 [ 0, [[FOR_COND_CLEANUP]] ], [ [[INC16:%.*]], [[FOR_BODY7:%.*]] ]
3902; IS__TUNIT_OPM-NEXT:    [[CMP5:%.*]] = icmp slt i32 [[I3_0]], 128
3903; IS__TUNIT_OPM-NEXT:    br i1 [[CMP5]], label [[FOR_BODY7]], label [[FOR_COND_CLEANUP6:%.*]]
3904; IS__TUNIT_OPM:       for.cond.cleanup6:
3905; IS__TUNIT_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]])
3906; IS__TUNIT_OPM-NEXT:    ret void
3907; IS__TUNIT_OPM:       for.body7:
3908; IS__TUNIT_OPM-NEXT:    [[IDXPROM8:%.*]] = sext i32 [[I3_0]] to i64
3909; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX9:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM8]]
3910; IS__TUNIT_OPM-NEXT:    [[TMP2:%.*]] = load i32, i32* [[ARRAYIDX9]], align 4
3911; IS__TUNIT_OPM-NEXT:    [[IDXPROM10:%.*]] = sext i32 [[IDX]] to i64
3912; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX11:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM10]]
3913; IS__TUNIT_OPM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[ARRAYIDX11]], align 4
3914; IS__TUNIT_OPM-NEXT:    [[CMP12:%.*]] = icmp sle i32 [[TMP2]], [[TMP3]]
3915; IS__TUNIT_OPM-NEXT:    [[CONV:%.*]] = zext i1 [[CMP12]] to i32
3916; IS__TUNIT_OPM-NEXT:    [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, i32* [[OUT]], i64 [[IDXPROM8]]
3917; IS__TUNIT_OPM-NEXT:    store i32 [[CONV]], i32* [[ARRAYIDX14]], align 4
3918; IS__TUNIT_OPM-NEXT:    [[INC16]] = add nsw i32 [[I3_0]], 1
3919; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND4]], !llvm.loop [[TBAA12]]
3920;
3921; IS________NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn
3922; IS________NPM-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access
3923; IS________NPM-SAME: (i32* nocapture nofree readonly [[IN:%.*]], i32* nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR1:[0-9]+]] {
3924; IS________NPM-NEXT:  entry:
3925; IS________NPM-NEXT:    [[BUF:%.*]] = alloca [128 x i32], align 16
3926; IS________NPM-NEXT:    [[TMP0:%.*]] = bitcast [128 x i32]* [[BUF]] to i8*
3927; IS________NPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) #[[ATTR11]]
3928; IS________NPM-NEXT:    br label [[FOR_COND:%.*]]
3929; IS________NPM:       for.cond:
3930; IS________NPM-NEXT:    [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ]
3931; IS________NPM-NEXT:    [[CMP:%.*]] = icmp slt i32 [[I_0]], 128
3932; IS________NPM-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]]
3933; IS________NPM:       for.cond.cleanup:
3934; IS________NPM-NEXT:    br label [[FOR_COND4:%.*]]
3935; IS________NPM:       for.body:
3936; IS________NPM-NEXT:    [[IDXPROM:%.*]] = sext i32 [[I_0]] to i64
3937; IS________NPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[IN]], i64 [[IDXPROM]]
3938; IS________NPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX]], align 4
3939; IS________NPM-NEXT:    [[ARRAYIDX2:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM]]
3940; IS________NPM-NEXT:    store i32 [[TMP1]], i32* [[ARRAYIDX2]], align 4
3941; IS________NPM-NEXT:    [[INC]] = add nsw i32 [[I_0]], 1
3942; IS________NPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
3943; IS________NPM:       for.cond4:
3944; IS________NPM-NEXT:    [[I3_0:%.*]] = phi i32 [ 0, [[FOR_COND_CLEANUP]] ], [ [[INC16:%.*]], [[FOR_BODY7:%.*]] ]
3945; IS________NPM-NEXT:    [[CMP5:%.*]] = icmp slt i32 [[I3_0]], 128
3946; IS________NPM-NEXT:    br i1 [[CMP5]], label [[FOR_BODY7]], label [[FOR_COND_CLEANUP6:%.*]]
3947; IS________NPM:       for.cond.cleanup6:
3948; IS________NPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) #[[ATTR11]]
3949; IS________NPM-NEXT:    ret void
3950; IS________NPM:       for.body7:
3951; IS________NPM-NEXT:    [[IDXPROM8:%.*]] = sext i32 [[I3_0]] to i64
3952; IS________NPM-NEXT:    [[ARRAYIDX9:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM8]]
3953; IS________NPM-NEXT:    [[TMP2:%.*]] = load i32, i32* [[ARRAYIDX9]], align 4
3954; IS________NPM-NEXT:    [[IDXPROM10:%.*]] = sext i32 [[IDX]] to i64
3955; IS________NPM-NEXT:    [[ARRAYIDX11:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM10]]
3956; IS________NPM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[ARRAYIDX11]], align 4
3957; IS________NPM-NEXT:    [[CMP12:%.*]] = icmp sle i32 [[TMP2]], [[TMP3]]
3958; IS________NPM-NEXT:    [[CONV:%.*]] = zext i1 [[CMP12]] to i32
3959; IS________NPM-NEXT:    [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, i32* [[OUT]], i64 [[IDXPROM8]]
3960; IS________NPM-NEXT:    store i32 [[CONV]], i32* [[ARRAYIDX14]], align 4
3961; IS________NPM-NEXT:    [[INC16]] = add nsw i32 [[I3_0]], 1
3962; IS________NPM-NEXT:    br label [[FOR_COND4]], !llvm.loop [[LOOP12:![0-9]+]]
3963;
3964; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind
3965; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access
3966; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly [[IN:%.*]], i32* nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR12:[0-9]+]] {
3967; IS__CGSCC_OPM-NEXT:  entry:
3968; IS__CGSCC_OPM-NEXT:    [[BUF:%.*]] = alloca [128 x i32], align 16
3969; IS__CGSCC_OPM-NEXT:    [[TMP0:%.*]] = bitcast [128 x i32]* [[BUF]] to i8*
3970; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.start.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]])
3971; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND:%.*]]
3972; IS__CGSCC_OPM:       for.cond:
3973; IS__CGSCC_OPM-NEXT:    [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ]
3974; IS__CGSCC_OPM-NEXT:    [[CMP:%.*]] = icmp slt i32 [[I_0]], 128
3975; IS__CGSCC_OPM-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]]
3976; IS__CGSCC_OPM:       for.cond.cleanup:
3977; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND4:%.*]]
3978; IS__CGSCC_OPM:       for.body:
3979; IS__CGSCC_OPM-NEXT:    [[IDXPROM:%.*]] = sext i32 [[I_0]] to i64
3980; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[IN]], i64 [[IDXPROM]]
3981; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX]], align 4
3982; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX2:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM]]
3983; IS__CGSCC_OPM-NEXT:    store i32 [[TMP1]], i32* [[ARRAYIDX2]], align 4
3984; IS__CGSCC_OPM-NEXT:    [[INC]] = add nsw i32 [[I_0]], 1
3985; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND]], !llvm.loop [[TBAA10]]
3986; IS__CGSCC_OPM:       for.cond4:
3987; IS__CGSCC_OPM-NEXT:    [[I3_0:%.*]] = phi i32 [ 0, [[FOR_COND_CLEANUP]] ], [ [[INC16:%.*]], [[FOR_BODY7:%.*]] ]
3988; IS__CGSCC_OPM-NEXT:    [[CMP5:%.*]] = icmp slt i32 [[I3_0]], 128
3989; IS__CGSCC_OPM-NEXT:    br i1 [[CMP5]], label [[FOR_BODY7]], label [[FOR_COND_CLEANUP6:%.*]]
3990; IS__CGSCC_OPM:       for.cond.cleanup6:
3991; IS__CGSCC_OPM-NEXT:    call void @llvm.lifetime.end.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]])
3992; IS__CGSCC_OPM-NEXT:    ret void
3993; IS__CGSCC_OPM:       for.body7:
3994; IS__CGSCC_OPM-NEXT:    [[IDXPROM8:%.*]] = sext i32 [[I3_0]] to i64
3995; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX9:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM8]]
3996; IS__CGSCC_OPM-NEXT:    [[TMP2:%.*]] = load i32, i32* [[ARRAYIDX9]], align 4
3997; IS__CGSCC_OPM-NEXT:    [[IDXPROM10:%.*]] = sext i32 [[IDX]] to i64
3998; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX11:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM10]]
3999; IS__CGSCC_OPM-NEXT:    [[TMP3:%.*]] = load i32, i32* [[ARRAYIDX11]], align 4
4000; IS__CGSCC_OPM-NEXT:    [[CMP12:%.*]] = icmp sle i32 [[TMP2]], [[TMP3]]
4001; IS__CGSCC_OPM-NEXT:    [[CONV:%.*]] = zext i1 [[CMP12]] to i32
4002; IS__CGSCC_OPM-NEXT:    [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, i32* [[OUT]], i64 [[IDXPROM8]]
4003; IS__CGSCC_OPM-NEXT:    store i32 [[CONV]], i32* [[ARRAYIDX14]], align 4
4004; IS__CGSCC_OPM-NEXT:    [[INC16]] = add nsw i32 [[I3_0]], 1
4005; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND4]], !llvm.loop [[TBAA12]]
4006;
4007entry:
4008  %buf = alloca [128 x i32], align 16
4009  %0 = bitcast [128 x i32]* %buf to i8*
4010  call void @llvm.lifetime.start.p0i8(i64 512, i8* %0) #2
4011  br label %for.cond
4012
4013for.cond:                                         ; preds = %for.body, %entry
4014  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
4015  %cmp = icmp slt i32 %i.0, 128
4016  br i1 %cmp, label %for.body, label %for.cond.cleanup
4017
4018for.cond.cleanup:                                 ; preds = %for.cond
4019  br label %for.cond4
4020
4021for.body:                                         ; preds = %for.cond
4022  %idxprom = sext i32 %i.0 to i64
4023  %arrayidx = getelementptr inbounds i32, i32* %in, i64 %idxprom
4024  %1 = load i32, i32* %arrayidx, align 4
4025  %arrayidx2 = getelementptr inbounds [128 x i32], [128 x i32]* %buf, i64 0, i64 %idxprom
4026  store i32 %1, i32* %arrayidx2, align 4
4027  %inc = add nsw i32 %i.0, 1
4028  br label %for.cond, !llvm.loop !10
4029
4030for.cond4:                                        ; preds = %for.body7, %for.cond.cleanup
4031  %i3.0 = phi i32 [ 0, %for.cond.cleanup ], [ %inc16, %for.body7 ]
4032  %cmp5 = icmp slt i32 %i3.0, 128
4033  br i1 %cmp5, label %for.body7, label %for.cond.cleanup6
4034
4035for.cond.cleanup6:                                ; preds = %for.cond4
4036  call void @llvm.lifetime.end.p0i8(i64 512, i8* %0) #2
4037  ret void
4038
4039for.body7:                                        ; preds = %for.cond4
4040  %idxprom8 = sext i32 %i3.0 to i64
4041  %arrayidx9 = getelementptr inbounds [128 x i32], [128 x i32]* %buf, i64 0, i64 %idxprom8
4042  %2 = load i32, i32* %arrayidx9, align 4
4043  %idxprom10 = sext i32 %idx to i64
4044  %arrayidx11 = getelementptr inbounds [128 x i32], [128 x i32]* %buf, i64 0, i64 %idxprom10
4045  %3 = load i32, i32* %arrayidx11, align 4
4046  %cmp12 = icmp sle i32 %2, %3
4047  %conv = zext i1 %cmp12 to i32
4048  %arrayidx14 = getelementptr inbounds i32, i32* %out, i64 %idxprom8
4049  store i32 %conv, i32* %arrayidx14, align 4
4050  %inc16 = add nsw i32 %i3.0, 1
4051  br label %for.cond4, !llvm.loop !12
4052}
4053
4054!llvm.module.flags = !{!0, !1}
4055!llvm.ident = !{!2}
4056
4057!0 = !{i32 1, !"wchar_size", i32 4}
4058!1 = !{i32 7, !"uwtable", i32 1}
4059!2 = !{!"clang version 13.0.0"}
4060!3 = !{!4, !4, i64 0}
4061!4 = !{!"int", !5, i64 0}
4062!5 = !{!"omnipotent char", !6, i64 0}
4063!6 = !{!"Simple C/C++ TBAA"}
4064!7 = !{!8, !9, i64 12}
4065!8 = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20}
4066!9 = !{!"float", !5, i64 0}
4067!10 = !{!8, !9, i64 16}
4068!11 = !{!8, !9, i64 20}
4069!12 = !{!8, !4, i64 0}
4070!13 = !{!8, !4, i64 4}
4071!14 = !{!8, !4, i64 8}
4072!15 = !{!5, !5, i64 0}
4073!16 = distinct !{!16, !17}
4074!17 = !{!"llvm.loop.mustprogress"}
4075!18 = !{!9, !9, i64 0}
4076!19 = distinct !{!19, !17}
4077!20 = !{!21, !21, i64 0}
4078!21 = !{!"long long", !5, i64 0}
4079!22 = distinct !{!22, !17}
4080!23 = distinct !{!23, !17}
4081!24 = distinct !{!24, !17}
4082!25 = distinct !{!25, !17}
4083!26 = distinct !{!26, !17}
4084!27 = distinct !{!27, !17}
4085!28 = distinct !{!28, !17}
4086!29 = distinct !{!29, !17}
4087!30 = distinct !{!30, !17}
4088!31 = distinct !{!31, !17}
4089;.
4090; IS__TUNIT_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
4091; IS__TUNIT_OPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn }
4092; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind }
4093; IS__TUNIT_OPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readnone willreturn }
4094; IS__TUNIT_OPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn }
4095; IS__TUNIT_OPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn writeonly }
4096; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind writeonly }
4097; IS__TUNIT_OPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn }
4098; IS__TUNIT_OPM: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind willreturn }
4099; IS__TUNIT_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind }
4100; IS__TUNIT_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readonly willreturn }
4101; IS__TUNIT_OPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readnone }
4102; IS__TUNIT_OPM: attributes #[[ATTR12]] = { nofree norecurse nosync nounwind willreturn uwtable }
4103; IS__TUNIT_OPM: attributes #[[ATTR13]] = { argmemonly nofree nosync nounwind }
4104; IS__TUNIT_OPM: attributes #[[ATTR14]] = { willreturn }
4105; IS__TUNIT_OPM: attributes #[[ATTR15]] = { nofree nosync nounwind willreturn writeonly }
4106; IS__TUNIT_OPM: attributes #[[ATTR16]] = { nofree nosync nounwind writeonly }
4107; IS__TUNIT_OPM: attributes #[[ATTR17]] = { norecurse }
4108; IS__TUNIT_OPM: attributes #[[ATTR18]] = { nounwind }
4109;.
4110; IS__TUNIT_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
4111; IS__TUNIT_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn }
4112; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn }
4113; IS__TUNIT_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readnone willreturn }
4114; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly }
4115; IS__TUNIT_NPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn }
4116; IS__TUNIT_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn }
4117; IS__TUNIT_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn }
4118; IS__TUNIT_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind writeonly }
4119; IS__TUNIT_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind willreturn uwtable }
4120; IS__TUNIT_NPM: attributes #[[ATTR10:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly }
4121; IS__TUNIT_NPM: attributes #[[ATTR11]] = { willreturn }
4122; IS__TUNIT_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn writeonly }
4123; IS__TUNIT_NPM: attributes #[[ATTR13]] = { norecurse }
4124; IS__TUNIT_NPM: attributes #[[ATTR14]] = { nounwind }
4125;.
4126; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
4127; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn }
4128; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn }
4129; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn }
4130; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly }
4131; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn }
4132; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn }
4133; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn }
4134; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind readnone }
4135; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind }
4136; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind writeonly }
4137; IS__CGSCC_OPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind willreturn uwtable }
4138; IS__CGSCC_OPM: attributes #[[ATTR12]] = { argmemonly nofree nosync nounwind }
4139; IS__CGSCC_OPM: attributes #[[ATTR13]] = { willreturn }
4140; IS__CGSCC_OPM: attributes #[[ATTR14]] = { nounwind willreturn writeonly }
4141; IS__CGSCC_OPM: attributes #[[ATTR15]] = { nounwind }
4142; IS__CGSCC_OPM: attributes #[[ATTR16]] = { norecurse }
4143;.
4144; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
4145; IS__CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn }
4146; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn }
4147; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn }
4148; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly }
4149; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn }
4150; IS__CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn }
4151; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn }
4152; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind writeonly }
4153; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind willreturn uwtable }
4154; IS__CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { argmemonly nofree nounwind willreturn writeonly }
4155; IS__CGSCC_NPM: attributes #[[ATTR11]] = { willreturn }
4156; IS__CGSCC_NPM: attributes #[[ATTR12]] = { nounwind willreturn writeonly }
4157; IS__CGSCC_NPM: attributes #[[ATTR13]] = { nounwind }
4158; IS__CGSCC_NPM: attributes #[[ATTR14]] = { norecurse }
4159;.
4160; IS__TUNIT____: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
4161; IS__TUNIT____: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1}
4162; IS__TUNIT____: [[META2:![0-9]+]] = !{!"clang version 13.0.0"}
4163; IS__TUNIT____: [[TBAA3]] = !{!4, !4, i64 0}
4164; IS__TUNIT____: [[META4:![0-9]+]] = !{!"int", !5, i64 0}
4165; IS__TUNIT____: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0}
4166; IS__TUNIT____: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"}
4167; IS__TUNIT____: [[META7:![0-9]+]] = !{!8, !9, i64 12}
4168; IS__TUNIT____: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20}
4169; IS__TUNIT____: [[META9:![0-9]+]] = !{!"float", !5, i64 0}
4170; IS__TUNIT____: [[META10:![0-9]+]] = !{!8, !9, i64 16}
4171; IS__TUNIT____: [[META11:![0-9]+]] = !{!8, !9, i64 20}
4172; IS__TUNIT____: [[META12:![0-9]+]] = !{!8, !4, i64 0}
4173; IS__TUNIT____: [[META13:![0-9]+]] = !{!8, !4, i64 4}
4174; IS__TUNIT____: [[META14:![0-9]+]] = !{!8, !4, i64 8}
4175; IS__TUNIT____: [[META15:![0-9]+]] = distinct !{!15, !16}
4176; IS__TUNIT____: [[META16:![0-9]+]] = !{!"llvm.loop.mustprogress"}
4177; IS__TUNIT____: [[META17:![0-9]+]] = distinct !{!17, !16}
4178; IS__TUNIT____: [[META18:![0-9]+]] = distinct !{!18, !16}
4179; IS__TUNIT____: [[META19:![0-9]+]] = !{!5, !5, i64 0}
4180; IS__TUNIT____: [[META20:![0-9]+]] = distinct !{!20, !16}
4181; IS__TUNIT____: [[META21:![0-9]+]] = distinct !{!21, !16}
4182; IS__TUNIT____: [[META22:![0-9]+]] = distinct !{!22, !16}
4183; IS__TUNIT____: [[META23:![0-9]+]] = distinct !{!23, !16}
4184; IS__TUNIT____: [[META24:![0-9]+]] = distinct !{!24, !16}
4185; IS__TUNIT____: [[META25:![0-9]+]] = distinct !{!25, !16}
4186; IS__TUNIT____: [[META26:![0-9]+]] = !{!9, !9, i64 0}
4187; IS__TUNIT____: [[META27:![0-9]+]] = distinct !{!27, !16}
4188; IS__TUNIT____: [[META28:![0-9]+]] = !{!29, !29, i64 0}
4189; IS__TUNIT____: [[META29:![0-9]+]] = !{!"long long", !5, i64 0}
4190; IS__TUNIT____: [[META30:![0-9]+]] = distinct !{!30, !16}
4191; IS__TUNIT____: [[META31:![0-9]+]] = distinct !{!31, !16}
4192;.
4193; IS__CGSCC____: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
4194; IS__CGSCC____: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1}
4195; IS__CGSCC____: [[META2:![0-9]+]] = !{!"clang version 13.0.0"}
4196; IS__CGSCC____: [[TBAA3]] = !{!4, !4, i64 0}
4197; IS__CGSCC____: [[META4:![0-9]+]] = !{!"int", !5, i64 0}
4198; IS__CGSCC____: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0}
4199; IS__CGSCC____: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"}
4200; IS__CGSCC____: [[META7:![0-9]+]] = !{!8, !9, i64 12}
4201; IS__CGSCC____: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20}
4202; IS__CGSCC____: [[META9:![0-9]+]] = !{!"float", !5, i64 0}
4203; IS__CGSCC____: [[META10:![0-9]+]] = !{!8, !9, i64 16}
4204; IS__CGSCC____: [[META11:![0-9]+]] = !{!8, !9, i64 20}
4205; IS__CGSCC____: [[META12:![0-9]+]] = !{!8, !4, i64 0}
4206; IS__CGSCC____: [[META13:![0-9]+]] = !{!8, !4, i64 4}
4207; IS__CGSCC____: [[META14:![0-9]+]] = !{!8, !4, i64 8}
4208; IS__CGSCC____: [[META15:![0-9]+]] = !{!5, !5, i64 0}
4209; IS__CGSCC____: [[META16:![0-9]+]] = distinct !{!16, !17}
4210; IS__CGSCC____: [[META17:![0-9]+]] = !{!"llvm.loop.mustprogress"}
4211; IS__CGSCC____: [[META18:![0-9]+]] = !{!9, !9, i64 0}
4212; IS__CGSCC____: [[META19:![0-9]+]] = distinct !{!19, !17}
4213; IS__CGSCC____: [[META20:![0-9]+]] = !{!21, !21, i64 0}
4214; IS__CGSCC____: [[META21:![0-9]+]] = !{!"long long", !5, i64 0}
4215; IS__CGSCC____: [[META22:![0-9]+]] = distinct !{!22, !17}
4216; IS__CGSCC____: [[META23:![0-9]+]] = distinct !{!23, !17}
4217; IS__CGSCC____: [[META24:![0-9]+]] = distinct !{!24, !17}
4218; IS__CGSCC____: [[META25:![0-9]+]] = distinct !{!25, !17}
4219; IS__CGSCC____: [[META26:![0-9]+]] = distinct !{!26, !17}
4220; IS__CGSCC____: [[META27:![0-9]+]] = distinct !{!27, !17}
4221; IS__CGSCC____: [[META28:![0-9]+]] = distinct !{!28, !17}
4222; IS__CGSCC____: [[META29:![0-9]+]] = distinct !{!29, !17}
4223; IS__CGSCC____: [[META30:![0-9]+]] = distinct !{!30, !17}
4224; IS__CGSCC____: [[META31:![0-9]+]] = distinct !{!31, !17}
4225;.
4226