Skip to content

Commit bcd80a7

Browse files
committed
Update to use ActiveElementsAffectResults TSFlag
1 parent a621896 commit bcd80a7

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
376365
static 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

Comments
 (0)