Skip to content

Commit

Permalink
[LV] Remove some redundant casts (NFC).
Browse files Browse the repository at this point in the history
  • Loading branch information
fhahn committed Feb 24, 2025
1 parent df14dbd commit baa77e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/Transforms/Vectorize/VPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit baa77e3

Please sign in to comment.