[PATCH] D154640: [LV] Move all VPlan transforms after initial VPlan construction.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 07:43:25 PDT 2023


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9078
   adjustRecipesForReductions(cast<VPBasicBlock>(TopRegion->getExiting()), Plan,
                              RecipeBuilder, Range.Start);
 
----------------
Ayal wrote:
> (Possible follow-up:) Could `adjustRecipesForReductions()` be refactored to walk the def-use chains of recipes rather than rely on retrieving recipes of recorded `Instructions`, so it could (continue to) be next to `adjust[RecipesFor]FixedOrderRecurrences()`? The latter part of adjustRecipesForReductions() which introduces selects in case of fold-tail is already Value2VPValue-free.
> 
> The call to `RecipeBuilder.fixHeaderPhis()` should indeed be part of the initial VPlan construction as it completes the def-use relations of reduction and FOR header phi's, using Value2VPValue. Still, it too could walk header phi recipes instead of relying on the recorded `PhisToFix`?
Updated adjustRecipesForReductions to walk VPlan def-use chains when adjusting in loop reductions in D155845


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154640/new/

https://reviews.llvm.org/D154640



More information about the llvm-commits mailing list