[llvm] [VPlan] Don't form predicated partial reductions. (PR #167506)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 00:48:49 PST 2025


fhahn wrote:

> The select can be folded into the operand of the SelectionDAG node, resulting in more optimal codegen. I'll post a patch for this shortly.
> 
> In that light, I'd rather we fix up the cost-model to cost of the select correctly (in the other PR you mentioned that it uses a scalar select cost, whereas it should choose a vector select cost).

If we can improve the lowering, great. Would have been good to make sure the lowering is reasonable earlier on, to save some time.

> After [this](https://github.com/llvm/llvm-project/pull/166138) lands, a normal reduction will be chosen if the partial reduction isn't profitable, so I don't think we should be regressing functionality by disallowing predicated partial reductions. We should let the cost model do its job instead.

Sure, but as I mentioned at https://github.com/llvm/llvm-project/pull/166136, the code seems to ignore the fact that the reduction is predicated.

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


More information about the llvm-commits mailing list