|
| 1 | +; TEST 1 |
1 | 2 | ; This test checks that we emit only the correct debug messages and |
2 | 3 | ; optimization remark when the loop vectorizer is disabled by loop metadata. |
3 | 4 |
|
4 | 5 | ; REQUIRES: asserts |
5 | 6 | ; RUN: opt -passes=loop-vectorize -pass-remarks=loop-vectorize \ |
6 | 7 | ; RUN: -pass-remarks-missed=loop-vectorize \ |
7 | 8 | ; RUN: -pass-remarks-analysis=loop-vectorize -debug -disable-output \ |
8 | | -; RUN: < %s 2>&1 | FileCheck %s |
9 | | -; CHECK-NOT: LV: We can vectorize this loop |
10 | | -; CHECK-NOT: LV: Not vectorizing: loop hasDisableAllTransformsHint |
11 | | -; CHECK-NOT: LV: [BUG] Not vectorizing: loop vect disabled for an unknown reason |
12 | | -; CHECK-NOT: LV: Not vectorizing: VectorizeOnlyWhenForced is set |
13 | | -; CHECK-NOT: LV: Not vectorizing: Disabled/already vectorized |
14 | | -; CHECK-NOT: LV: Not vectorizing: Cannot prove legality |
15 | | -; CHECK: LV: Loop hints: force=disabled |
16 | | -; CHECK: LV: Not vectorizing: #pragma vectorize disable. |
17 | | -; CHECK: remark: |
18 | | -; CHECK-SAME: loop not vectorized: vectorization is explicitly disabled |
19 | | -; CHECK: LV: Loop hints prevent vectorization |
| 9 | +; RUN: < %s 2>&1 | FileCheck --check-prefix=METADATA %s |
| 10 | +; METADATA-NOT: LV: We can vectorize this loop |
| 11 | +; METADATA-NOT: LV: Not vectorizing: loop hasDisableAllTransformsHint |
| 12 | +; METADATA-NOT: LV: [BUG] Not vectorizing: loop vect disabled for an unknown reason |
| 13 | +; METADATA-NOT: LV: Not vectorizing: VectorizeOnlyWhenForced is set |
| 14 | +; METADATA-NOT: LV: Not vectorizing: Disabled/already vectorized |
| 15 | +; METADATA-NOT: LV: Not vectorizing: Cannot prove legality |
| 16 | +; METADATA: LV: Loop hints: force=disabled |
| 17 | +; METADATA: LV: Not vectorizing: #pragma vectorize disable. |
| 18 | +; METADATA: remark: |
| 19 | +; METADATA-SAME: loop not vectorized: vectorization is explicitly disabled |
| 20 | +; METADATA: LV: Loop hints prevent vectorization |
| 21 | + |
| 22 | +; TEST 2 |
| 23 | +; This test checks that we emit only the correct debug messages and |
| 24 | +; optimization remark when the loop is not vectorized due to the |
| 25 | +; vectorize-forced-only pass option being set. |
| 26 | + |
| 27 | +; Strip metadata for FORCEDONLY run, keep it for METADATA run |
| 28 | +; RUN: sed 's/,[[:space:]]*!llvm\.loop[[:space:]]*!0//' %s | \ |
| 29 | +; RUN: opt -passes='loop-vectorize<vectorize-forced-only>' \ |
| 30 | +; RUN: -pass-remarks=loop-vectorize \ |
| 31 | +; RUN: -pass-remarks-missed=loop-vectorize \ |
| 32 | +; RUN: -pass-remarks-analysis=loop-vectorize -debug -disable-output \ |
| 33 | +; RUN: 2>&1 | FileCheck --check-prefix=FORCEDONLY %s |
| 34 | +; FORCEDONLY-NOT: LV: We can vectorize this loop |
| 35 | +; FORCEDONLY-NOT: LV: Not vectorizing: loop hasDisableAllTransformsHint |
| 36 | +; FORCEDONLY-NOT: LV: [BUG] Not vectorizing: loop vect disabled for an unknown reason |
| 37 | +; FORCEDONLY-NOT: LV: Not vectorizing: #pragma vectorize disable |
| 38 | +; FORCEDONLY-NOT: LV: Not vectorizing: Disabled/already vectorized |
| 39 | +; FORCEDONLY-NOT: LV: Not vectorizing: Cannot prove legality |
| 40 | +; FORCEDONLY: LV: Loop hints: force=? |
| 41 | +; FORCEDONLY: LV: Not vectorizing: VectorizeOnlyWhenForced is set, and no #pragma vectorize enable |
| 42 | +; FORCEDONLY: remark: |
| 43 | +; FORCEDONLY-SAME: loop not vectorized: only vectorizing loops that explicitly request it |
| 44 | +; FORCEDONLY: LV: Loop hints prevent vectorization |
20 | 45 |
|
21 | 46 | define double @CompareDistmats(ptr %distmat1, ptr %distmat2){ |
22 | 47 | entry: |
|
0 commit comments