[llvm] [VPlan] Explicitly handle scalar pointer inductions. (PR #83068)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 13:51:04 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)).
----------------
fhahn wrote:

Yes this is now required (similar to adjusting reductions). Should we move it to a separate transform or possibly clarify the name of the function?

https://github.com/llvm/llvm-project/pull/83068


More information about the llvm-commits mailing list