Skip to content

Commit 2a8040e

Browse files
committed
[RISCV] Avoid looking up base opcode when converting vmerge -> vmv. NFC
This helps avoid a diff in #71764
1 parent 439b16e commit 2a8040e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/RISCV/RISCVFoldMasks.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ bool RISCVFoldMasks::convertVMergeToVMv(MachineInstr &MI, MachineInstr *V0Def) {
9999
unsigned NewOpc;
100100
switch (MI.getOpcode()) {
101101
default:
102-
llvm_unreachable("Expected VMERGE_VVM_<LMUL> instruction.");
102+
return false;
103103
CASE_VMERGE_TO_VMV(MF8)
104104
CASE_VMERGE_TO_VMV(MF4)
105105
CASE_VMERGE_TO_VMV(MF2)
@@ -204,10 +204,8 @@ bool RISCVFoldMasks::runOnMachineFunction(MachineFunction &MF) {
204204
for (MachineBasicBlock &MBB : MF) {
205205
CurrentV0Def = nullptr;
206206
for (MachineInstr &MI : MBB) {
207-
unsigned BaseOpc = RISCV::getRVVMCOpcode(MI.getOpcode());
208207
Changed |= convertToUnmasked(MI, CurrentV0Def);
209-
if (BaseOpc == RISCV::VMERGE_VVM)
210-
Changed |= convertVMergeToVMv(MI, CurrentV0Def);
208+
Changed |= convertVMergeToVMv(MI, CurrentV0Def);
211209

212210
if (MI.definesRegister(RISCV::V0, TRI))
213211
CurrentV0Def = &MI;

0 commit comments

Comments
 (0)