[llvm] [LV] Keep duplicate recipes in VPExpressionRecipe (PR #156976)
Sam Tebbs via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 29 02:45:46 PDT 2025
SamTebbs33 wrote:
>
> I would like to make sure the code we end up with is flexible enough to handle future use cases w/o many changes.
>
> One case I am wondering about is how we will handle cases where an interesting operand can be a recipe or a constant/live-in. At the moment, it looks like all extends must be recipes, but they could also be constants that can be treated as extends in some case. If we want to support them, would be back to needing to check the root instruction? E.g. scaled reductions could have constant operands (#161092) and I would assume the same also holds for some of the other reduction patterns?
I agree with making the recipe flexible for future cases, but I don't see anything in this PR that would prevent it working with non-recipe extends. I think that's more of an issue with the constructor interface, so if we do end up making changes to accommodate for non-recipe extends then I don't think this PR will be making that work any harder. Pattern-matching the root instruction would certainly be a way to make the recipe very generic and flexible but it would of course introduce a lot of extra logic that we get for free right now.
https://github.com/llvm/llvm-project/pull/156976
More information about the llvm-commits
mailing list