Skip to content

Commit 552a8ab

Browse files
author
GYT
committed
try moving Test3 into the same file as Test 1&2
1 parent 7f9fe50 commit 552a8ab

File tree

2 files changed

+40
-39
lines changed

2 files changed

+40
-39
lines changed

llvm/test/Transforms/LoopVectorize/diag-disable_nonforced-msgs.ll

Lines changed: 0 additions & 39 deletions
This file was deleted.

llvm/test/Transforms/LoopVectorize/diag-disabled-vectorization-msgs.ll

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,43 @@ exit:
5959

6060
!0 = distinct !{!0, !1}
6161
!1 = !{!"llvm.loop.vectorize.enable", i1 false}
62+
63+
; TEST 3
64+
; This test checks that we emit only the correct debug messages and
65+
; optimization remark when the loop vectorizer is disabled by loop metadata
66+
; that requests no loop transformations.
67+
68+
; RUN: opt -passes=loop-vectorize -pass-remarks=loop-vectorize \
69+
; RUN: -pass-remarks-missed=loop-vectorize \
70+
; RUN: -pass-remarks-analysis=loop-vectorize -debug -disable-output \
71+
; RUN: -force-vector-interleave=1 -force-vector-width=2 \
72+
; RUN: < %s 2>&1 | FileCheck %s
73+
; CHECK-NOT: LV: We can vectorize this loop
74+
; CHECK-NOT: LV: Not vectorizing: #pragma vectorize disable.
75+
; CHECK-NOT: LV: Not vectorizing: VectorizeOnlyWhenForced is set
76+
; CHECK-NOT: LV: Not vectorizing: Disabled/already vectorized
77+
; CHECK-NOT: LV: Not vectorizing: Cannot prove legality
78+
; CHECK: LV: Loop hints: force=disabled
79+
; CHECK: LV: Not vectorizing: loop hasDisableAllTransformsHint.
80+
; CHECK: remark:
81+
; CHECK-SAME: loop not vectorized: loop transformations are disabled
82+
; CHECK: LV: Loop hints prevent vectorization
83+
define void @disable_nonforced(ptr nocapture %a, i32 %n) {
84+
entry:
85+
br label %for.body
86+
87+
for.body:
88+
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
89+
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
90+
%0 = trunc i64 %indvars.iv to i32
91+
store i32 %0, ptr %arrayidx, align 4
92+
%indvars.iv.next = add i64 %indvars.iv, 1
93+
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
94+
%exitcond = icmp eq i32 %lftr.wideiv, %n
95+
br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !2
96+
97+
for.end:
98+
ret void
99+
}
100+
101+
!2 = !{!2, !{!"llvm.loop.disable_nonforced"}}

0 commit comments

Comments
 (0)