Teach machine cse to commute instructions.
[oota-llvm.git] / test / CodeGen / X86 / inline-asm-fpstack4.ll
1 ; RUN: llc < %s -march=x86 | FileCheck %s
2 ; PR4484
3
4 ; ceil leaves a value on the stack that is needed after the asm.
5 ; CHECK: ceil
6 ; CHECK-NOT: fstp
7 ; Load %a from stack after ceil
8 ; CHECK: fldt
9 ; CHECK-NOT: fxch
10 ; CHECK: fistpl
11 ; CHECK-NOT: fstp
12 ; Set up call to test.
13 ; CHECK: fstpt
14 ; CHECK: test
15 define void @test2(x86_fp80 %a) {
16 entry:
17         %0 = call x86_fp80 @ceil()
18         call void asm sideeffect "fistpl $0", "{st},~{st}"(x86_fp80 %a)
19         call void @test(x86_fp80 %0)
20         ret void
21 }
22
23 declare x86_fp80 @ceil()
24 declare void @test(x86_fp80)