diff options
author | Evan Cheng <evan.cheng@apple.com> | 2012-09-25 05:32:34 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2012-09-25 05:32:34 +0000 |
commit | b1cacc74232164a9d80ee65d20e0095b25eb74d8 (patch) | |
tree | 04ab6b974a1f9a026aa1787c3806a0141551ce29 /test/CodeGen/X86/tailcall-64.ll | |
parent | d0a553e5ecd8726de88af26da7d258e15f626e37 (diff) | |
download | llvm-b1cacc74232164a9d80ee65d20e0095b25eb74d8.tar.gz llvm-b1cacc74232164a9d80ee65d20e0095b25eb74d8.tar.bz2 llvm-b1cacc74232164a9d80ee65d20e0095b25eb74d8.tar.xz |
Fix an illegal tailcall opt where the callee returns a double via xmm while caller returns x86_fp80 via st0. rdar://12229511
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164588 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/tailcall-64.ll')
-rw-r--r-- | test/CodeGen/X86/tailcall-64.ll | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/test/CodeGen/X86/tailcall-64.ll b/test/CodeGen/X86/tailcall-64.ll index adc8620060..ecc253ba58 100644 --- a/test/CodeGen/X86/tailcall-64.ll +++ b/test/CodeGen/X86/tailcall-64.ll @@ -1,6 +1,4 @@ -; RUN: llc < %s | FileCheck %s -target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" -target triple = "x86_64-apple-darwin11.4.0" +; RUN: llc -mtriple=x86_64-apple-macosx -mcpu=core2 < %s | FileCheck %s declare i64 @testi() @@ -132,3 +130,28 @@ entry: %call = tail call i32 (i8*, ...)* %0(i8* null, i32 0, i32 0, i32 0, i32 0, i32 0) nounwind ret i32 %call } + +define x86_fp80 @fp80_call(x86_fp80 %x) nounwind { +entry: +; CHECK: fp80_call: +; CHECK: jmp _fp80_callee + %call = tail call x86_fp80 @fp80_callee(x86_fp80 %x) nounwind + ret x86_fp80 %call +} + +declare x86_fp80 @fp80_callee(x86_fp80) + +; rdar://12229511 +define x86_fp80 @trunc_fp80(x86_fp80 %x) nounwind { +entry: +; CHECK: trunc_fp80 +; CHECK: callq _trunc +; CHECK-NOT: jmp _trunc +; CHECK: ret + %conv = fptrunc x86_fp80 %x to double + %call = tail call double @trunc(double %conv) nounwind readnone + %conv1 = fpext double %call to x86_fp80 + ret x86_fp80 %conv1 +} + +declare double @trunc(double) nounwind readnone |