85 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=loop-vectorize -S -mtriple=aarch64-unknown-linux-gnu -force-vector-interleave=1 -force-vector-width=4 < %s | FileCheck %s3 4; The test checks that there is no assert caused by issue described in PR360325 6target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"7 8%struct.anon = type { i8 }9 10@c = local_unnamed_addr global [6 x i8] zeroinitializer, align 111@b = internal global %struct.anon zeroinitializer, align 112 13; Function Attrs: noreturn nounwind14define void @_Z1dv() local_unnamed_addr #0 {15; CHECK-LABEL: @_Z1dv(16; CHECK-NEXT: entry:17; CHECK-NEXT: [[CALL:%.*]] = tail call ptr @"_ZN3$_01aEv"(ptr nonnull @b)18; CHECK-NEXT: br label [[FOR_COND:%.*]]19; CHECK: for.cond:20; CHECK-NEXT: [[F_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[ADD5:%.*]], [[FOR_COND_CLEANUP:%.*]] ]21; CHECK-NEXT: [[G_0:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[G_1_LCSSA:%.*]], [[FOR_COND_CLEANUP]] ]22; CHECK-NEXT: [[CMP12:%.*]] = icmp ult i32 [[G_0]], 423; CHECK-NEXT: [[CONV:%.*]] = and i32 [[F_0]], 6553524; CHECK-NEXT: br i1 [[CMP12]], label [[FOR_BODY_LR_PH:%.*]], label [[FOR_COND_CLEANUP]]25; CHECK: for.body.lr.ph:26; CHECK-NEXT: [[TMP0:%.*]] = zext i32 [[G_0]] to i6427; CHECK-NEXT: br label [[FOR_BODY:%.*]]28; CHECK: for.cond.cleanup.loopexit:29; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]30; CHECK: for.cond.cleanup:31; CHECK-NEXT: [[G_1_LCSSA]] = phi i32 [ [[G_0]], [[FOR_COND]] ], [ 4, [[FOR_COND_CLEANUP_LOOPEXIT:%.*]] ]32; CHECK-NEXT: [[ADD5]] = add nuw nsw i32 [[CONV]], 433; CHECK-NEXT: br label [[FOR_COND]]34; CHECK: for.body:35; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[TMP0]], [[FOR_BODY_LR_PH]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]36; CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[INDVARS_IV]] to i3237; CHECK-NEXT: [[ADD:%.*]] = add i32 [[CONV]], [[TMP1]]38; CHECK-NEXT: [[IDXPROM:%.*]] = zext i32 [[ADD]] to i6439; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [6 x i8], ptr @c, i64 0, i64 [[IDXPROM]]40; CHECK-NEXT: [[TMP2:%.*]] = load i8, ptr [[ARRAYIDX]], align 141; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i8, ptr [[CALL]], i64 [[INDVARS_IV]]42; CHECK-NEXT: store i8 [[TMP2]], ptr [[ARRAYIDX3]], align 143; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 144; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i64 [[INDVARS_IV_NEXT]], 445; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_COND_CLEANUP_LOOPEXIT]], label [[FOR_BODY]]46;47entry:48 %call = tail call ptr @"_ZN3$_01aEv"(ptr nonnull @b) #249 br label %for.cond50 51for.cond: ; preds = %for.cond.cleanup, %entry52 %f.0 = phi i32 [ 0, %entry ], [ %add5, %for.cond.cleanup ]53 %g.0 = phi i32 [ 0, %entry ], [ %g.1.lcssa, %for.cond.cleanup ]54 %cmp12 = icmp ult i32 %g.0, 455 %conv = and i32 %f.0, 6553556 br i1 %cmp12, label %for.body.lr.ph, label %for.cond.cleanup57 58for.body.lr.ph: ; preds = %for.cond59 %0 = zext i32 %g.0 to i6460 br label %for.body61 62for.cond.cleanup.loopexit: ; preds = %for.body63 br label %for.cond.cleanup64 65for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %for.cond66 %g.1.lcssa = phi i32 [ %g.0, %for.cond ], [ 4, %for.cond.cleanup.loopexit ]67 %add5 = add nuw nsw i32 %conv, 468 br label %for.cond69 70for.body: ; preds = %for.body, %for.body.lr.ph71 %indvars.iv = phi i64 [ %0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]72 %1 = trunc i64 %indvars.iv to i3273 %add = add i32 %conv, %174 %idxprom = zext i32 %add to i6475 %arrayidx = getelementptr inbounds [6 x i8], ptr @c, i64 0, i64 %idxprom76 %2 = load i8, ptr %arrayidx, align 177 %arrayidx3 = getelementptr inbounds i8, ptr %call, i64 %indvars.iv78 store i8 %2, ptr %arrayidx3, align 179 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 180 %exitcond = icmp eq i64 %indvars.iv.next, 481 br i1 %exitcond, label %for.cond.cleanup.loopexit, label %for.body82}83 84declare ptr @"_ZN3$_01aEv"(ptr) local_unnamed_addr #185