@@ -91,7 +91,8 @@ bool RISCVVectorPeephole::hasSameEEW(const MachineInstr &User,
9191 User.getOperand (RISCVII::getSEWOpNum (User.getDesc ())).getImm ();
9292 unsigned SrcLog2SEW =
9393 Src.getOperand (RISCVII::getSEWOpNum (Src.getDesc ())).getImm ();
94- unsigned SrcLog2EEW = RISCV::getDestLog2EEW (Src.getDesc (), SrcLog2SEW);
94+ unsigned SrcLog2EEW = RISCV::getDestLog2EEW (
95+ TII->get (RISCV::getRVVMCOpcode (Src.getOpcode ())), SrcLog2SEW);
9596 return SrcLog2EEW == UserLog2SEW;
9697}
9798
@@ -169,8 +170,8 @@ bool RISCVVectorPeephole::tryToReduceVL(MachineInstr &MI) const {
169170 if (!hasSameEEW (MI, *Src))
170171 continue ;
171172
172- bool ElementsDependOnVL =
173- RISCVII::elementsDependOnVL (Src->getDesc ( ).TSFlags );
173+ bool ElementsDependOnVL = RISCVII::elementsDependOnVL (
174+ TII-> get ( RISCV::getRVVMCOpcode (Src->getOpcode ()) ).TSFlags );
174175 if (ElementsDependOnVL || Src->mayRaiseFPException ())
175176 continue ;
176177
@@ -759,11 +760,11 @@ bool RISCVVectorPeephole::foldVMergeToMask(MachineInstr &MI) const {
759760 else
760761 return false ;
761762
762- if (RISCVII::elementsDependOnVL (True.getDesc ().TSFlags ) &&
763- !TrueVL.isIdenticalTo (MinVL))
763+ unsigned RVVTSFlags =
764+ TII->get (RISCV::getRVVMCOpcode (True.getOpcode ())).TSFlags ;
765+ if (RISCVII::elementsDependOnVL (RVVTSFlags) && !TrueVL.isIdenticalTo (MinVL))
764766 return false ;
765- if (RISCVII::elementsDependOnMask (True.getDesc ().TSFlags ) &&
766- !isAllOnesMask (Mask))
767+ if (RISCVII::elementsDependOnMask (RVVTSFlags) && !isAllOnesMask (Mask))
767768 return false ;
768769
769770 // Use a tumu policy, relaxing it to tail agnostic provided that the passthru
0 commit comments