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