[PATCH] D113182: [VPlan] Wrap vector loop blocks in region.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 16 23:21:43 PST 2021


Ayal added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9309
 
   // Create a dummy pre-entry VPBasicBlock to start building the VPlan.
   auto Plan = std::make_unique<VPlan>();
----------------
Is this comment about dummy pre-entry obsolete?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9328
+      TopRegion->setEntry(FirstVPBBForBB);
+      Plan->setEntry(TopRegion);
+    }
----------------
nit: can alternatively fold into a 1-liner by feeding FirstVPBBForBB to the constructor of VPRegionBlock, but above is more informative.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9397
          !Plan->getEntry()->getEntryBasicBlock()->empty() &&
          "entry block must be set to a non-empty VPBasicBlock");
+  cast<VPRegionBlock>(Plan->getEntry())->setExit(VPBB);
----------------
"entry block must be set to a VPRegionBlock having a non-empty entry VPBasicBlock");


================
Comment at: llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-gep.ll:11
 ; CHECK:        VPlan 'Initial VPlan for VF={vscale x 2},UF>=1' {
+; CHECK-NEXT:   <x1> vector loop: {
 ; CHECK-NEXT:   loop.body:
----------------
(<x1> indicating that this region is not replicating; i.e., is a loop region.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113182



More information about the llvm-commits mailing list