Displaying 3 results from an estimated 3 matches for "m_smax".
2012 Oct 30
0
[LLVMdev] Any plan to add MIN/MAX isd node?
...de. Select and Compare is not associative
> neither.
at the IR level LLVM already has pattern matching helpers for
identifying min/max idioms, here is part of a transform using
this, from InstructionSimplify.cpp:
// Signed variants on "max(a,b)>=a -> true".
if (match(LHS, m_SMax(m_Value(A), m_Value(B))) && (A == RHS || B == RHS)) {
if (A != RHS) std::swap(A, B); // smax(A, B) pred A.
EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B".
// We analyze this as smax(A, B) pred A.
P = Pred;
}
At the codegen level, the...
2012 Oct 30
1
[LLVMdev] Any plan to add MIN/MAX isd node?
...me code. Select and Compare is not associative neither.
at the IR level LLVM already has pattern matching helpers for identifying
min/max idioms, here is part of a transform using this, from
InstructionSimplify.cpp:
// Signed variants on "max(a,b)>=a -> true".
if (match(LHS, m_SMax(m_Value(A), m_Value(B))) && (A == RHS || B == RHS))
{
if (A != RHS) std::swap(A, B); // smax(A, B) pred A.
EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B".
// We analyze this as smax(A, B) pred A.
P = Pred;
}
At the codegen level, the...
2012 Oct 30
2
[LLVMdev] Any plan to add MIN/MAX isd node?
Hi Duncan,
To use select, usually, there is a compare before select.
Presence of comparison will disable some opportunities to
optimize some code. Select and Compare is not associative
neither.
Thanks,
Yin
-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Duncan Sands
Sent: Tuesday, October 30, 2012