|
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 | 1 | ; RUN: opt -disable-verify -debug-pass-manager -passes='default<O1>' -S %s 2>&1 | FileCheck %s --check-prefixes=NEWPM_O1
|
7 | 2 | ; RUN: opt -disable-verify -debug-pass-manager -passes='default<O2>' -S %s 2>&1 | FileCheck %s --check-prefixes=NEWPM_O2
|
8 | 3 | ; RUN: opt -disable-verify -debug-pass-manager -passes='default<O2>' -extra-vectorizer-passes -S %s 2>&1 | FileCheck %s --check-prefixes=NEWPM_O2_EXTRA
|
|
18 | 13 | ; OLDPM_O1: Optimize scalar/vector ops
|
19 | 14 |
|
20 | 15 | ; Everything runs at -O2.
|
21 |
| - |
22 |
| -; OLDPM_O2-LABEL: Pass Arguments: |
23 |
| -; OLDPM_O2: Loop Vectorization |
24 |
| -; OLDPM_O2: SLP Vectorizer |
25 |
| -; OLDPM_O2: Optimize scalar/vector ops |
26 |
| - |
27 |
| -; Optionally run cleanup passes. |
28 |
| - |
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 |
41 |
| - |
42 |
| - |
43 |
| -; The loop vectorizer still runs at both -O1/-O2 even with the |
44 |
| -; debug flag, but it only works on loops explicitly annotated |
45 |
| -; with pragmas. |
46 |
| - |
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 |
51 |
| - |
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 |
| 16 | +; O2-LABEL: Running pass: LoopVectorizePass |
| 17 | +; O2-NOT: Running pass: EarlyCSEPass |
| 18 | +; O2-NOT: Running pass: LICMPass |
| 19 | +; O2: Running pass: SLPVectorizerPass |
| 20 | +; O2: Running pass: VectorCombinePass |
56 | 21 |
|
57 | 22 | ; There should be no difference with the new pass manager.
|
58 | 23 | ; This is tested more thoroughly in other test files.
|
|
77 | 42 | ; NEWPM_O2_EXTRA: Running pass: EarlyCSEPass
|
78 | 43 | ; NEWPM_O2_EXTRA: Running pass: VectorCombinePass
|
79 | 44 |
|
80 |
| -define i64 @f(i1 %cond) { |
| 45 | +define i64 @f(i1 %cond, i32* %src, i32* %dst) { |
81 | 46 | entry:
|
82 | 47 | br label %loop
|
83 | 48 |
|
84 | 49 | loop:
|
85 | 50 | %i = phi i64 [ 0, %entry ], [ %inc, %loop ]
|
86 |
| - %inc = add i64 %i, 1 |
87 |
| - br i1 %cond, label %loop, label %exit |
| 51 | + %src.i = getelementptr i32, i32* %src, i64 %i |
| 52 | + %src.v = load i32, i32* %src.i |
| 53 | + %add = add i32 %src.v, 10 |
| 54 | + %dst.i = getelementptr i32, i32* %dst, i64 %i |
| 55 | + store i32 %add, i32* %dst.i |
| 56 | + %inc = add nuw nsw i64 %i, 1 |
| 57 | + %ec = icmp ne i64 %inc, 1000 |
| 58 | + br i1 %ec, label %loop, label %exit |
88 | 59 |
|
89 | 60 | exit:
|
90 | 61 | ret i64 %i
|
|
0 commit comments