Skip to content

Commit 4baad77

Browse files
committed
[VPlan] Address nits in review
1 parent 69231ea commit 4baad77

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,17 @@ bool VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
131131
}
132132

133133
static bool sinkScalarOperands(VPlan &Plan) {
134+
auto Iter = vp_depth_first_deep(Plan.getEntry());
134135
bool ScalarVFOnly = Plan.hasScalarVFOnly();
135136
bool Changed = false;
136137
// First, collect the operands of all recipes in replicate blocks as seeds for
137138
// sinking.
138139
SetVector<std::pair<VPBasicBlock *, VPSingleDefRecipe *>> WorkList;
139-
for (VPRegionBlock *VPR : VPBlockUtils::blocksOnly<VPRegionBlock>(
140-
vp_depth_first_deep(Plan.getEntry()))) {
140+
for (VPRegionBlock *VPR : VPBlockUtils::blocksOnly<VPRegionBlock>(Iter)) {
141141
VPBasicBlock *EntryVPBB = VPR->getEntryBasicBlock();
142142
if (!VPR->isReplicator() || EntryVPBB->getSuccessors().size() != 2)
143143
continue;
144-
VPBasicBlock *VPBB =
145-
dyn_cast<VPBasicBlock>(EntryVPBB->getSuccessors().front());
144+
VPBasicBlock *VPBB = cast<VPBasicBlock>(EntryVPBB->getSuccessors().front());
146145
if (!VPBB || VPBB->getSingleSuccessor() != VPR->getExitingBasicBlock())
147146
continue;
148147
for (auto &Recipe : *VPBB) {

0 commit comments

Comments
 (0)