@@ -769,21 +769,23 @@ bool RISCVVectorPeephole::foldVMergeToMask(MachineInstr &MI) const {
769769 " Foldable unmasked pseudo should have a policy op already" );
770770
771771 // Make sure the mask dominates True, otherwise move down True so it does.
772- // VL will always dominate because if its a register they need to be the same.
772+ // VL will always dominate since if it's a register they need to be the same.
773773 if (!ensureDominates (MaskOp, True))
774774 return false ;
775775
776776 True.setDesc (TII->get (Info->MaskedPseudo ));
777777
778778 // Insert the mask operand.
779779 // TODO: Increment MaskOpIdx by number of explicit defs?
780- True.insert (&True.getOperand (Info->MaskOpIdx + True.getNumExplicitDefs ()),
780+ True.insert (True.operands_begin () + Info->MaskOpIdx +
781+ True.getNumExplicitDefs (),
781782 MachineOperand::CreateReg (MaskOp.getReg (), false ));
782783
783784 // Update the passthru, AVL and policy.
784785 True.getOperand (True.getNumExplicitDefs ()).setReg (FalseReg);
785786 True.removeOperand (RISCVII::getVLOpNum (True.getDesc ()));
786- True.insert (&True.getOperand (RISCVII::getVLOpNum (True.getDesc ())), MinVL);
787+ True.insert (True.operands_begin () + RISCVII::getVLOpNum (True.getDesc ()),
788+ MinVL);
787789 True.getOperand (RISCVII::getVecPolicyOpNum (True.getDesc ())).setImm (Policy);
788790
789791 MRI->replaceRegWith (True.getOperand (0 ).getReg (), MI.getOperand (0 ).getReg ());
0 commit comments