@@ -843,12 +843,13 @@ void VPInstruction::print(raw_ostream &O, const Twine &Indent,
843
843
void VPIRInstruction::execute (VPTransformState &State) {
844
844
assert ((isa<PHINode>(&I) || getNumOperands () == 0 ) &&
845
845
" Only PHINodes can have extra operands" );
846
- if ( getNumOperands () == 1 ) {
847
- VPValue *ExitValue = getOperand ( 0 ) ;
846
+ for ( const auto &[Idx, Op] : enumerate( operands ()) ) {
847
+ VPValue *ExitValue = Op ;
848
848
auto Lane = vputils::isUniformAfterVectorization (ExitValue)
849
849
? VPLane::getFirstLane ()
850
850
: VPLane::getLastLaneForVF (State.VF );
851
- auto *PredVPBB = cast<VPBasicBlock>(getParent ()->getSinglePredecessor ());
851
+ VPBlockBase *Pred = getParent ()->getPredecessors ()[Idx];
852
+ auto *PredVPBB = Pred->getExitingBasicBlock ();
852
853
BasicBlock *PredBB = State.CFG .VPBB2IRBB [PredVPBB];
853
854
// Set insertion point in PredBB in case an extract needs to be generated.
854
855
// TODO: Model extracts explicitly.
@@ -869,7 +870,7 @@ void VPIRInstruction::print(raw_ostream &O, const Twine &Indent,
869
870
O << Indent << " IR " << I;
870
871
871
872
if (getNumOperands () != 0 ) {
872
- assert (getNumOperands () == 1 && " can have at most 1 operand" );
873
+ // assert(getNumOperands() == 1 && "can have at most 1 operand");
873
874
O << " (extra operand: " ;
874
875
printOperands (O, SlotTracker);
875
876
O << " )" ;
0 commit comments