source: icGREP/icgrep-devel/llvm-3.5.0.src/test/CodeGen/X86/fastmath-optnone.ll @ 4574

Last change on this file since 4574 was 4574, checked in by cameron, 4 years ago

Updating to LLVM 3.6

File size: 766 bytes
Line 
1; RUN: llc < %s -mcpu=corei7 -march=x86-64 -mattr=+sse2 | FileCheck %s
2; Verify that floating-point operations inside 'optnone' functions
3; are not optimized even if unsafe-fp-math is set.
4
5define float @foo(float %x) #0 {
6entry:
7  %add = fadd fast float %x, %x
8  %add1 = fadd fast float %add, %x
9  ret float %add1
10}
11
12; CHECK-LABEL: @foo
13; CHECK-NOT: add
14; CHECK: mul
15; CHECK-NOT: add
16; CHECK: ret
17
18define float @fooWithOptnone(float %x) #1 {
19entry:
20  %add = fadd fast float %x, %x
21  %add1 = fadd fast float %add, %x
22  ret float %add1
23}
24
25; CHECK-LABEL: @fooWithOptnone
26; CHECK-NOT: mul
27; CHECK: add
28; CHECK-NOT: mul
29; CHECK: add
30; CHECK-NOT: mul
31; CHECK: ret
32
33
34attributes #0 = { "unsafe-fp-math"="true" }
35attributes #1 = { noinline optnone "unsafe-fp-math"="true" }
Note: See TracBrowser for help on using the repository browser.