[llvm] 4c2e4ea - [RISCV][llvm-exegesis] Disable pseudo instructions in allowAsBackToBack. (#122986)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 00:30:57 PST 2025


Author: Craig Topper
Date: 2025-01-15T00:30:53-08:00
New Revision: 4c2e4ea18fd0031636994cf81fd03d82f59b7d27

URL: https://github.com/llvm/llvm-project/commit/4c2e4ea18fd0031636994cf81fd03d82f59b7d27
DIFF: https://github.com/llvm/llvm-project/commit/4c2e4ea18fd0031636994cf81fd03d82f59b7d27.diff

LOG: [RISCV][llvm-exegesis] Disable pseudo instructions in allowAsBackToBack. (#122986)

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

Fixes #122974

Added: 
    

Modified: 
    llvm/tools/llvm-exegesis/lib/RISCV/Target.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-exegesis/lib/RISCV/Target.cpp b/llvm/tools/llvm-exegesis/lib/RISCV/Target.cpp
index d55db9af8a9bd8..217b423d7b3f33 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<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;


        


More information about the llvm-commits mailing list