Skip to content

Commit 487bd23

Browse files
committed
Use getRVVMCOpcode
1 parent 71c9327 commit 487bd23

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

llvm/lib/Target/RISCV/RISCVFoldMasks.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,6 @@ bool RISCVFoldMasks::isAllOnesMask(MachineInstr *MaskCopy) {
8888
}
8989
}
9090

91-
static bool isVMerge(MachineInstr &MI) {
92-
unsigned Opc = MI.getOpcode();
93-
return Opc == RISCV::PseudoVMERGE_VVM_MF8 ||
94-
Opc == RISCV::PseudoVMERGE_VVM_MF4 ||
95-
Opc == RISCV::PseudoVMERGE_VVM_MF2 ||
96-
Opc == RISCV::PseudoVMERGE_VVM_M1 ||
97-
Opc == RISCV::PseudoVMERGE_VVM_M2 ||
98-
Opc == RISCV::PseudoVMERGE_VVM_M4 || Opc == RISCV::PseudoVMERGE_VVM_M8;
99-
}
100-
10191
// Transform (VMERGE_VVM_<LMUL> false, false, true, allones, vl, sew) to
10292
// (VMV_V_V_<LMUL> false, true, vl, sew). It may decrease uses of VMSET.
10393
bool RISCVFoldMasks::convertVMergeToVMv(MachineInstr &MI, MachineInstr *V0Def) {
@@ -169,7 +159,8 @@ bool RISCVFoldMasks::runOnMachineFunction(MachineFunction &MF) {
169159
for (MachineBasicBlock &MBB : MF) {
170160
CurrentV0Def = nullptr;
171161
for (MachineInstr &MI : MBB) {
172-
if (isVMerge(MI))
162+
unsigned BaseOpc = RISCV::getRVVMCOpcode(MI.getOpcode());
163+
if (BaseOpc == RISCV::VMERGE_VVM)
173164
Changed |= convertVMergeToVMv(MI, CurrentV0Def);
174165

175166
if (MI.definesRegister(RISCV::V0, TRI))

0 commit comments

Comments
 (0)