If one operand to FMINNUM and FMAXNUM is NaN, then the other operand is returned. This makes NaN a neutral element for these operations, which should improve the lowerings from D87391.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM - I'll update the other patch after this lands.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
14064 | Might as well handle the other pair too (possibly in a follow-up patch)? InstSimplify has: // If one argument is NaN, return other or NaN appropriately. bool PropagateNaN = IID == Intrinsic::minimum || IID == Intrinsic::maximum; if (match(Op0, m_NaN())) return PropagateNaN ? Op0 : Op1; if (match(Op1, m_NaN())) return PropagateNaN ? Op1 : Op0; |
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
14064 | Good point! I went ahead and directly included it, together with some ARM tests (which conveniently supports both variants). |
Might as well handle the other pair too (possibly in a follow-up patch)? InstSimplify has: