[PATCH] D115793: [VPlan] Create header & latch blocks for plan skeleton up front (NFC).

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 21 13:26:29 PST 2021


Ayal accepted this revision.
Ayal added a comment.
This revision is now accepted and ready to land.

Looks good to me!
Would be good to add some (TODO?) comment explaining why Latch is merged with its predecessor late.



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9124
+  (void)Folded;
+  VPBB = PrevVPBB;
+
----------------
fhahn wrote:
> Ayal wrote:
> > Perhaps tryToMergeBlockIntoPredecessor() should return the predecessor it merged into if successful (null otherwise), to support VPBB = VPBlockUtils::tryToMergeBlockIntoPredecessor(VPBB);
> > 
> > But probably better to avoid updating VPBB at all (tryToMerge already takes care of updating Exit if needed) - see below.
> > But probably better to avoid updating VPBB at all (tryToMerge already takes care of updating Exit if needed) - see below.
> 
> Sounds good! The only real later use was `adjustRecipesForReductions`.  It expects the latch block, so `LatchVPBB` can be passed instead. This required a fix to ensure that `VPWidenCanonicalIVRecipe` is always inserted in the header: 1a54889f48fa
Good to have spotted and fixed always inserting VPWidenCanonicalIVRecipe in the header! Posted a couple of post-commit comments there. This fix led to the couple of test changes below reordering ule compares?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115793



More information about the llvm-commits mailing list