summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/shrink-fp-const1.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-03-05 01:30:59 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-03-05 01:30:59 +0000
commit6fd599fa6916bd9438dbea7994cf2437bdf4ab8c (patch)
tree3c6d40842c57c1ed5309750a1c82a8dd107f107f /test/CodeGen/X86/shrink-fp-const1.ll
parentd19189e9905e14a4001a8ca6fc4effb6a3f88e45 (diff)
downloadllvm-6fd599fa6916bd9438dbea7994cf2437bdf4ab8c.tar.gz
llvm-6fd599fa6916bd9438dbea7994cf2437bdf4ab8c.tar.bz2
llvm-6fd599fa6916bd9438dbea7994cf2437bdf4ab8c.tar.xz
Add a target lowering hook to control whether it's worthwhile to compress fp constant.
For x86, if sse2 is available, it's not a good idea since cvtss2sd is slower than a movsd load and it prevents load folding. On x87, it's important to shrink fp constant since fldt is very expensive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47931 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/shrink-fp-const1.ll')
-rw-r--r--test/CodeGen/X86/shrink-fp-const1.ll7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CodeGen/X86/shrink-fp-const1.ll b/test/CodeGen/X86/shrink-fp-const1.ll
new file mode 100644
index 0000000000..966e69ec77
--- /dev/null
+++ b/test/CodeGen/X86/shrink-fp-const1.ll
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2 | not grep cvtss2sd
+; PR1264
+
+define double @foo(double %x) {
+ %y = mul double %x, 5.000000e-01
+ ret double %y
+}