[llvm-commits] [llvm] r38492 - /llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll

Dan Gohman djg at cray.com
Tue Jul 10 08:34:29 PDT 2007


Author: djg
Date: Tue Jul 10 10:34:29 2007
New Revision: 38492

URL: http://llvm.org/viewvc/llvm-project?rev=38492&view=rev
Log:
Add a regression test for folding spill code into scalar min and max.

Added:
    llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll

Added: llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll?rev=38492&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll (added)
+++ llvm/trunk/test/CodeGen/X86/scalar-min-max-fill-operand.ll Tue Jul 10 10:34:29 2007
@@ -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
+}





More information about the llvm-commits mailing list