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