summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/scalar-min-max-fill-operand.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-07-10 15:34:29 +0000
committerDan Gohman <gohman@apple.com>2007-07-10 15:34:29 +0000
commit02e25b70aa04d994db7a408518f8ae50a8f5582a (patch)
tree16bdd1501080833e178968c2cbaff693aad7041c /test/CodeGen/X86/scalar-min-max-fill-operand.ll
parent70fb1aefd58eb78404a2bc86b6960b7b64574082 (diff)
downloadllvm-02e25b70aa04d994db7a408518f8ae50a8f5582a.tar.gz
llvm-02e25b70aa04d994db7a408518f8ae50a8f5582a.tar.bz2
llvm-02e25b70aa04d994db7a408518f8ae50a8f5582a.tar.xz
Add a regression test for folding spill code into scalar min and max.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38492 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/scalar-min-max-fill-operand.ll')
-rw-r--r--test/CodeGen/X86/scalar-min-max-fill-operand.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/X86/scalar-min-max-fill-operand.ll b/test/CodeGen/X86/scalar-min-max-fill-operand.ll
new file mode 100644
index 0000000000..9d6fc4ff3c
--- /dev/null
+++ b/test/CodeGen/X86/scalar-min-max-fill-operand.ll
@@ -0,0 +1,20 @@
+; RUN: llvm-as < %s | llc -march=x86-64 | grep min | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86-64 | grep max | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86-64 | grep mov | wc -l | grep 2
+
+declare float @bar()
+
+define float @foo(float %a)
+{
+ %s = call float @bar()
+ %t = fcmp olt float %s, %a
+ %u = select i1 %t, float %s, float %a
+ ret float %u
+}
+define float @hem(float %a)
+{
+ %s = call float @bar()
+ %t = fcmp uge float %s, %a
+ %u = select i1 %t, float %s, float %a
+ ret float %u
+}