1 ; RUN: llc -debug < %s -o /dev/null 2>&1 | FileCheck %s
4 ; Verify that the backend correctly overrides the optimization level
5 ; of optnone functions during instruction selection.
7 define float @foo(float %x) #0 {
9 %add = fadd fast float %x, %x
10 %add1 = fadd fast float %add, %x
14 ; CHECK-NOT: Changing optimization level for Function foo
15 ; CHECK-NOT: Restoring optimization level for Function foo
17 ; Function Attrs: noinline optnone
18 define float @fooWithOptnone(float %x) #1 {
20 %add = fadd fast float %x, %x
21 %add1 = fadd fast float %add, %x
25 ; CHECK: Changing optimization level for Function fooWithOptnone
26 ; CHECK-NEXT: Before: -O2 ; After: -O0
28 ; CHECK: Restoring optimization level for Function fooWithOptnone
29 ; CHECK-NEXT: Before: -O0 ; After: -O2
31 attributes #0 = { "unsafe-fp-math"="true" }
32 attributes #1 = { noinline optnone "unsafe-fp-math"="true" }