mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-16 11:30:51 +00:00
6079f00035
Based on work by Andrea Di Biagio. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195317 91177308-0d34-0410-b5e6-96231b3b80d8
32 lines
916 B
LLVM
32 lines
916 B
LLVM
; RUN: llc -debug < %s -o /dev/null 2>&1 | FileCheck %s
|
|
|
|
; Verify that the backend correctly overrides the optimization level
|
|
; of optnone functions during instruction selection.
|
|
|
|
define float @foo(float %x) #0 {
|
|
entry:
|
|
%add = fadd fast float %x, %x
|
|
%add1 = fadd fast float %add, %x
|
|
ret float %add1
|
|
}
|
|
|
|
; CHECK-NOT: Changing optimization level for Function foo
|
|
; CHECK-NOT: Restoring optimization level for Function foo
|
|
|
|
; Function Attrs: noinline optnone
|
|
define float @fooWithOptnone(float %x) #1 {
|
|
entry:
|
|
%add = fadd fast float %x, %x
|
|
%add1 = fadd fast float %add, %x
|
|
ret float %add1
|
|
}
|
|
|
|
; CHECK: Changing optimization level for Function fooWithOptnone
|
|
; CHECK-NEXT: Before: -O2 ; After: -O0
|
|
|
|
; CHECK: Restoring optimization level for Function fooWithOptnone
|
|
; CHECK-NEXT: Before: -O0 ; After: -O2
|
|
|
|
attributes #0 = { "unsafe-fp-math"="true" }
|
|
attributes #1 = { noinline optnone "unsafe-fp-math"="true" }
|