[llvm] [VPlan] Simplify branch on False in VPlan transform (NFC). (PR #140409)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 30 13:44:56 PDT 2025


================
@@ -1185,6 +1185,16 @@ void VPIRPhi::execute(VPTransformState &State) {
   State.Builder.SetInsertPoint(Phi->getParent(), std::next(Phi->getIterator()));
 }
 
+void VPPhiAccessors::removeIncomingValueFor(VPBlockBase *IncomingBlock) const {
+  VPRecipeBase *R = const_cast<VPRecipeBase *>(getAsRecipe());
+  auto &Preds = R->getParent()->getPredecessors();
+  assert(R->getNumOperands() == Preds.size() &&
+         "Number of phi operands must match number of predecessors");
+  unsigned Position = std::distance(Preds.begin(), find(Preds, IncomingBlock));
----------------
ayalz wrote:

Should this part be `getIndexFor(IncomingBlock)`? Which is an API of a basic block rather than a phi recipe.

https://github.com/llvm/llvm-project/pull/140409


More information about the llvm-commits mailing list