Skip to content

Commit 8f83ad8

Browse files
committed
!fixup address latest comments, thanks!
1 parent bc7f445 commit 8f83ad8

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ VPlan::~VPlan() {
823823

824824
for (auto *VPB : CreatedBlocks) {
825825
if (auto *VPBB = dyn_cast<VPBasicBlock>(VPB)) {
826-
// Replace all operands of recipes and all VPValues define in VPBB with
826+
// Replace all operands of recipes and all VPValues defined in VPBB with
827827
// DummyValue so the block can be deleted.
828828
for (VPRecipeBase &R : *VPBB) {
829829
for (auto *Def : R.definedValues())
@@ -960,6 +960,7 @@ static void replaceVPBBWithIRVPBB(VPBasicBlock *VPBB, BasicBlock *IRBB) {
960960
}
961961

962962
VPBlockUtils::reassociateBlocks(VPBB, IRVPBB);
963+
// VPBB is now dead and will be cleaned up when the plan gets destroyed.
963964
}
964965

965966
/// Generate the code inside the preheader and body of the vectorized loop.

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4041,9 +4041,9 @@ class VPlan {
40414041
VPIRBasicBlock *createEmptyVPIRBasicBlock(BasicBlock *IRBB);
40424042

40434043
/// Create a VPIRBasicBlock from \p IRBB containing VPIRInstructions for all
4044-
/// instructions in \p IRBB, except its terminator which is managed in VPlan.
4045-
/// The returned block is owned by the VPlan and deleted once the VPlan is
4046-
/// destroyed.
4044+
/// instructions in \p IRBB, except its terminator which is managed by the
4045+
/// successors of the block in VPlan. The returned block is owned by the VPlan
4046+
/// and deleted once the VPlan is destroyed.
40474047
VPIRBasicBlock *createVPIRBasicBlock(BasicBlock *IRBB);
40484048
};
40494049

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ static bool mergeBlocksIntoPredecessors(VPlan &Plan) {
398398
VPBlockUtils::disconnectBlocks(VPBB, Succ);
399399
VPBlockUtils::connectBlocks(PredVPBB, Succ);
400400
}
401+
// VPBB is now dead and will be cleaned up when the plan gets destroyed.
401402
}
402403
return !WorkList.empty();
403404
}

llvm/unittests/Transforms/Vectorize/VPlanTest.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,9 @@ TEST_F(VPBasicBlockTest, TraversingIteratorTest) {
472472
VPBasicBlock *R1BB3 = Plan.createVPBasicBlock("R1BB3");
473473
VPRegionBlock *R1 = Plan.createVPRegionBlock(R1BB1, R1BB3, "R1");
474474

475-
VPBasicBlock *R2BB1 = Plan.createVPBasicBlock(""
476-
"R2BB1");
477-
VPBasicBlock *R2BB2 = Plan.createVPBasicBlock(""
478-
"R2BB2");
479-
VPBasicBlock *R2BB3 = Plan.createVPBasicBlock(""
480-
"R2BB3");
475+
VPBasicBlock *R2BB1 = Plan.createVPBasicBlock("R2BB1");
476+
VPBasicBlock *R2BB2 = Plan.createVPBasicBlock("R2BB2");
477+
VPBasicBlock *R2BB3 = Plan.createVPBasicBlock("R2BB3");
481478
VPRegionBlock *R2 = Plan.createVPRegionBlock(R2BB1, R2BB3, "R2");
482479
R2BB2->setParent(R2);
483480
VPBlockUtils::connectBlocks(R2BB1, R2BB2);

0 commit comments

Comments
 (0)