@@ -848,12 +848,13 @@ void VPInstruction::print(raw_ostream &O, const Twine &Indent,
848
848
void VPIRInstruction::execute (VPTransformState &State) {
849
849
assert ((isa<PHINode>(&I) || getNumOperands () == 0 ) &&
850
850
" 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 ;
853
853
auto Lane = vputils::isUniformAfterVectorization (ExitValue)
854
854
? VPLane::getFirstLane ()
855
855
: VPLane::getLastLaneForVF (State.VF );
856
- auto *PredVPBB = cast<VPBasicBlock>(getParent ()->getSinglePredecessor ());
856
+ VPBlockBase *Pred = getParent ()->getPredecessors ()[Idx];
857
+ auto *PredVPBB = Pred->getExitingBasicBlock ();
857
858
BasicBlock *PredBB = State.CFG .VPBB2IRBB [PredVPBB];
858
859
// Set insertion point in PredBB in case an extract needs to be generated.
859
860
// TODO: Model extracts explicitly.
@@ -881,7 +882,7 @@ void VPIRInstruction::print(raw_ostream &O, const Twine &Indent,
881
882
O << Indent << " IR " << I;
882
883
883
884
if (getNumOperands () != 0 ) {
884
- assert (getNumOperands () == 1 && " can have at most 1 operand" );
885
+ // assert(getNumOperands() == 1 && "can have at most 1 operand");
885
886
O << " (extra operand: " ;
886
887
printOperands (O, SlotTracker);
887
888
O << " )" ;
0 commit comments