@@ -848,12 +848,13 @@ void VPInstruction::print(raw_ostream &O, const Twine &Indent,
848848void VPIRInstruction::execute (VPTransformState &State) {
849849 assert ((isa<PHINode>(&I) || getNumOperands () == 0 ) &&
850850 " Only PHINodes can have extra operands" );
851- if ( getNumOperands () == 1 ) {
852- VPValue *ExitValue = getOperand ( 0 ) ;
851+ for ( const auto &[Idx, Op] : enumerate( operands ()) ) {
852+ VPValue *ExitValue = Op ;
853853 auto Lane = vputils::isUniformAfterVectorization (ExitValue)
854854 ? VPLane::getFirstLane ()
855855 : VPLane::getLastLaneForVF (State.VF );
856- auto *PredVPBB = cast<VPBasicBlock>(getParent ()->getSinglePredecessor ());
856+ VPBlockBase *Pred = getParent ()->getPredecessors ()[Idx];
857+ auto *PredVPBB = Pred->getExitingBasicBlock ();
857858 BasicBlock *PredBB = State.CFG .VPBB2IRBB [PredVPBB];
858859 // Set insertion point in PredBB in case an extract needs to be generated.
859860 // TODO: Model extracts explicitly.
@@ -881,7 +882,7 @@ void VPIRInstruction::print(raw_ostream &O, const Twine &Indent,
881882 O << Indent << " IR " << I;
882883
883884 if (getNumOperands () != 0 ) {
884- assert (getNumOperands () == 1 && " can have at most 1 operand" );
885+ // assert(getNumOperands() == 1 && "can have at most 1 operand");
885886 O << " (extra operand: " ;
886887 printOperands (O, SlotTracker);
887888 O << " )" ;
0 commit comments