Skip to content

Commit 99b86d7

Browse files
committed
[PassManager] add tests for vector pass enabling; NFC
1 parent ec1e7fa commit 99b86d7

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
; RUN: opt -O1 -debug-pass=Structure < %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O1
2+
; RUN: opt -O2 -debug-pass=Structure < %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O2
3+
; RUN: opt -O1 -vectorize-loops=0 -debug-pass=Structure < %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O1_FORCE_OFF
4+
; RUN: opt -O2 -vectorize-loops=0 -debug-pass=Structure < %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O2_FORCE_OFF
5+
; RUN: opt -disable-verify -debug-pass-manager -passes='default<O1>' -S %s 2>&1 | FileCheck %s --check-prefixes=NEWPM_O1
6+
; RUN: opt -disable-verify -debug-pass-manager -passes='default<O2>' -S %s 2>&1 | FileCheck %s --check-prefixes=NEWPM_O2
7+
8+
; REQUIRES: asserts
9+
10+
; SLP does not run at -O1. Loop vectorization runs, but it only
11+
; works on loops explicitly annotated with pragmas.
12+
13+
; OLDPM_O1-LABEL: Pass Arguments:
14+
; OLDPM_O1: Loop Vectorization
15+
; OLDPM_O1: Optimize scalar/vector ops
16+
; OLDPM_O1-NOT: SLP Vectorizer
17+
18+
; Everything runs at -O2.
19+
20+
; OLDPM_O2-LABEL: Pass Arguments:
21+
; OLDPM_O2: Loop Vectorization
22+
; OLDPM_O2: Optimize scalar/vector ops
23+
; OLDPM_O2: SLP Vectorizer
24+
25+
; The loop vectorizer still runs at both -O1/-O2 even with the
26+
; debug flag, but it only works on loops explicitly annotated
27+
; with pragmas.
28+
29+
; OLDPM_O1_FORCE_OFF-LABEL: Pass Arguments:
30+
; OLDPM_O1_FORCE_OFF: Loop Vectorization
31+
; OLDPM_O1_FORCE_OFF: Optimize scalar/vector ops
32+
; OLDPM_O1_FORCE_OFF-NOT: SLP Vectorizer
33+
34+
; OLDPM_O2_FORCE_OFF-LABEL: Pass Arguments:
35+
; OLDPM_O2_FORCE_OFF: Loop Vectorization
36+
; OLDPM_O2_FORCE_OFF: Optimize scalar/vector ops
37+
; OLDPM_O2_FORCE_OFF: SLP Vectorizer
38+
39+
; There should be no difference with the new pass manager.
40+
; This is tested more thoroughly in other test files.
41+
42+
; NEWPM_O1-LABEL: Running pass: LoopVectorizePass
43+
; NEWPM_O1: Running pass: VectorCombinePass
44+
; NEWPM_O1-NOT: Running pass: SLPVectorizerPass
45+
46+
; NEWPM_O2-LABEL: Running pass: LoopVectorizePass
47+
; NEWPM_O2: Running pass: VectorCombinePass
48+
; NEWPM_O2: Running pass: SLPVectorizerPass
49+
50+
define void @f() {
51+
ret void
52+
}

0 commit comments

Comments
 (0)