405 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=loop-idiom < %s -S | FileCheck %s3 4%struct.S = type { i32, i32, i8 }5 6; unsigned copy_noalias(S* __restrict a, S *b, int n) {7; for (int i = 0; i < n; i++) {8; a[i] = b[i];9; }10; return sizeof(a[0]);11; }12 13; Function Attrs: nofree nounwind uwtable mustprogress14define dso_local i32 @copy_noalias(ptr noalias nocapture %a, ptr nocapture readonly %b, i32 %n) local_unnamed_addr {15; CHECK-LABEL: @copy_noalias(16; CHECK-NEXT: entry:17; CHECK-NEXT: [[CMP7:%.*]] = icmp sgt i32 [[N:%.*]], 018; CHECK-NEXT: br i1 [[CMP7]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]19; CHECK: for.body.preheader:20; CHECK-NEXT: [[TMP0:%.*]] = zext i32 [[N]] to i6421; CHECK-NEXT: [[TMP1:%.*]] = mul nuw nsw i64 [[TMP0]], 1222; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[A:%.*]], ptr align 4 [[B:%.*]], i64 [[TMP1]], i1 false)23; CHECK-NEXT: br label [[FOR_BODY:%.*]]24; CHECK: for.cond.cleanup.loopexit:25; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]26; CHECK: for.cond.cleanup:27; CHECK-NEXT: ret i32 1228; CHECK: for.body:29; CHECK-NEXT: [[I_08:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]30; CHECK-NEXT: [[IDXPROM:%.*]] = zext i32 [[I_08]] to i6431; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[B]], i64 [[IDXPROM]]32; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[A]], i64 [[IDXPROM]]33; CHECK-NEXT: [[INC]] = add nuw nsw i32 [[I_08]], 134; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[INC]], [[N]]35; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]]36;37entry:38 %cmp7 = icmp sgt i32 %n, 039 br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup40 41for.body.preheader: ; preds = %entry42 br label %for.body43 44for.cond.cleanup.loopexit: ; preds = %for.body45 br label %for.cond.cleanup46 47for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry48 ret i32 1249 50for.body: ; preds = %for.body, %for.body.preheader51 %i.08 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]52 %idxprom = zext i32 %i.08 to i6453 %arrayidx = getelementptr inbounds %struct.S, ptr %b, i64 %idxprom54 %arrayidx2 = getelementptr inbounds %struct.S, ptr %a, i64 %idxprom55 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 dereferenceable(12) %arrayidx2, ptr nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false)56 %inc = add nuw nsw i32 %i.08, 157 %cmp = icmp slt i32 %inc, %n58 br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit59}60 61; unsigned copy_may_alias(S *a, S *b, int n) {62; for (int i = 0; i < n; i++) {63; a[i] = b[i];64; }65; return sizeof(a[0]);66; }67 68; Function Attrs: nofree nounwind uwtable mustprogress69define dso_local i32 @copy_may_alias(ptr nocapture %a, ptr nocapture readonly %b, i32 %n) local_unnamed_addr {70; CHECK-LABEL: @copy_may_alias(71; CHECK-NEXT: entry:72; CHECK-NEXT: [[CMP7:%.*]] = icmp sgt i32 [[N:%.*]], 073; CHECK-NEXT: br i1 [[CMP7]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]74; CHECK: for.body.preheader:75; CHECK-NEXT: br label [[FOR_BODY:%.*]]76; CHECK: for.cond.cleanup.loopexit:77; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]78; CHECK: for.cond.cleanup:79; CHECK-NEXT: ret i32 1280; CHECK: for.body:81; CHECK-NEXT: [[I_08:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]82; CHECK-NEXT: [[IDXPROM:%.*]] = zext i32 [[I_08]] to i6483; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[B:%.*]], i64 [[IDXPROM]]84; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[A:%.*]], i64 [[IDXPROM]]85; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 dereferenceable(12) [[ARRAYIDX2]], ptr nonnull align 4 dereferenceable(12) [[ARRAYIDX]], i64 12, i1 false)86; CHECK-NEXT: [[INC]] = add nuw nsw i32 [[I_08]], 187; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[INC]], [[N]]88; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]]89;90entry:91 %cmp7 = icmp sgt i32 %n, 092 br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup93 94for.body.preheader: ; preds = %entry95 br label %for.body96 97for.cond.cleanup.loopexit: ; preds = %for.body98 br label %for.cond.cleanup99 100for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry101 ret i32 12102 103for.body: ; preds = %for.body, %for.body.preheader104 %i.08 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]105 %idxprom = zext i32 %i.08 to i64106 %arrayidx = getelementptr inbounds %struct.S, ptr %b, i64 %idxprom107 %arrayidx2 = getelementptr inbounds %struct.S, ptr %a, i64 %idxprom108 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 dereferenceable(12) %arrayidx2, ptr nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false)109 %inc = add nuw nsw i32 %i.08, 1110 %cmp = icmp slt i32 %inc, %n111 br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit112}113 114%struct.R = type <{ i8, i32, i8 }>115 116; void copy_noalias_read(S* __restrict x, S* __restrict y, int n, int &s) {117; for (int i = 0; i < n; i++) {118; x[i] = y[i];119; s += y[i].b;120; }121; }122 123; Function Attrs: nofree nounwind uwtable mustprogress124define dso_local void @copy_noalias_read(ptr noalias nocapture %x, ptr noalias nocapture readonly %y, i32 %n, ptr nocapture nonnull align 4 dereferenceable(4) %s) local_unnamed_addr {125; CHECK-LABEL: @copy_noalias_read(126; CHECK-NEXT: entry:127; CHECK-NEXT: [[CMP11:%.*]] = icmp sgt i32 [[N:%.*]], 0128; CHECK-NEXT: br i1 [[CMP11]], label [[FOR_BODY_LR_PH:%.*]], label [[FOR_COND_CLEANUP:%.*]]129; CHECK: for.body.lr.ph:130; CHECK-NEXT: [[S_PROMOTED:%.*]] = load i32, ptr [[S:%.*]], align 4131; CHECK-NEXT: [[TMP0:%.*]] = zext i32 [[N]] to i64132; CHECK-NEXT: [[TMP1:%.*]] = mul nuw nsw i64 [[TMP0]], 6133; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 [[X:%.*]], ptr align 1 [[Y:%.*]], i64 [[TMP1]], i1 false)134; CHECK-NEXT: br label [[FOR_BODY:%.*]]135; CHECK: for.cond.for.cond.cleanup_crit_edge:136; CHECK-NEXT: [[ADD_LCSSA:%.*]] = phi i32 [ [[ADD:%.*]], [[FOR_BODY]] ]137; CHECK-NEXT: store i32 [[ADD_LCSSA]], ptr [[S]], align 4138; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]139; CHECK: for.cond.cleanup:140; CHECK-NEXT: ret void141; CHECK: for.body:142; CHECK-NEXT: [[ADD13:%.*]] = phi i32 [ [[S_PROMOTED]], [[FOR_BODY_LR_PH]] ], [ [[ADD]], [[FOR_BODY]] ]143; CHECK-NEXT: [[I_012:%.*]] = phi i32 [ 0, [[FOR_BODY_LR_PH]] ], [ [[INC:%.*]], [[FOR_BODY]] ]144; CHECK-NEXT: [[IDXPROM:%.*]] = zext i32 [[I_012]] to i64145; CHECK-NEXT: [[I:%.*]] = getelementptr inbounds [[STRUCT_R:%.*]], ptr [[X]], i64 [[IDXPROM]], i32 0146; CHECK-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_R]], ptr [[Y]], i64 [[IDXPROM]], i32 0147; CHECK-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_R]], ptr [[Y]], i64 [[IDXPROM]], i32 1148; CHECK-NEXT: [[I2:%.*]] = load i32, ptr [[B]], align 1149; CHECK-NEXT: [[ADD]] = add nsw i32 [[ADD13]], [[I2]]150; CHECK-NEXT: [[INC]] = add nuw nsw i32 [[I_012]], 1151; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[INC]], [[N]]152; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_FOR_COND_CLEANUP_CRIT_EDGE:%.*]]153;154entry:155 %cmp11 = icmp sgt i32 %n, 0156 br i1 %cmp11, label %for.body.lr.ph, label %for.cond.cleanup157 158for.body.lr.ph: ; preds = %entry159 %s.promoted = load i32, ptr %s, align 4160 br label %for.body161 162for.cond.for.cond.cleanup_crit_edge: ; preds = %for.body163 %add.lcssa = phi i32 [ %add, %for.body ]164 store i32 %add.lcssa, ptr %s, align 4165 br label %for.cond.cleanup166 167for.cond.cleanup: ; preds = %for.cond.for.cond.cleanup_crit_edge, %entry168 ret void169 170for.body: ; preds = %for.body, %for.body.lr.ph171 %add13 = phi i32 [ %s.promoted, %for.body.lr.ph ], [ %add, %for.body ]172 %i.012 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]173 %idxprom = zext i32 %i.012 to i64174 %i = getelementptr inbounds %struct.R, ptr %x, i64 %idxprom, i32 0175 %i1 = getelementptr inbounds %struct.R, ptr %y, i64 %idxprom, i32 0176 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 dereferenceable(6) %i, ptr nonnull align 1 dereferenceable(6) %i1, i64 6, i1 false)177 %b = getelementptr inbounds %struct.R, ptr %y, i64 %idxprom, i32 1178 %i2 = load i32, ptr %b, align 1179 %add = add nsw i32 %add13, %i2180 %inc = add nuw nsw i32 %i.012, 1181 %cmp = icmp slt i32 %inc, %n182 br i1 %cmp, label %for.body, label %for.cond.for.cond.cleanup_crit_edge183}184 185; unsigned copy_noalias_negative_stride(S* __restrict__ a, S* b, int n) {186; for (int i = n; i >= 0; i--) {187; a[i] = b[i];188; }189; return sizeof(a[0]);190; }191 192; Function Attrs: nofree nosync nounwind uwtable mustprogress193define dso_local i32 @copy_noalias_negative_stride(ptr noalias nocapture %arg, ptr nocapture readonly %arg1, i32 %arg2) local_unnamed_addr {194; CHECK-LABEL: @copy_noalias_negative_stride(195; CHECK-NEXT: bb:196; CHECK-NEXT: [[I:%.*]] = icmp sgt i32 [[ARG2:%.*]], -1197; CHECK-NEXT: br i1 [[I]], label [[BB3:%.*]], label [[BB5:%.*]]198; CHECK: bb3:199; CHECK-NEXT: [[TMP0:%.*]] = add i32 [[ARG2]], 1200; CHECK-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64201; CHECK-NEXT: [[TMP2:%.*]] = mul nuw nsw i64 [[TMP1]], 12202; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 [[ARG:%.*]], ptr align 4 [[ARG1:%.*]], i64 [[TMP2]], i1 false)203; CHECK-NEXT: br label [[BB6:%.*]]204; CHECK: bb4:205; CHECK-NEXT: br label [[BB5]]206; CHECK: bb5:207; CHECK-NEXT: ret i32 12208; CHECK: bb6:209; CHECK-NEXT: [[I7:%.*]] = phi i32 [ [[I13:%.*]], [[BB6]] ], [ [[ARG2]], [[BB3]] ]210; CHECK-NEXT: [[I8:%.*]] = zext i32 [[I7]] to i64211; CHECK-NEXT: [[I9:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[ARG1]], i64 [[I8]]212; CHECK-NEXT: [[I10:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARG]], i64 [[I8]]213; CHECK-NEXT: [[I13]] = add nsw i32 [[I7]], -1214; CHECK-NEXT: [[I14:%.*]] = icmp sgt i32 [[I7]], 0215; CHECK-NEXT: br i1 [[I14]], label [[BB6]], label [[BB4:%.*]]216;217bb:218 %i = icmp sgt i32 %arg2, -1219 br i1 %i, label %bb3, label %bb5220 221bb3: ; preds = %bb222 br label %bb6223 224bb4: ; preds = %bb6225 br label %bb5226 227bb5: ; preds = %bb4, %bb228 ret i32 12229 230bb6: ; preds = %bb6, %bb3231 %i7 = phi i32 [ %i13, %bb6 ], [ %arg2, %bb3 ]232 %i8 = zext i32 %i7 to i64233 %i9 = getelementptr inbounds %struct.S, ptr %arg1, i64 %i8234 %i10 = getelementptr inbounds %struct.S, ptr %arg, i64 %i8235 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %i10, ptr noundef nonnull align 4 dereferenceable(12) %i9, i64 12, i1 false)236 %i13 = add nsw i32 %i7, -1237 %i14 = icmp sgt i32 %i7, 0238 br i1 %i14, label %bb6, label %bb4239}240 241; unsigned copy_noalias_opposite_stride(S* __restrict__ a, S* b, int n) {242; for (int i = 0, j = n; i < n && j >= 0; i++, j--) {243; a[i] = b[j];244; }245; return sizeof(a[0]);246; }247 248; Function Attrs: nofree nosync nounwind uwtable mustprogress249define dso_local i32 @copy_noalias_opposite_stride(ptr noalias nocapture %arg, ptr nocapture readonly %arg1, i32 %arg2) local_unnamed_addr {250; CHECK-LABEL: @copy_noalias_opposite_stride(251; CHECK-NEXT: bb:252; CHECK-NEXT: [[I:%.*]] = icmp sgt i32 [[ARG2:%.*]], 0253; CHECK-NEXT: br i1 [[I]], label [[BB3:%.*]], label [[BB5:%.*]]254; CHECK: bb3:255; CHECK-NEXT: br label [[BB6:%.*]]256; CHECK: bb4:257; CHECK-NEXT: br label [[BB5]]258; CHECK: bb5:259; CHECK-NEXT: ret i32 12260; CHECK: bb6:261; CHECK-NEXT: [[I7:%.*]] = phi i32 [ [[I16:%.*]], [[BB6]] ], [ [[ARG2]], [[BB3]] ]262; CHECK-NEXT: [[I8:%.*]] = phi i32 [ [[I15:%.*]], [[BB6]] ], [ 0, [[BB3]] ]263; CHECK-NEXT: [[I9:%.*]] = zext i32 [[I7]] to i64264; CHECK-NEXT: [[I10:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[ARG1:%.*]], i64 [[I9]]265; CHECK-NEXT: [[I11:%.*]] = zext i32 [[I8]] to i64266; CHECK-NEXT: [[I12:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[ARG:%.*]], i64 [[I11]]267; CHECK-NEXT: tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) [[I12]], ptr noundef nonnull align 4 dereferenceable(12) [[I10]], i64 12, i1 false)268; CHECK-NEXT: [[I15]] = add nuw nsw i32 [[I8]], 1269; CHECK-NEXT: [[I16]] = add nsw i32 [[I7]], -1270; CHECK-NEXT: [[I17:%.*]] = icmp slt i32 [[I15]], [[ARG2]]271; CHECK-NEXT: [[I18:%.*]] = icmp sgt i32 [[I7]], 0272; CHECK-NEXT: [[I19:%.*]] = and i1 [[I17]], [[I18]]273; CHECK-NEXT: br i1 [[I19]], label [[BB6]], label [[BB4:%.*]]274;275bb:276 %i = icmp sgt i32 %arg2, 0277 br i1 %i, label %bb3, label %bb5278 279bb3: ; preds = %bb280 br label %bb6281 282bb4: ; preds = %bb6283 br label %bb5284 285bb5: ; preds = %bb4, %bb286 ret i32 12287 288bb6: ; preds = %bb6, %bb3289 %i7 = phi i32 [ %i16, %bb6 ], [ %arg2, %bb3 ]290 %i8 = phi i32 [ %i15, %bb6 ], [ 0, %bb3 ]291 %i9 = zext i32 %i7 to i64292 %i10 = getelementptr inbounds %struct.S, ptr %arg1, i64 %i9293 %i11 = zext i32 %i8 to i64294 %i12 = getelementptr inbounds %struct.S, ptr %arg, i64 %i11295 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %i12, ptr noundef nonnull align 4 dereferenceable(12) %i10, i64 12, i1 false)296 %i15 = add nuw nsw i32 %i8, 1297 %i16 = add nsw i32 %i7, -1298 %i17 = icmp slt i32 %i15, %arg2299 %i18 = icmp sgt i32 %i7, 0300 %i19 = and i1 %i17, %i18301 br i1 %i19, label %bb6, label %bb4302}303 304%struct.SPacked = type <{ i32, i32, i8 }>305 306; Function Attrs: nofree nounwind uwtable mustprogress307define dso_local i32 @copy_noalias_packed(ptr noalias nocapture %a, ptr nocapture readonly %b, i32 %n) local_unnamed_addr {308; CHECK-LABEL: @copy_noalias_packed(309; CHECK-NEXT: entry:310; CHECK-NEXT: [[CMP7:%.*]] = icmp sgt i32 [[N:%.*]], 0311; CHECK-NEXT: br i1 [[CMP7]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]312; CHECK: for.body.preheader:313; CHECK-NEXT: [[TMP0:%.*]] = zext i32 [[N]] to i64314; CHECK-NEXT: [[TMP1:%.*]] = mul nuw nsw i64 [[TMP0]], 9315; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 [[A:%.*]], ptr align 1 [[B:%.*]], i64 [[TMP1]], i1 false)316; CHECK-NEXT: br label [[FOR_BODY:%.*]]317; CHECK: for.cond.cleanup.loopexit:318; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]319; CHECK: for.cond.cleanup:320; CHECK-NEXT: ret i32 9321; CHECK: for.body:322; CHECK-NEXT: [[I_08:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]323; CHECK-NEXT: [[IDXPROM:%.*]] = zext i32 [[I_08]] to i64324; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_SPACKED:%.*]], ptr [[B]], i64 [[IDXPROM]]325; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [[STRUCT_SPACKED]], ptr [[A]], i64 [[IDXPROM]]326; CHECK-NEXT: [[INC]] = add nuw nsw i32 [[I_08]], 1327; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[INC]], [[N]]328; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]]329;330entry:331 %cmp7 = icmp sgt i32 %n, 0332 br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup333 334for.body.preheader: ; preds = %entry335 br label %for.body336 337for.cond.cleanup.loopexit: ; preds = %for.body338 br label %for.cond.cleanup339 340for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry341 ret i32 9342 343for.body: ; preds = %for.body, %for.body.preheader344 %i.08 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]345 %idxprom = zext i32 %i.08 to i64346 %arrayidx = getelementptr inbounds %struct.SPacked, ptr %b, i64 %idxprom347 %arrayidx2 = getelementptr inbounds %struct.SPacked, ptr %a, i64 %idxprom348 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 dereferenceable(9) %arrayidx2, ptr nonnull align 1 dereferenceable(9) %arrayidx, i64 9, i1 false)349 %inc = add nuw nsw i32 %i.08, 1350 %cmp = icmp slt i32 %inc, %n351 br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit352}353 354%struct.SAligned = type { i32, i32, i8, [7 x i8] }355 356define dso_local i32 @copy_noalias_aligned(ptr noalias nocapture %a, ptr nocapture readonly %b, i32 %n) local_unnamed_addr {357; CHECK-LABEL: @copy_noalias_aligned(358; CHECK-NEXT: entry:359; CHECK-NEXT: [[CMP7:%.*]] = icmp sgt i32 [[N:%.*]], 0360; CHECK-NEXT: br i1 [[CMP7]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]361; CHECK: for.body.preheader:362; CHECK-NEXT: [[TMP0:%.*]] = zext i32 [[N]] to i64363; CHECK-NEXT: [[TMP1:%.*]] = shl nuw nsw i64 [[TMP0]], 4364; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 16 [[A:%.*]], ptr align 16 [[B:%.*]], i64 [[TMP1]], i1 false)365; CHECK-NEXT: br label [[FOR_BODY:%.*]]366; CHECK: for.cond.cleanup.loopexit:367; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]368; CHECK: for.cond.cleanup:369; CHECK-NEXT: ret i32 16370; CHECK: for.body:371; CHECK-NEXT: [[I_08:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]372; CHECK-NEXT: [[IDXPROM:%.*]] = zext i32 [[I_08]] to i64373; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_SALIGNED:%.*]], ptr [[B]], i64 [[IDXPROM]]374; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [[STRUCT_SALIGNED]], ptr [[A]], i64 [[IDXPROM]]375; CHECK-NEXT: [[INC]] = add nuw nsw i32 [[I_08]], 1376; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[INC]], [[N]]377; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]]378;379entry:380 %cmp7 = icmp sgt i32 %n, 0381 br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup382 383for.body.preheader: ; preds = %entry384 br label %for.body385 386for.cond.cleanup.loopexit: ; preds = %for.body387 br label %for.cond.cleanup388 389for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry390 ret i32 16391 392for.body: ; preds = %for.body, %for.body.preheader393 %i.08 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]394 %idxprom = zext i32 %i.08 to i64395 %arrayidx = getelementptr inbounds %struct.SAligned, ptr %b, i64 %idxprom396 %arrayidx2 = getelementptr inbounds %struct.SAligned, ptr %a, i64 %idxprom397 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 dereferenceable(16) %arrayidx2, ptr nonnull align 16 dereferenceable(16) %arrayidx, i64 16, i1 false)398 %inc = add nuw nsw i32 %i.08, 1399 %cmp = icmp slt i32 %inc, %n400 br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit401}402 403; Function Attrs: argmemonly nofree nosync nounwind willreturn404declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1405