Skip to content

Commit 7aedeba

Browse files
committed
[VPlan] Populate ExitBlocks when cloning VPlan (NFC).
Update VPlan::duplicate to add cloned exit blocks to ExitBlocks. Currently there are no uses of the exit blocks after cloning so this is NFC at the moment.
1 parent 78f624a commit 7aedeba

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,13 @@ VPlan *VPlan::duplicate() {
12161216
NewPlan->CreatedBlocks.push_back(this->CreatedBlocks[I]);
12171217
CreatedBlocks.truncate(NumBlocksBeforeCloning);
12181218

1219+
// Update ExitBlocks of the new plan.
1220+
for (VPBlockBase *VPB : NewPlan->CreatedBlocks) {
1221+
if (VPB->getNumSuccessors() == 0 && isa<VPIRBasicBlock>(VPB) &&
1222+
VPB != NewScalarHeader)
1223+
NewPlan->ExitBlocks.push_back(cast<VPIRBasicBlock>(VPB));
1224+
}
1225+
12191226
return NewPlan;
12201227
}
12211228

0 commit comments

Comments
 (0)