@@ -857,12 +857,13 @@ void VPInstruction::print(raw_ostream &O, const Twine &Indent,
857
857
void VPIRInstruction::execute (VPTransformState &State) {
858
858
assert ((isa<PHINode>(&I) || getNumOperands () == 0 ) &&
859
859
" Only PHINodes can have extra operands" );
860
- if ( getNumOperands () == 1 ) {
861
- VPValue *ExitValue = getOperand ( 0 ) ;
860
+ for ( const auto &[Idx, Op] : enumerate( operands ()) ) {
861
+ VPValue *ExitValue = Op ;
862
862
auto Lane = vputils::isUniformAfterVectorization (ExitValue)
863
863
? VPLane::getFirstLane ()
864
864
: VPLane::getLastLaneForVF (State.VF );
865
- auto *PredVPBB = cast<VPBasicBlock>(getParent ()->getSinglePredecessor ());
865
+ VPBlockBase *Pred = getParent ()->getPredecessors ()[Idx];
866
+ auto *PredVPBB = Pred->getExitingBasicBlock ();
866
867
BasicBlock *PredBB = State.CFG .VPBB2IRBB [PredVPBB];
867
868
// Set insertion point in PredBB in case an extract needs to be generated.
868
869
// TODO: Model extracts explicitly.
@@ -890,7 +891,7 @@ void VPIRInstruction::print(raw_ostream &O, const Twine &Indent,
890
891
O << Indent << " IR " << I;
891
892
892
893
if (getNumOperands () != 0 ) {
893
- assert (getNumOperands () == 1 && " can have at most 1 operand" );
894
+ // assert(getNumOperands() == 1 && "can have at most 1 operand");
894
895
O << " (extra operand: " ;
895
896
printOperands (O, SlotTracker);
896
897
O << " )" ;
0 commit comments