blob: 2129fc9b8815ee9f2f901f25663e79880c0c745b [file] [log] [blame]
Paul Robinson5fa58a52014-03-31 17:43:35 +00001; 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
Paul Robinsonae5d4bf2015-11-30 21:56:16 +00005; 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
Paul Robinson5fa58a52014-03-31 17:43:35 +00007
Mehdi Amini793a2b12015-09-16 05:34:32 +00008; REQUIRES: asserts, default_triple
Paul Robinson5fa58a52014-03-31 17:43:35 +00009
10; This test verifies that we don't run Machine Function optimizations
Paul Robinsonae5d4bf2015-11-30 21:56:16 +000011; on optnone functions, and that we can turn off FastISel.
Paul Robinson5fa58a52014-03-31 17:43:35 +000012
13; Function Attrs: noinline optnone
14define i32 @_Z3fooi(i32 %x) #0 {
15entry:
16 %x.addr = alloca i32, align 4
17 store i32 %x, i32* %x.addr, align 4
18 br label %while.cond
19
20while.cond: ; preds = %while.body, %entry
David Blaikie7c9c6ed2015-02-27 21:17:42 +000021 %0 = load i32, i32* %x.addr, align 4
Paul Robinson5fa58a52014-03-31 17:43:35 +000022 %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
26
27while.body: ; preds = %while.cond
28 br label %while.cond
29
30while.end: ; preds = %while.cond
31 ret i32 0
32}
33
34attributes #0 = { optnone noinline }
35
36; Nothing that runs at -O0 gets skipped.
37; LLC-O0-NOT: Skipping pass
38
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'
Matthias Braun00e2e0c2017-05-16 20:53:27 +000045; LLC-Ox-DAG: Skipping pass 'Shrink Wrapping analysis'
Paul Robinson5fa58a52014-03-31 17:43:35 +000046; LLC-Ox-DAG: Skipping pass 'Machine Copy Propagation Pass'
Chad Rosier1355bf72016-01-20 22:38:25 +000047; LLC-Ox-DAG: Skipping pass 'Machine Instruction Scheduler'
Paul Robinson5fa58a52014-03-31 17:43:35 +000048; LLC-Ox-DAG: Skipping pass 'Machine Loop Invariant Code Motion'
Paul Robinson5fa58a52014-03-31 17:43:35 +000049; LLC-Ox-DAG: Skipping pass 'Optimize machine instruction PHIs'
50; LLC-Ox-DAG: Skipping pass 'Peephole Optimizations'
Chad Rosier9f4b17d2014-09-13 03:23:23 +000051; LLC-Ox-DAG: Skipping pass 'Post{{.*}}RA{{.*}}{{[Ss]}}cheduler'
Paul Robinson5fa58a52014-03-31 17:43:35 +000052; LLC-Ox-DAG: Skipping pass 'Remove dead machine instructions'
53; LLC-Ox-DAG: Skipping pass 'Tail Duplication'
54
55; Alternate post-RA scheduler.
56; LLC-MORE: Skipping pass 'PostRA Machine Instruction Scheduler'
Paul Robinsonae5d4bf2015-11-30 21:56:16 +000057
58; Selectively disable FastISel for optnone functions.
59; FAST: FastISel is enabled
60; NOFAST: FastISel is disabled