@@ -362,17 +362,6 @@ static bool isSafeToMove(const MachineInstr &From, const MachineInstr &To) {
362362 return From.isSafeToMove (SawStore);
363363}
364364
365- static std::optional<bool >
366- lookupActiveElementsAffectsResult (const MachineInstr &MI) {
367- const RISCV::RISCVMaskedPseudoInfo *Info =
368- RISCV::lookupMaskedIntrinsicByUnmasked (MI.getOpcode ());
369- if (!Info)
370- Info = RISCV::getMaskedPseudoInfo (MI.getOpcode ());
371- if (!Info)
372- return std::nullopt ;
373- return Info->ActiveElementsAffectResult ;
374- }
375-
376365static unsigned getSEWLMULRatio (const MachineInstr &MI) {
377366 RISCVII::VLMUL LMUL = RISCVII::getLMul (MI.getDesc ().TSFlags );
378367 unsigned Log2SEW = MI.getOperand (RISCVII::getSEWOpNum (MI.getDesc ())).getImm ();
@@ -434,10 +423,10 @@ bool RISCVVectorPeephole::foldVMV_V_V(MachineInstr &MI) {
434423 bool VLChanged = !MinVL->isIdenticalTo (SrcVL);
435424 bool RaisesFPExceptions = MI.getDesc ().mayRaiseFPException () &&
436425 !MI.getFlag (MachineInstr::MIFlag::NoFPExcept);
437- auto ActiveElementsAffectResult = lookupActiveElementsAffectsResult (*Src);
438- if (!ActiveElementsAffectResult)
439- return false ;
440- if (VLChanged && (* ActiveElementsAffectResult || RaisesFPExceptions))
426+ bool ActiveElementsAffectResult = RISCVII::activeElementsAffectResult (
427+ TII-> get ( RISCV::getRVVMCOpcode (Src-> getOpcode ())). TSFlags );
428+
429+ if (VLChanged && (ActiveElementsAffectResult || RaisesFPExceptions))
441430 return false ;
442431
443432 if (!isSafeToMove (*Src, MI))
0 commit comments