Skip to content

Commit 6709932

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

File tree

2 files changed

+41
-39
lines changed

2 files changed

+41
-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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,44 @@ 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+
; REQUIRES: asserts
69+
; RUN: opt -passes=loop-vectorize -pass-remarks=loop-vectorize \
70+
; RUN: -pass-remarks-missed=loop-vectorize \
71+
; RUN: -pass-remarks-analysis=loop-vectorize -debug -disable-output \
72+
; RUN: -force-vector-interleave=1 -force-vector-width=2 \
73+
; RUN: < %s 2>&1 | FileCheck %s
74+
; CHECK-NOT: LV: We can vectorize this loop
75+
; CHECK-NOT: LV: Not vectorizing: #pragma vectorize disable.
76+
; CHECK-NOT: LV: Not vectorizing: VectorizeOnlyWhenForced is set
77+
; CHECK-NOT: LV: Not vectorizing: Disabled/already vectorized
78+
; CHECK-NOT: LV: Not vectorizing: Cannot prove legality
79+
; CHECK: LV: Loop hints: force=disabled
80+
; CHECK: LV: Not vectorizing: loop hasDisableAllTransformsHint.
81+
; CHECK: remark:
82+
; CHECK-SAME: loop not vectorized: loop transformations are disabled
83+
; CHECK: LV: Loop hints prevent vectorization
84+
define void @disable_nonforced(ptr nocapture %a, i32 %n) {
85+
entry:
86+
br label %for.body
87+
88+
for.body:
89+
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
90+
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
91+
%0 = trunc i64 %indvars.iv to i32
92+
store i32 %0, ptr %arrayidx, align 4
93+
%indvars.iv.next = add i64 %indvars.iv, 1
94+
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
95+
%exitcond = icmp eq i32 %lftr.wideiv, %n
96+
br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
97+
98+
for.end:
99+
ret void
100+
}
101+
102+
!0 = !{!0, !{!"llvm.loop.disable_nonforced"}}

0 commit comments

Comments
 (0)