[llvm] [VPlan] Remove unused first mask op from VPBlendRecipe. (PR #87770)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 9 03:00:51 PDT 2024
https://github.com/fhahn commented:
Addressed comments, thanks!
> > 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.
>
Updated and added TODO where VPlendRecipes are created, thanks!
> > 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.
Ah yes, some cases remain. Will follow up.
https://github.com/llvm/llvm-project/pull/87770
More information about the llvm-commits
mailing list