[llvm] [SDAG] Drop select -> fmax/min folding in SelectionDAGBuilder (PR #93575)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 03:39:14 PDT 2024


================
@@ -3725,32 +3725,8 @@ void SelectionDAGBuilder::visitSelect(const User &I) {
     case SPF_UMAX:    Opc = ISD::UMAX; break;
     case SPF_UMIN:    Opc = ISD::UMIN; break;
     case SPF_SMAX:    Opc = ISD::SMAX; break;
-    case SPF_SMIN:    Opc = ISD::SMIN; break;
-    case SPF_FMINNUM:
-      switch (SPR.NaNBehavior) {
-      case SPNB_NA: llvm_unreachable("No NaN behavior for FP op?");
-      case SPNB_RETURNS_NAN: break;
-      case SPNB_RETURNS_OTHER: Opc = ISD::FMINNUM; break;
-      case SPNB_RETURNS_ANY:
-        if (TLI.isOperationLegalOrCustom(ISD::FMINNUM, VT) ||
-            (UseScalarMinMax &&
-             TLI.isOperationLegalOrCustom(ISD::FMINNUM, VT.getScalarType())))
-          Opc = ISD::FMINNUM;
----------------
arsenm wrote:

I just noticed we don't actually have the DAG combine to form nnan select -> minimum/maximum. Ideally we would implement that before dropping this 

https://github.com/llvm/llvm-project/pull/93575


More information about the llvm-commits mailing list