xref: /minix3/external/bsd/llvm/dist/llvm/test/CodeGen/X86/reghinting.ll (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc; RUN: llc < %s -mcpu=generic -mtriple=x86_64-apple-macosx | FileCheck %s
2*f4a2713aSLionel Sambuc; PR10221
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc;; The registers %x and %y must both spill across the finit call.
5*f4a2713aSLionel Sambuc;; Check that they are spilled early enough that not copies are needed for the
6*f4a2713aSLionel Sambuc;; fadd and fpext.
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambuc; CHECK: pr10221
9*f4a2713aSLionel Sambuc; CHECK-NOT: movaps
10*f4a2713aSLionel Sambuc; CHECK:      movss
11*f4a2713aSLionel Sambuc; CHECK-NEXT: movss
12*f4a2713aSLionel Sambuc; CHECK-NEXT: addss
13*f4a2713aSLionel Sambuc; CHECK-NEXT: cvtss2sd
14*f4a2713aSLionel Sambuc; CHECK-NEXT: finit
15*f4a2713aSLionel Sambuc
16*f4a2713aSLionel Sambucdefine i32 @pr10221(float %x, float %y, i8** nocapture %_retval) nounwind uwtable ssp {
17*f4a2713aSLionel Sambucentry:
18*f4a2713aSLionel Sambuc  %add = fadd float %x, %y
19*f4a2713aSLionel Sambuc  %conv = fpext float %add to double
20*f4a2713aSLionel Sambuc  %call = tail call i32 @finit(double %conv) nounwind
21*f4a2713aSLionel Sambuc  %tobool = icmp eq i32 %call, 0
22*f4a2713aSLionel Sambuc  br i1 %tobool, label %return, label %if.end
23*f4a2713aSLionel Sambuc
24*f4a2713aSLionel Sambucif.end:                                           ; preds = %entry
25*f4a2713aSLionel Sambuc  tail call void @foo(float %x, float %y) nounwind
26*f4a2713aSLionel Sambuc  br label %return
27*f4a2713aSLionel Sambuc
28*f4a2713aSLionel Sambucreturn:                                           ; preds = %entry, %if.end
29*f4a2713aSLionel Sambuc  %retval.0 = phi i32 [ 0, %if.end ], [ 5, %entry ]
30*f4a2713aSLionel Sambuc  ret i32 %retval.0
31*f4a2713aSLionel Sambuc}
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambucdeclare i32 @finit(double)
34*f4a2713aSLionel Sambuc
35*f4a2713aSLionel Sambucdeclare void @foo(float, float)
36