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