@@ -362,17 +362,6 @@ static bool isSafeToMove(const MachineInstr &From, const MachineInstr &To) {
362
362
return From.isSafeToMove (SawStore);
363
363
}
364
364
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
-
376
365
static unsigned getSEWLMULRatio (const MachineInstr &MI) {
377
366
RISCVII::VLMUL LMUL = RISCVII::getLMul (MI.getDesc ().TSFlags );
378
367
unsigned Log2SEW = MI.getOperand (RISCVII::getSEWOpNum (MI.getDesc ())).getImm ();
@@ -434,10 +423,10 @@ bool RISCVVectorPeephole::foldVMV_V_V(MachineInstr &MI) {
434
423
bool VLChanged = !MinVL->isIdenticalTo (SrcVL);
435
424
bool RaisesFPExceptions = MI.getDesc ().mayRaiseFPException () &&
436
425
!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))
441
430
return false ;
442
431
443
432
if (!isSafeToMove (*Src, MI))
0 commit comments