[llvm] [DAGCombiner] Fold select into partial.reduce.add operands. (PR #167857)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 16 19:25:38 PST 2025
================
@@ -13068,6 +13083,20 @@ SDValue DAGCombiner::foldPartialReduceMLAMulOp(SDNode *N) {
SDValue LHSExtOp = LHS->getOperand(0);
EVT LHSExtOpVT = LHSExtOp.getValueType();
+ // Sets Op = select(P, Op, splat(0)) if P is nonzero, or Op otherwise.
+ // Set ToFreezeOp = freeze(ToFreezeOp) if the value may be poison, to
+ // keep the same semantics.
+ auto ApplyPredicate = [&](SDValue P, SDValue &Op, SDValue &ToFreezeOp) {
+ if (!P)
+ return;
----------------
lukel97 wrote:
Pred is already implicitly captured, I think you can get rid of the P argument
https://github.com/llvm/llvm-project/pull/167857
More information about the llvm-commits
mailing list