Skip to content

Commit 57652c7

Browse files
committed
!fixup use getIndexForPredecessor.
1 parent fa0eab1 commit 57652c7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,10 +1187,9 @@ void VPIRPhi::execute(VPTransformState &State) {
11871187

11881188
void VPPhiAccessors::removeIncomingValueFor(VPBlockBase *IncomingBlock) const {
11891189
VPRecipeBase *R = const_cast<VPRecipeBase *>(getAsRecipe());
1190-
auto &Preds = R->getParent()->getPredecessors();
1191-
assert(R->getNumOperands() == Preds.size() &&
1190+
assert(R->getNumOperands() == R->getParent()->getNumPredecessors() &&
11921191
"Number of phi operands must match number of predecessors");
1193-
unsigned Position = std::distance(Preds.begin(), find(Preds, IncomingBlock));
1192+
unsigned Position = R->getParent()->getIndexForPredecessor(IncomingBlock);
11941193
R->removeOperand(Position);
11951194
}
11961195

0 commit comments

Comments
 (0)