[VPlan] Use ExitBocks to check in VPlan::isExitBlock (NFC).

Exit blocks of the VPlan are now hold in ExitBlocks. Use it to check if
a block is an exit block. Otherwise we currently mis-classify the scalar
loop header also as exit block, as it is not explicitly connected to the
exit blocks.

NFC at the moment, as the helper currently is never queried with the
scalar header, but that will change in the future.
This commit is contained in:
Florian Hahn
2025-04-06 09:48:52 +01:00
parent 53e1c8b118
commit 8d71a2a905

View File

@@ -921,7 +921,7 @@ VPIRBasicBlock *VPlan::getExitBlock(BasicBlock *IRBB) const {
}
bool VPlan::isExitBlock(VPBlockBase *VPBB) {
return isa<VPIRBasicBlock>(VPBB) && VPBB->getNumSuccessors() == 0;
return is_contained(ExitBlocks, VPBB);
}
/// Generate the code inside the preheader and body of the vectorized loop.