1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
llvm-mirror/test/CodeGen/X86/scalar-min-max-fill-operand.ll
Dan Gohman 5eb4fde3c3 Recognize SSE min and max opportunities in even more cases.
And fix a bug with the behavior of min/max instructions formed from
fcmp uge comparisons.

Also, use FiniteOnlyFPMath() for this code instead of UnsafeFPMath,
as it is more specific.

llvm-svn: 82466
2009-09-21 18:03:22 +00:00

21 lines
476 B
LLVM

; RUN: llc < %s -march=x86-64 | grep min | count 1
; RUN: llc < %s -march=x86-64 | grep max | count 1
; RUN: llc < %s -march=x86-64 | grep mov | count 2
declare float @bar()
define float @foo(float %a) nounwind
{
%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) nounwind
{
%s = call float @bar()
%t = fcmp ogt float %s, %a
%u = select i1 %t, float %s, float %a
ret float %u
}