brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · 03918a1 Raw
70 lines · plain
1; RUN: opt < %s -passes=loop-vectorize,transform-warning -S 2>&1 | FileCheck %s2 3; Like no_array_bounds.ll we verify warnings are generated when vectorization/interleaving is4; explicitly specified and fails to occur for both fixed and scalable vectorize.width loop hints.5 6;  #pragma clang loop vectorize(enable)7;  for (int i = 0; i < number; i++) {8;    A[B[i]]++;9;  }10 11; CHECK: warning: <unknown>:0:0: loop not interleaved: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering12define dso_local void @foo(ptr nocapture %A, ptr nocapture readonly %B, i32 %N) {13entry:14  %cmp7 = icmp sgt i32 %N, 015  br i1 %cmp7, label %for.body.preheader, label %for.end16 17for.body.preheader:                               ; preds = %entry18  %wide.trip.count = zext i32 %N to i6419  br label %for.body20 21for.body:                                         ; preds = %for.body.preheader, %for.body22  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]23  %arrayidx = getelementptr inbounds i32, ptr %B, i64 %indvars.iv24  %0 = load i32, ptr %arrayidx, align 425  %idxprom1 = sext i32 %0 to i6426  %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %idxprom127  %1 = load i32, ptr %arrayidx2, align 428  %inc = add nsw i32 %1, 129  store i32 %inc, ptr %arrayidx2, align 430  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 131  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count32  br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !033 34for.end:                                          ; preds = %for.body, %entry35  ret void36}37 38; CHECK: warning: <unknown>:0:0: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering39define dso_local void @foo2(ptr nocapture %A, ptr nocapture readonly %B, i32 %N) {40entry:41  %cmp7 = icmp sgt i32 %N, 042  br i1 %cmp7, label %for.body.preheader, label %for.end43 44for.body.preheader:                               ; preds = %entry45  %wide.trip.count = zext i32 %N to i6446  br label %for.body47 48for.body:                                         ; preds = %for.body.preheader, %for.body49  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]50  %arrayidx = getelementptr inbounds i32, ptr %B, i64 %indvars.iv51  %0 = load i32, ptr %arrayidx, align 452  %idxprom1 = sext i32 %0 to i6453  %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %idxprom154  %1 = load i32, ptr %arrayidx2, align 455  %inc = add nsw i32 %1, 156  store i32 %inc, ptr %arrayidx2, align 457  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 158  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count59  br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !360 61for.end:                                          ; preds = %for.body, %entry62  ret void63}64 65!0 = distinct !{!0, !1, !2}66!1 = !{!"llvm.loop.vectorize.enable", i1 true}67!2 = !{!"llvm.loop.vectorize.width", i32 1}68!3 = distinct !{!3, !1, !2, !4}69!4 = !{!"llvm.loop.vectorize.scalable.enable", i1 true}70