Skip to content

Commit

Permalink
Merge pull request #121 from ziliangzl/vmsle
Browse files Browse the repository at this point in the history
[VENTUS][fix] Fix missing regexti instruction for vmsle instruction
  • Loading branch information
ziliangzl authored May 23, 2024
2 parents 9d96666 + 11b55ac commit 76ed2fc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions llvm/lib/Target/RISCV/VentusRegextInsertion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
//
//===----------------------------------------------------------------------===//

#include "MCTargetDesc/RISCVBaseInfo.h"
#include "RISCV.h"
#include "RISCVInstrInfo.h"
#include "RISCVTargetMachine.h"
Expand Down Expand Up @@ -75,7 +76,7 @@ bool VentusRegextInsertion::insertRegext(MachineBasicBlock &MBB,
MachineInstr &MI) {
bool hasOverflow = false;

if (MI.isPseudo())
if (MI.isPseudo() && RISCVII::isVOPIMM11(MI.getDesc().TSFlags))
return false;

// 3 bits encoding for each rd, rs1, rs2, rs3, total 12 bits.
Expand All @@ -86,7 +87,7 @@ bool VentusRegextInsertion::insertRegext(MachineBasicBlock &MBB,
MachineOperand &Op = MI.getOperand(i);
if (!Op.isReg() ||
MI.getDesc().getOperandConstraint(i, MCOI::TIED_TO) != -1 ||
MI.isDebugInstr() || MI.isPseudo())
MI.isDebugInstr())
continue;

uint16_t RegEncodingValue = TRI->getEncodingValue(Op.getReg());
Expand Down Expand Up @@ -120,4 +121,4 @@ namespace llvm {
FunctionPass *createVentusRegextInsertionPass() {
return new VentusRegextInsertion();
}
} // end of namespace llvm
} // end of namespace llvm

0 comments on commit 76ed2fc

Please sign in to comment.