[llvm] SelectionDAG: Support FMINIMUMNUM and FMINIMUM in combineMinNumMaxNumImpl (PR #137449)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 13 02:54:20 PST 2025
================
@@ -11907,7 +11907,16 @@ static bool isLegalToCombineMinNumMaxNum(SelectionDAG &DAG, SDValue LHS,
if (!VT.isFloatingPoint())
return false;
- return Flags.hasNoSignedZeros() &&
+ bool hasMinMaxOpc = (TLI.isOperationLegalOrCustom(ISD::FMINNUM, VT) &&
+ TLI.isOperationLegalOrCustom(ISD::FMAXNUM, VT)) ||
+ (TLI.isOperationLegalOrCustom(ISD::FMINNUM_IEEE, VT) &&
+ TLI.isOperationLegalOrCustom(ISD::FMAXNUM_IEEE, VT)) ||
+ (TLI.isOperationLegalOrCustom(ISD::FMINIMUM, VT) &&
+ TLI.isOperationLegalOrCustom(ISD::FMAXIMUM, VT)) ||
+ (TLI.isOperationLegalOrCustom(ISD::FMINIMUMNUM, VT) &&
+ TLI.isOperationLegalOrCustom(ISD::FMAXIMUMNUM, VT));
----------------
arsenm wrote:
Can you move this to a separate helper function
https://github.com/llvm/llvm-project/pull/137449
More information about the llvm-commits
mailing list