[LV] Remove some redundant casts (NFC).

This commit is contained in:
Florian Hahn 2025-02-24 21:45:49 +00:00
parent df14dbd875
commit baa77e30f0
No known key found for this signature in database
GPG Key ID: 9E54DEA47A8F4434
2 changed files with 4 additions and 5 deletions

View File

@ -577,8 +577,7 @@ template <typename T> static T *getEnclosingLoopRegionForRegion(T *P) {
P = P->getParent();
// Multiple loop regions can be nested, but replicate regions can only be
// nested inside a loop region or must be outside any other region.
assert((!P || !cast<VPRegionBlock>(P)->isReplicator()) &&
"unexpected nested replicate regions");
assert((!P || !P->isReplicator()) && "unexpected nested replicate regions");
}
return P;
}

View File

@ -393,7 +393,7 @@ static bool mergeBlocksIntoPredecessors(VPlan &Plan) {
for (VPRecipeBase &R : make_early_inc_range(*VPBB))
R.moveBefore(*PredVPBB, PredVPBB->end());
VPBlockUtils::disconnectBlocks(PredVPBB, VPBB);
auto *ParentRegion = cast_or_null<VPRegionBlock>(VPBB->getParent());
auto *ParentRegion = VPBB->getParent();
if (ParentRegion && ParentRegion->getExiting() == VPBB)
ParentRegion->setExiting(PredVPBB);
for (auto *Succ : to_vector(VPBB->successors())) {
@ -1240,9 +1240,9 @@ bool VPlanTransforms::adjustFixedOrderRecurrences(VPlan &Plan,
LoopBuilder.setInsertPoint(InsertBlock,
std::next(Previous->getIterator()));
auto *RecurSplice = cast<VPInstruction>(
auto *RecurSplice =
LoopBuilder.createNaryOp(VPInstruction::FirstOrderRecurrenceSplice,
{FOR, FOR->getBackedgeValue()}));
{FOR, FOR->getBackedgeValue()});
FOR->replaceAllUsesWith(RecurSplice);
// Set the first operand of RecurSplice to FOR again, after replacing