[llvm] [VPlan] Remove unused first mask op from VPBlendRecipe. (PR #87770)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 16:39:13 PDT 2024


ayalz wrote:

> VPBlendRecipe does not use the first mask operand. Removing it allows VPlan-based DCE to remove unused mask computations.
> 

Nice clean-up of a redundant operand! Adding minor nits. In general, it may be worth **selecting** which mask operand to drop, e.g., the one most expensive to compute, rather than picking the one listed first arbitrarily. Perhaps worth a TODO somewhere.

> This also fixes #87410, where unused Not VPInstructions are considered having only their first lane demanded, but some of their operands providing a vector value due to other users.
> 
> Fixes #87410

This appeases the specific reproducer provided by #87410, but does it fix the underlying issue - which is teaching mask generation operations (select, or, blend) to support only-first-lane-used cases? Worth retaining a(nother) reproducer, e.g., with the problematic mask operand being non-first (which could be worked-around by carefully selecting it for omission), and/or with multiple problematic mask operands.

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


More information about the llvm-commits mailing list