blob: 9e5176eddaa7ff8d3e88500183da8e949c16fd36 [file] [log] [blame]
Chandler Carruth1aff0222016-02-19 04:09:40 +00001; Test the particular pass pipelines have the expected structure. This is
2; particularly important in order to check that the implicit scheduling of the
3; legacy pass manager doesn't introduce unexpected structural changes in the
4; pass pipeline.
5;
6; RUN: opt -disable-output -disable-verify -debug-pass=Structure \
7; RUN: -O2 %s 2>&1 \
8; RUN: | FileCheck %s --check-prefix=CHECK-O2
9;
10; In the first pipeline there should just be a function pass manager, no other
11; pass managers.
12; CHECK-O2: Pass Arguments:
13; CHECK-O2-NOT: Manager
14; CHECK-O2: FunctionPass Manager
15; CHECK-O2-NOT: Manager
16;
17; CHECK-O2: Pass Arguments:
18; CHECK-O2: ModulePass Manager
19; CHECK-O2-NOT: Manager
20; First function pass pipeline just does early opts.
21; CHECK-O2: FunctionPass Manager
22; CHECK-O2-NOT: Manager
23; FIXME: It's a bit odd to do dead arg elim in the middle of early opts...
24; CHECK-O2: Dead Argument Elimination
25; CHECK-O2-NEXT: FunctionPass Manager
26; CHECK-O2-NOT: Manager
Hiroshi Inoue0ca79dc2017-07-11 06:04:59 +000027; Very carefully assert the CGSCC pass pipeline as it is fragile and unusually
Chandler Carruth1aff0222016-02-19 04:09:40 +000028; susceptible to phase ordering issues.
29; CHECK-O2: CallGraph Construction
30; CHECK-O2-NEXT: Globals Alias Analysis
31; CHECK-O2-NEXT: Call Graph SCC Pass Manager
32; CHECK-O2-NEXT: Remove unused exception handling info
33; CHECK-O2-NEXT: Function Integration/Inlining
34; CHECK-O2-NEXT: Deduce function attributes
35; Next up is the main function pass pipeline. It shouldn't be split up and
36; should contain the main loop pass pipeline as well.
37; CHECK-O2-NEXT: FunctionPass Manager
38; CHECK-O2-NOT: Manager
39; CHECK-O2: Loop Pass Manager
40; CHECK-O2-NOT: Manager
Chandler Carruth1aff0222016-02-19 04:09:40 +000041; FIXME: We shouldn't be pulling out to simplify-cfg and instcombine and
42; causing new loop pass managers.
43; CHECK-O2: Simplify the CFG
44; CHECK-O2-NOT: Manager
45; CHECK-O2: Combine redundant instructions
46; CHECK-O2-NOT: Manager
47; CHECK-O2: Loop Pass Manager
48; CHECK-O2-NOT: Manager
Chandler Carruth1aff0222016-02-19 04:09:40 +000049; FIXME: It isn't clear that we need yet another loop pass pipeline
50; and run of LICM here.
51; CHECK-O2-NOT: Manager
52; CHECK-O2: Loop Pass Manager
53; CHECK-O2-NEXT: Loop Invariant Code Motion
54; CHECK-O2-NOT: Manager
55; Next we break out of the main Function passes inside the CGSCC pipeline with
56; a barrier pass.
57; CHECK-O2: A No-Op Barrier Pass
Mehdi Amini7f7d8be2016-05-03 15:46:00 +000058; CHECK-O2-NEXT: Eliminate Available Externally
59; Inferring function attribute should be right after the CGSCC pipeline, before
60; any other optimizations/analyses.
Mehdi Amini45c7b3e2016-05-02 16:53:16 +000061; CHECK-O2-NEXT: CallGraph
62; CHECK-O2-NEXT: Deduce function attributes in RPO
Chandler Carruth1aff0222016-02-19 04:09:40 +000063; CHECK-O2-NOT: Manager
Davide Italianoc8708e52017-10-05 18:23:25 +000064; Reduce the size of the IR ASAP after the inliner.
65; CHECK-O2-NEXT: Global Variable Optimizer
66; CHECK-O2: Dead Global Elimination
Chandler Carruth1aff0222016-02-19 04:09:40 +000067; Next is the late function pass pipeline.
68; CHECK-O2: FunctionPass Manager
69; CHECK-O2-NOT: Manager
70; We rotate loops prior to vectorization.
71; CHECK-O2: Loop Pass Manager
72; CHECK-O2-NEXT: Rotate Loops
73; CHECK-O2-NOT: Manager
74; CHECK-O2: Loop Vectorization
75; CHECK-O2-NOT: Manager
76; CHECK-O2: SLP Vectorizer
77; CHECK-O2-NOT: Manager
78; After vectorization we do partial unrolling.
79; CHECK-O2: Loop Pass Manager
80; CHECK-O2-NEXT: Unroll loops
81; CHECK-O2-NOT: Manager
82; After vectorization and unrolling we try to do any cleanup of inserted code,
83; including a run of LICM. This shouldn't run in the same loop pass manager as
84; the runtime unrolling though.
85; CHECK-O2: Loop Pass Manager
86; CHECK-O2-NEXT: Loop Invariant Code Motion
Dehao Chen947dbe122016-11-09 00:58:19 +000087; CHECK-O2: FunctionPass Manager
88; CHECK-O2: Loop Pass Manager
89; CHECK-O2-NEXT: Loop Sink
Filipe Cabecinhas92dc3482017-04-26 12:02:41 +000090; CHECK-O2: Simplify the CFG
Chandler Carruth1aff0222016-02-19 04:09:40 +000091; CHECK-O2-NOT: Manager
92;
93; FIXME: There really shouldn't be another pass manager, especially one that
94; just builds the domtree. It doesn't even run the verifier.
95; CHECK-O2: Pass Arguments:
Zaara Syedac9dc7b42018-01-17 20:00:15 +000096; CHECK-O2-NEXT: FunctionPass Manager
Chandler Carruth1aff0222016-02-19 04:09:40 +000097; CHECK-O2-NEXT: Dominator Tree Construction
98
99define void @foo() {
100 ret void
101}