[PATCH] D48818: [VPlan] Introduce simplifyPlainCFG step in H-CFG builder.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 13 07:01:53 PDT 2018


fhahn added inline comments.


================
Comment at: lib/Transforms/Vectorize/VPlan.cpp:609
+  // 1. Add NewBlock to VPLoopInfo.
+  if (VPLoop *Loop = VPLInfo->getLoopFor(Block)) {
+    Loop->addBasicBlockToLoop(NewBlock, *VPLInfo);
----------------
nit: no braces here


================
Comment at: lib/Transforms/Vectorize/VPlan.h:524
+    assert(PredIt != Predecessors.end() && "Predecessor not found!");
+    Predecessors[PredIt - Predecessors.begin()] = New;
+  }
----------------
You should be able to use `*PredIt = New;` here


================
Comment at: lib/Transforms/Vectorize/VPlan.h:1472
+
+  /// Split \p Block by turning Block->Successors into Block->NewSuccessor->
+  /// Successors and updates VPLoopInfo, DomTree and PostDomTree accordingly.
----------------
nit: maybe make it clear that the block is split at the bottom (no instructions are moved in the split block)


================
Comment at: lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp:328
 
+// Split the pre-header VPBasicBlocks of \p VPLp and all it nested VPLoops. A
+// pre-header is split if it meets one of the following conditions:
----------------
nit: `Split the pre-header VPBasicBlocks of \p VPLp and all it nested VPLoops, if it meets one of the following conditions:` would be slightly more compact.


================
Comment at: lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp:353
+
+// Split the exit VPBasicBlocks of \p VPLp and all it nested VPLoops. An
+// exit is split if it meets one of the following conditions:
----------------
nit: `Split the exit VPBasicBlocks of \p VPLp and all it nested VPLoops, if it meets one of the following conditions:` is slightly more compact.


https://reviews.llvm.org/D48818





More information about the llvm-commits mailing list