[llvm] [LV] Add initial support for vectorizing literal struct return values (PR #109833)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 15 10:18:19 PDT 2024
MacDue wrote:
I've looked at the multiple result `VPWidenCallRecipe` approach in https://github.com/llvm/llvm-project/pull/112402 (prototype patch). I've got it working for `VPWidenCallRecipe` (no replication yet), but I'm unsure of the approach. The initial problems are:
- `VPRecipeWithIRFlags` currently forces the recipe to inherit from `VPSingleDefRecipe`
- I removed this restriction in https://github.com/llvm/llvm-project/pull/112402/commits/dbedb67e957574100b7a368526a064299cbf14ed (a moderately sized refactor)
- Note: Struct return calls can have FMFs since https://github.com/llvm/llvm-project/pull/110506
- `VPRecipeBuilder` assumes a 1-to-1 mapping from `Instruction` to `VPValue`
- Currently worked around by special-casing `extractvalue`: https://github.com/llvm/llvm-project/blob/2aaf07c4fb69d21ded3109f5cb408196064b5f0e/llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h#L185-L194
- `extractvalue` is also special-cased in `tryToBuildVPlanWithVPRecipes()` (as it does not directly produce a recipe)
There may be a few issues to solve around replication too (but I've not got there yet).
Just posting my initial thoughts in case I've missed something as I'm still fairly new to looking at `VPlan` :slightly_smiling_face:
https://github.com/llvm/llvm-project/pull/109833
More information about the llvm-commits
mailing list