[llvm] [VPlan] Explicitly handle scalar pointer inductions. (PR #83068)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 7 07:30:40 PST 2024
================
@@ -547,12 +552,40 @@ static VPValue *createScalarIVSteps(VPlan &Plan, const InductionDescriptor &ID,
/// provide them by building scalar steps off of the canonical scalar IV and
/// update the original IV's users. This is an optional optimization to reduce
/// the needs of vector extracts.
+/// If all users of VPWidenPointerInductionRecipe only use its scalar values,
+/// replace it with a PtrAdd (IndStart, ScalarIVSteps (0, Step)).
----------------
ayalz wrote:
This sounds more like a mandatory, functional legalization of induction recipes, rather than an optional, performance optimization - referring to the `optimizeInductions()` name.
Furthermore, this conceptually introduces two types or stages of the recipes - before and after legalization - which could be represented as two distinct recipes/opcodes, or by recording an indicator whether the recipe was legalized or not. Although these seem unneeded atm.
https://github.com/llvm/llvm-project/pull/83068
More information about the llvm-commits
mailing list