[Mlir-commits] [mlir] [mlir][vector] Refine select uses on uniform reduction paths (PR #235640)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Oct 26 03:51:19 PDT 2026
meinie0826 wrote:
> Hi @meinie0826, before diving into the review, I have a couple of questions.
>
> The PR summary is quite detailed, but I'm having trouble understanding the motivation behind this change. Could you briefly explain why this is useful?
>
> Also, did you use AI to help write the summary or the code? Its length and level of detail are somewhat unusual :D
Hi @FedericoBruzzone, thanks for asking! The motivation is to eliminate redundant vector selects when control flow already tells us that the mask is uniform. For example, inside the true branch of vector.reduction <and> on an i1 mask, arith.select using that same mask can be replaced with its true operand. Similarly, the false branch of an <or> reduction lets us use the false operand. This removes unnecessary selects and can enable further simplification.
https://github.com/llvm/llvm-project/pull/235640
More information about the Mlir-commits
mailing list