From 59bec4d9187932972492302fbbe3680ce592e383 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 15 Jan 2025 00:30:53 -0800 Subject: [PATCH] [RISCV][llvm-exegesis] Disable pseudo instructions in allowAsBackToBack. (#122986) Prevents crashes trying to encode pseudo instuctions. Tested on HiFive Premier P550. Fixes #122974 --- llvm/tools/llvm-exegesis/lib/RISCV/Target.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/tools/llvm-exegesis/lib/RISCV/Target.cpp b/llvm/tools/llvm-exegesis/lib/RISCV/Target.cpp index d55db9af8a9bd84..217b423d7b3f33a 100644 --- a/llvm/tools/llvm-exegesis/lib/RISCV/Target.cpp +++ b/llvm/tools/llvm-exegesis/lib/RISCV/Target.cpp @@ -122,6 +122,10 @@ class ExegesisRISCVTarget : public ExegesisTarget { ArrayRef 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;