[llvm] [TableGen][DecoderEmitter] Fix decoder reading bytes past instruction (PR #154916)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 04:53:14 PDT 2025


================
@@ -488,8 +502,9 @@ class FilterChooser {
   // Links to the FilterChooser above us in the decoding tree.
   const FilterChooser *Parent;
 
-  // Width of instructions
-  unsigned BitWidth;
+  /// Some targets (ARM) specify more encoding bits in Inst that Size allows.
+  /// This field allows us to ignore the extra bits.
+  unsigned MaxFilterWidth;
----------------
s-barannikov wrote:

I really woudn't want to hardcode 8 inside InstructionEncoding. The value is wrong on my downstream arch. I would prefer it be hardcoded somewhere else, where we have access to CodeGenTarget, if possible.

https://github.com/llvm/llvm-project/pull/154916


More information about the llvm-commits mailing list