1 ; RUN: opt -enable-new-pm=0 -O1 -debug-pass=Structure < %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O1
2 ; RUN: opt -enable-new-pm=0 -O2 -debug-pass=Structure < %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O2
3 ; RUN: opt -enable-new-pm=0 -O2 -extra-vectorizer-passes -debug-pass=Structure < %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O2_EXTRA
4 ; RUN: opt -enable-new-pm=0 -O1 -vectorize-loops=0 -debug-pass=Structure < %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O1_FORCE_OFF
5 ; RUN: opt -enable-new-pm=0 -O2 -vectorize-loops=0 -debug-pass=Structure < %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O2_FORCE_OFF
6 ; RUN: opt -disable-verify -debug-pass-manager -passes='default<O1>' -S %s 2>&1 | FileCheck %s --check-prefixes=NEWPM_O1
7 ; RUN: opt -disable-verify -debug-pass-manager -passes='default<O2>' -S %s 2>&1 | FileCheck %s --check-prefixes=NEWPM_O2
8 ; RUN: opt -disable-verify -debug-pass-manager -passes='default<O2>' -extra-vectorizer-passes -S %s 2>&1 | FileCheck %s --check-prefixes=NEWPM_O2_EXTRA
12 ; SLP does not run at -O1. Loop vectorization runs, but it only
13 ; works on loops explicitly annotated with pragmas.
15 ; OLDPM_O1-LABEL: Pass Arguments:
16 ; OLDPM_O1: Loop Vectorization
17 ; OLDPM_O1-NOT: SLP Vectorizer
18 ; OLDPM_O1: Optimize scalar/vector ops
20 ; Everything runs at -O2.
22 ; OLDPM_O2-LABEL: Pass Arguments:
23 ; OLDPM_O2: Loop Vectorization
24 ; OLDPM_O2: SLP Vectorizer
25 ; OLDPM_O2: Optimize scalar/vector ops
27 ; Optionally run cleanup passes.
29 ; OLDPM_O2_EXTRA-LABEL: Pass Arguments:
30 ; OLDPM_O2_EXTRA: Loop Vectorization
31 ; OLDPM_O2_EXTRA: Early CSE
32 ; OLDPM_O2_EXTRA: Value Propagation
33 ; OLDPM_O2_EXTRA: Combine redundant instructions
34 ; OLDPM_O2_EXTRA: Loop Invariant Code Motion
35 ; OLDPM_O2_EXTRA: Unswitch loops
36 ; OLDPM_O2_EXTRA: Simplify the CFG
37 ; OLDPM_O2_EXTRA: Combine redundant instructions
38 ; OLDPM_O2_EXTRA: SLP Vectorizer
39 ; OLDPM_O2_EXTRA: Early CSE
40 ; OLDPM_O2_EXTRA: Optimize scalar/vector ops
43 ; The loop vectorizer still runs at both -O1/-O2 even with the
44 ; debug flag, but it only works on loops explicitly annotated
47 ; OLDPM_O1_FORCE_OFF-LABEL: Pass Arguments:
48 ; OLDPM_O1_FORCE_OFF: Loop Vectorization
49 ; OLDPM_O1_FORCE_OFF-NOT: SLP Vectorizer
50 ; OLDPM_O1_FORCE_OFF: Optimize scalar/vector ops
52 ; OLDPM_O2_FORCE_OFF-LABEL: Pass Arguments:
53 ; OLDPM_O2_FORCE_OFF: Loop Vectorization
54 ; OLDPM_O2_FORCE_OFF: SLP Vectorizer
55 ; OLDPM_O2_FORCE_OFF: Optimize scalar/vector ops
57 ; There should be no difference with the new pass manager.
58 ; This is tested more thoroughly in other test files.
60 ; NEWPM_O1-LABEL: Running pass: LoopVectorizePass
61 ; NEWPM_O1-NOT: Running pass: SLPVectorizerPass
62 ; NEWPM_O1: Running pass: VectorCombinePass
64 ; NEWPM_O2-LABEL: Running pass: LoopVectorizePass
65 ; NEWPM_O2: Running pass: SLPVectorizerPass
66 ; NEWPM_O2: Running pass: VectorCombinePass
68 ; NEWPM_O2_EXTRA-LABEL: Running pass: LoopVectorizePass
69 ; NEWPM_O2_EXTRA: Running pass: EarlyCSEPass
70 ; NEWPM_O2_EXTRA: Running pass: CorrelatedValuePropagationPass
71 ; NEWPM_O2_EXTRA: Running pass: InstCombinePass
72 ; NEWPM_O2_EXTRA: Running pass: LICMPass
73 ; NEWPM_O2_EXTRA: Running pass: SimpleLoopUnswitchPass
74 ; NEWPM_O2_EXTRA: Running pass: SimplifyCFGPass
75 ; NEWPM_O2_EXTRA: Running pass: InstCombinePass
76 ; NEWPM_O2_EXTRA: Running pass: SLPVectorizerPass
77 ; NEWPM_O2_EXTRA: Running pass: EarlyCSEPass
78 ; NEWPM_O2_EXTRA: Running pass: VectorCombinePass
80 define i64 @f(i1 %cond) {
85 %i = phi i64 [ 0, %entry ], [ %inc, %loop ]
87 br i1 %cond, label %loop, label %exit