Skip to content

Commit

Permalink
[RISCV][llvm-exegesis] Disable pseudo instructions in allowAsBackToBa…
Browse files Browse the repository at this point in the history
…ck. (llvm#122986)

Prevents crashes trying to encode pseudo instuctions. Tested on HiFive
Premier P550.

Fixes llvm#122974
  • Loading branch information
topperc authored and paulhuggett committed Jan 16, 2025
1 parent 6996a4b commit 59bec4d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/tools/llvm-exegesis/lib/RISCV/Target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ class ExegesisRISCVTarget : public ExegesisTarget {

ArrayRef<unsigned> getUnavailableRegisters() const override;

bool allowAsBackToBack(const Instruction &Instr) const override {
return !Instr.Description.isPseudo();
}

Error randomizeTargetMCOperand(const Instruction &Instr, const Variable &Var,
MCOperand &AssignedValue,
const BitVector &ForbiddenRegs) const override;
Expand Down

0 comments on commit 59bec4d

Please sign in to comment.