1 ; RUN: llc -O1 -debug %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=LLC-Ox
2 ; RUN: llc -O2 -debug %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=LLC-Ox
3 ; RUN: llc -O3 -debug %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=LLC-Ox
4 ; RUN: llc -misched-postra -debug %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=LLC-MORE
5 ; RUN: llc -O1 -debug-only=isel %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=FAST
6 ; RUN: llc -O1 -debug-only=isel -fast-isel=false %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=NOFAST
8 ; REQUIRES: asserts, default_triple
10 ; This test verifies that we don't run Machine Function optimizations
11 ; on optnone functions, and that we can turn off FastISel.
13 ; Function Attrs: noinline optnone
14 define i32 @_Z3fooi(i32 %x) #0 {
16 %x.addr = alloca i32, align 4
17 store i32 %x, i32* %x.addr, align 4
20 while.cond: ; preds = %while.body, %entry
21 %0 = load i32, i32* %x.addr, align 4
22 %dec = add nsw i32 %0, -1
23 store i32 %dec, i32* %x.addr, align 4
24 %tobool = icmp ne i32 %0, 0
25 br i1 %tobool, label %while.body, label %while.end
27 while.body: ; preds = %while.cond
30 while.end: ; preds = %while.cond
34 attributes #0 = { optnone noinline }
36 ; Nothing that runs at -O0 gets skipped.
37 ; LLC-O0-NOT: Skipping pass
39 ; Machine Function passes run at -O1 and higher.
40 ; LLC-Ox-DAG: Skipping pass 'Branch Probability Basic Block Placement'
41 ; LLC-Ox-DAG: Skipping pass 'CodeGen Prepare'
42 ; LLC-Ox-DAG: Skipping pass 'Control Flow Optimizer'
43 ; LLC-Ox-DAG: Skipping pass 'Machine code sinking'
44 ; LLC-Ox-DAG: Skipping pass 'Machine Common Subexpression Elimination'
45 ; LLC-Ox-DAG: Skipping pass 'Shrink Wrapping analysis'
46 ; LLC-Ox-DAG: Skipping pass 'Machine Copy Propagation Pass'
47 ; LLC-Ox-DAG: Skipping pass 'Machine Instruction Scheduler'
48 ; LLC-Ox-DAG: Skipping pass 'Machine Loop Invariant Code Motion'
49 ; LLC-Ox-DAG: Skipping pass 'Optimize machine instruction PHIs'
50 ; LLC-Ox-DAG: Skipping pass 'Peephole Optimizations'
51 ; LLC-Ox-DAG: Skipping pass 'Post{{.*}}RA{{.*}}{{[Ss]}}cheduler'
52 ; LLC-Ox-DAG: Skipping pass 'Remove dead machine instructions'
53 ; LLC-Ox-DAG: Skipping pass 'Tail Duplication'
55 ; Alternate post-RA scheduler.
56 ; LLC-MORE: Skipping pass 'PostRA Machine Instruction Scheduler'
58 ; Selectively disable FastISel for optnone functions.
59 ; FAST: FastISel is enabled
60 ; NOFAST: FastISel is disabled