[llvm] [LLVM][SelectionDAG] Don't legalise splat constants until required. (PR #143571)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 16:37:47 PDT 2025


================
@@ -48121,8 +48121,9 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG,
   // Check if the first operand is all zeros and Cond type is vXi1.
   // If this an avx512 target we can improve the use of zero masking by
   // swapping the operands and inverting the condition.
-  if (N->getOpcode() == ISD::VSELECT && Cond.hasOneUse() &&
-      Subtarget.hasAVX512() && CondVT.getVectorElementType() == MVT::i1 &&
+  if (!DCI.isBeforeLegalize() && N->getOpcode() == ISD::VSELECT &&
----------------
topperc wrote:

This seems fine to me. This combine looks fragile.

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


More information about the llvm-commits mailing list