[llvm] [LV] Keep duplicate recipes in VPExpressionRecipe (PR #156976)
Sam Tebbs via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 22 07:51:50 PDT 2025
SamTebbs33 wrote:
> > > Hmm, this only impacts printing, right? It seems like it would be simpler to just handle the case where 1 extend is shared when picking the multiply recipe, by checking if `ExpressionRecipes[1]` is an extend or widen recipe?
> > > ```
> > > auto *Mul = cast<VPWidenRecipe>(IsExtended ? ExpressionRecipes[2]
> > > : ExpressionRecipes[0]);
> > > ```
> >
> >
> > I think it's best to get the vector of recipes correct from the start so that we don't need to account for unexpectedness in other places. This could theoretically happen for future bundle types too and we don't want lots of checks when we can just get it right from the start of the bundle's existence.
>
> But it looks like handling duplicates requires quite a bit of extra complexity spread throughout; ideally there would be no need to look up the individual entries in the expression list.
>
> At the moment this just impacts printing. IMO it would be better to just have a generic print function that does not inspect the entries directly, but instead prints something like
>
> ```
> EXPRESSION vp<%x> = ExtendedReduction operands {
> bundled recipes...
> }
> ```
Sorry, it doesn't just impact printing, but anything that wants to analyse the recipes at all, such as bundled partial reductions: https://github.com/llvm/llvm-project/pull/147302/files#diff-34abe4c3cd34aa7a9664bbd204834248455635ba80b8a9ba9506d8c3e6b94d95R2878
https://github.com/llvm/llvm-project/pull/156976
More information about the llvm-commits
mailing list