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