diff options
author | Chris Lattner <sabre@nondot.org> | 2008-02-27 05:57:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-02-27 05:57:41 +0000 |
commit | b09916bdfbd7ffdc8fbadb5ee0c0b50567823f46 (patch) | |
tree | 82b26d049ca1b0873011990f2b19c852a663bf65 /test/CodeGen/X86/x86-64-dead-stack-adjust.ll | |
parent | 22eedf4eec990f90988af819c034787019440cbd (diff) | |
download | external_llvm-b09916bdfbd7ffdc8fbadb5ee0c0b50567823f46.zip external_llvm-b09916bdfbd7ffdc8fbadb5ee0c0b50567823f46.tar.gz external_llvm-b09916bdfbd7ffdc8fbadb5ee0c0b50567823f46.tar.bz2 |
Make X86TargetLowering::LowerSINT_TO_FP return without creating a dead
stack slot and store if the SINT_TO_FP is actually legal. This allows
us to compile:
double a(double b) {return (unsigned)b;}
to:
_a:
cvttsd2siq %xmm0, %rax
movl %eax, %eax
cvtsi2sdq %rax, %xmm0
ret
instead of:
_a:
subq $8, %rsp
cvttsd2siq %xmm0, %rax
movl %eax, %eax
cvtsi2sdq %rax, %xmm0
addq $8, %rsp
ret
crazy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/x86-64-dead-stack-adjust.ll')
-rw-r--r-- | test/CodeGen/X86/x86-64-dead-stack-adjust.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGen/X86/x86-64-dead-stack-adjust.ll b/test/CodeGen/X86/x86-64-dead-stack-adjust.ll new file mode 100644 index 0000000..9f95e41 --- /dev/null +++ b/test/CodeGen/X86/x86-64-dead-stack-adjust.ll @@ -0,0 +1,10 @@ +; RUN: llvm-as < %s | not grep rsp +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" +target triple = "x86_64-apple-darwin8" + +define double @a(double %b) nounwind { +entry: + %tmp12 = fptoui double %b to i32 ; <i32> [#uses=1] + %tmp123 = uitofp i32 %tmp12 to double ; <double> [#uses=1] + ret double %tmp123 +} |