|
| 1 | +; This test checks that we emit only the correct debug messages and |
| 2 | +; optimization remark when the loop is not vectorized due to the |
| 3 | +; vectorize-forced-only pass option being set. |
| 4 | + |
| 5 | +; REQUIRES: asserts |
| 6 | +; RUN: opt -passes='loop-vectorize<vectorize-forced-only>' \ |
| 7 | +; RUN: -pass-remarks=loop-vectorize \ |
| 8 | +; RUN: -pass-remarks-missed=loop-vectorize \ |
| 9 | +; RUN: -pass-remarks-analysis=loop-vectorize -debug -disable-output \ |
| 10 | +; RUN: < %s 2>&1 | FileCheck %s |
| 11 | +; CHECK-NOT: LV: We can vectorize this loop |
| 12 | +; CHECK-NOT: LV: Not vectorizing: loop hasDisableAllTransformsHint |
| 13 | +; CHECK-NOT: LV: [FIXME] Not vectorizing: loop vect disabled for an unknown reason |
| 14 | +; CHECK-NOT: LV: Not vectorizing: #pragma vectorize disable |
| 15 | +; CHECK-NOT: LV: Not vectorizing: Disabled/already vectorized |
| 16 | +; CHECK-NOT: LV: Not vectorizing: Cannot prove legality |
| 17 | +; CHECK: LV: Loop hints: force=? |
| 18 | +; CHECK: LV: Not vectorizing: VectorizeOnlyWhenForced is set, and no #pragma vectorize enable |
| 19 | +; CHECK: remark: |
| 20 | +; CHECK-SAME: loop not vectorized: only vectorizing loops that explicitly request it |
| 21 | +; CHECK: LV: Loop hints prevent vectorization |
| 22 | + |
| 23 | +define dso_local noundef nofpclass(nan inf) double @_Z15CompareDistmatsPKdS0_(ptr noundef readonly captures(none) %distmat1, ptr noundef readonly captures(none) %distmat2) local_unnamed_addr { |
| 24 | +entry: |
| 25 | + br label %for.body |
| 26 | + |
| 27 | +for.cond.cleanup: ; preds = %for.body |
| 28 | + %add.lcssa = phi double [ %add, %for.body ] |
| 29 | + %div = fmul fast double %add.lcssa, 0x3FB1111111111111 |
| 30 | + %0 = tail call fast double @llvm.sqrt.f64(double %div) |
| 31 | + ret double %0 |
| 32 | + |
| 33 | +for.body: ; preds = %entry, %for.body |
| 34 | + %i.014 = phi i64 [ 0, %entry ], [ %inc, %for.body ] |
| 35 | + %RMSD.013 = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ] |
| 36 | + %arrayidx = getelementptr inbounds nuw double, ptr %distmat1, i64 %i.014 |
| 37 | + %1 = load double, ptr %arrayidx, align 8 |
| 38 | + %arrayidx1 = getelementptr inbounds nuw double, ptr %distmat2, i64 %i.014 |
| 39 | + %2 = load double, ptr %arrayidx1, align 8 |
| 40 | + %sub = fsub fast double %1, %2 |
| 41 | + %mul = fmul fast double %sub, %sub |
| 42 | + %add = fadd fast double %mul, %RMSD.013 |
| 43 | + %inc = add nuw nsw i64 %i.014, 1 |
| 44 | + %exitcond.not = icmp eq i64 %inc, 15 |
| 45 | + br i1 %exitcond.not, label %for.cond.cleanup, label %for.body |
| 46 | +} |
0 commit comments