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