[llvm] SelectionDAG/expandFMINNUM_FMAXNUM: skips vector if Op is legal for elements (PR #109570)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 09:43:07 PDT 2024


================
@@ -8485,6 +8485,11 @@ SDValue TargetLowering::expandFMINNUM_FMAXNUM(SDNode *Node,
                          Node->getOperand(1), Node->getFlags());
   }
 
+  // If we have INSN fitting this operation strictly for the elements of the
+  // vector, normally, splitting it is better than compare+select.
+  if (VT.isVector() && isOperationLegal(Node->getOpcode(), VT.getScalarType()))
+    return SDValue();
----------------
arsenm wrote:

Condition codes have a separate interface for legality since they are an operand of SETCC. setCondCodeAction/getCondCodeAction. But this also depends on the select part 

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


More information about the llvm-commits mailing list