Mercurial > hg > CbC > CbC_llvm
comparison llvm/test/Feature/optnone-opt.ll @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 1d019706d866 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
1 ; RUN: opt -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-O0 | 1 ; RUN: opt -S -debug -enable-new-pm=0 %s 2>&1 | FileCheck %s --check-prefix=O0 |
2 ; RUN: opt -O1 -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-O1 | 2 ; RUN: opt -O1 -S -debug -enable-new-pm=0 %s 2>&1 | FileCheck %s --check-prefix=O1 |
3 ; RUN: opt -O2 -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-O1 --check-prefix=OPT-O2O3 | 3 ; RUN: opt -O2 -S -debug -enable-new-pm=0 %s 2>&1 | FileCheck %s --check-prefix=O1 --check-prefix=O2O3 |
4 ; RUN: opt -O3 -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-O1 --check-prefix=OPT-O2O3 | 4 ; RUN: opt -O3 -S -debug -enable-new-pm=0 %s 2>&1 | FileCheck %s --check-prefix=O1 --check-prefix=O2O3 |
5 ; RUN: opt -dce -die -gvn-hoist -loweratomic -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-MORE | 5 ; RUN: opt -dce -gvn-hoist -loweratomic -S -debug -enable-new-pm=0 %s 2>&1 | FileCheck %s --check-prefix=MORE |
6 ; RUN: opt -indvars -licm -loop-deletion -loop-extract -loop-idiom -loop-instsimplify -loop-reduce -loop-reroll -loop-rotate -loop-unroll -loop-unswitch -S -debug %s 2>&1 | FileCheck %s --check-prefix=OPT-LOOP | 6 ; RUN: opt -indvars -licm -loop-deletion -loop-extract -loop-idiom -loop-instsimplify -loop-reduce -loop-reroll -loop-rotate -loop-unroll -loop-unswitch -enable-new-pm=0 -S -debug %s 2>&1 | FileCheck %s --check-prefix=LOOP |
7 ; RUN: opt -passes='default<O0>' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=%llvmcheckext-NPM-O0 | |
8 ; RUN: opt -passes='default<O1>' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-O1 | |
9 ; RUN: opt -passes='default<O2>' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-O1 --check-prefix=NPM-O2O3 | |
10 ; RUN: opt -passes='default<O3>' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-O1 --check-prefix=NPM-O2O3 | |
11 ; RUN: opt -passes='dce,gvn-hoist,loweratomic' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-MORE | |
12 ; RUN: opt -passes='loop(indvars,licm,loop-deletion,loop-idiom,loop-instsimplify,loop-reduce,simple-loop-unswitch),loop-unroll' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-LOOP | |
13 ; RUN: opt -passes='instsimplify,verify' -S -debug-pass-manager %s 2>&1 | FileCheck %s --check-prefix=NPM-REQUIRED | |
7 | 14 |
8 ; REQUIRES: asserts | 15 ; REQUIRES: asserts |
9 | 16 |
10 ; This test verifies that we don't run target independent IR-level | 17 ; This test verifies that we don't run target independent IR-level |
11 ; optimizations on optnone functions. | 18 ; optimizations on optnone functions. |
12 | 19 |
13 ; Function Attrs: noinline optnone | 20 ; Function Attrs: noinline optnone |
14 define i32 @_Z3fooi(i32 %x) #0 { | 21 define i32 @foo(i32 %x) #0 { |
15 entry: | 22 entry: |
16 %x.addr = alloca i32, align 4 | 23 %x.addr = alloca i32, align 4 |
17 store i32 %x, i32* %x.addr, align 4 | 24 store i32 %x, i32* %x.addr, align 4 |
18 br label %while.cond | 25 br label %while.cond |
19 | 26 |
26 | 33 |
27 while.body: ; preds = %while.cond | 34 while.body: ; preds = %while.cond |
28 br label %while.cond | 35 br label %while.cond |
29 | 36 |
30 while.end: ; preds = %while.cond | 37 while.end: ; preds = %while.cond |
31 ret i32 0 | 38 ret i32 %dec |
32 } | 39 } |
33 | 40 |
34 attributes #0 = { optnone noinline } | 41 attributes #0 = { optnone noinline } |
35 | 42 |
36 ; Nothing that runs at -O0 gets skipped. | 43 ; Nothing that runs at -O0 gets skipped (except when the Bye extension is present). |
37 ; OPT-O0-NOT: Skipping pass | 44 ; O0-NOT: Skipping pass |
45 ; CHECK-EXT-NPM-O0: Skipping pass {{.*}}Bye | |
46 ; CHECK-NOEXT-NPM-O0-NOT: Skipping pass | |
38 | 47 |
39 ; IR passes run at -O1 and higher. | 48 ; IR passes run at -O1 and higher. |
40 ; OPT-O1-DAG: Skipping pass 'Aggressive Dead Code Elimination' | 49 ; O1-DAG: Skipping pass 'Aggressive Dead Code Elimination' |
41 ; OPT-O1-DAG: Skipping pass 'Combine redundant instructions' | 50 ; O1-DAG: Skipping pass 'Combine redundant instructions' |
42 ; OPT-O1-DAG: Skipping pass 'Early CSE' | 51 ; O1-DAG: Skipping pass 'Early CSE' |
43 ; OPT-O1-DAG: Skipping pass 'Reassociate expressions' | 52 ; O1-DAG: Skipping pass 'Reassociate expressions' |
44 ; OPT-O1-DAG: Skipping pass 'Simplify the CFG' | 53 ; O1-DAG: Skipping pass 'Simplify the CFG' |
45 ; OPT-O1-DAG: Skipping pass 'Sparse Conditional Constant Propagation' | 54 ; O1-DAG: Skipping pass 'Sparse Conditional Constant Propagation' |
55 ; NPM-O1-DAG: Skipping pass: SimplifyCFGPass on foo | |
56 ; NPM-O1-DAG: Skipping pass: SROA | |
57 ; NPM-O1-DAG: Skipping pass: EarlyCSEPass | |
58 ; NPM-O1-DAG: Skipping pass: LowerExpectIntrinsicPass | |
59 ; NPM-O1-DAG: Skipping pass: PromotePass | |
60 ; NPM-O1-DAG: Skipping pass: InstCombinePass | |
46 | 61 |
47 ; Additional IR passes run at -O2 and higher. | 62 ; Additional IR passes run at -O2 and higher. |
48 ; OPT-O2O3-DAG: Skipping pass 'Global Value Numbering' | 63 ; O2O3-DAG: Skipping pass 'Global Value Numbering' |
49 ; OPT-O2O3-DAG: Skipping pass 'SLP Vectorizer' | 64 ; O2O3-DAG: Skipping pass 'SLP Vectorizer' |
65 ; NPM-O2O3-DAG: Skipping pass: GVN | |
66 ; NPM-O2O3-DAG: Skipping pass: SLPVectorizerPass | |
50 | 67 |
51 ; Additional IR passes that opt doesn't turn on by default. | 68 ; Additional IR passes that opt doesn't turn on by default. |
52 ; OPT-MORE-DAG: Skipping pass 'Dead Code Elimination' | 69 ; MORE-DAG: Skipping pass 'Dead Code Elimination' |
53 ; OPT-MORE-DAG: Skipping pass 'Dead Instruction Elimination' | 70 ; NPM-MORE-DAG: Skipping pass: DCEPass |
71 ; NPM-MORE-DAG: Skipping pass: GVNHoistPass | |
54 | 72 |
55 ; Loop IR passes that opt doesn't turn on by default. | 73 ; Loop IR passes that opt doesn't turn on by default. |
56 ; OPT-LOOP-DAG: Skipping pass 'Delete dead loops' | 74 ; LOOP-DAG: Skipping pass 'Delete dead loops' |
57 ; OPT-LOOP-DAG: Skipping pass 'Induction Variable Simplification' | 75 ; LOOP-DAG: Skipping pass 'Induction Variable Simplification' |
58 ; OPT-LOOP-DAG: Skipping pass 'Loop Invariant Code Motion' | 76 ; LOOP-DAG: Skipping pass 'Loop Invariant Code Motion' |
59 ; OPT-LOOP-DAG: Skipping pass 'Loop Strength Reduction' | 77 ; LOOP-DAG: Skipping pass 'Loop Strength Reduction' |
60 ; OPT-LOOP-DAG: Skipping pass 'Recognize loop idioms' | 78 ; LOOP-DAG: Skipping pass 'Recognize loop idioms' |
61 ; OPT-LOOP-DAG: Skipping pass 'Reroll loops' | 79 ; LOOP-DAG: Skipping pass 'Reroll loops' |
62 ; OPT-LOOP-DAG: Skipping pass 'Rotate Loops' | 80 ; LOOP-DAG: Skipping pass 'Rotate Loops' |
63 ; OPT-LOOP-DAG: Skipping pass 'Simplify instructions in loops' | 81 ; LOOP-DAG: Skipping pass 'Simplify instructions in loops' |
64 ; OPT-LOOP-DAG: Skipping pass 'Unroll loops' | 82 ; LOOP-DAG: Skipping pass 'Unroll loops' |
65 ; OPT-LOOP-DAG: Skipping pass 'Unswitch loops' | 83 ; LOOP-DAG: Skipping pass 'Unswitch loops' |
84 ; LoopPassManager should not be skipped over an optnone function | |
85 ; NPM-LOOP-NOT: Skipping pass: PassManager | |
86 ; NPM-LOOP-DAG: Skipping pass: LoopSimplifyPass on foo | |
87 ; NPM-LOOP-DAG: Skipping pass: LCSSAPass | |
88 ; NPM-LOOP-DAG: Skipping pass: IndVarSimplifyPass | |
89 ; NPM-LOOP-DAG: Skipping pass: SimpleLoopUnswitchPass | |
90 ; NPM-LOOP-DAG: Skipping pass: LoopUnrollPass | |
91 ; NPM-LOOP-DAG: Skipping pass: LoopStrengthReducePass | |
92 ; NPM-LOOP-DAG: Skipping pass: LoopDeletionPass | |
93 ; NPM-LOOP-DAG: Skipping pass: LICMPass | |
94 ; NPM-LOOP-DAG: Skipping pass: LoopIdiomRecognizePass | |
95 ; NPM-LOOP-DAG: Skipping pass: LoopInstSimplifyPass | |
96 | |
97 ; NPM-REQUIRED-DAG: Skipping pass: InstSimplifyPass | |
98 ; NPM-REQUIRED-DAG: Skipping pass InstSimplifyPass on foo due to optnone attribute | |
99 ; NPM-REQUIRED-DAG: Running pass: VerifierPass | |
100 ; NPM-REQUIRED-NOT: Skipping pass: VerifyPass | |
101 ; NPM-REQUIRED-NOT: Skipping pass VerifyPass on foo due to optnone attribute |