[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 05:43:02 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 guess I can do something like:
```
  unsigned ByteWidth = EncodingDef->getRecords()
      .getAllDerivedDefinitions("Target")
      .front()
      ->getValueAsInt("ByteWidth");
```
inside InstructionEndoing. Not cute but not that ugly.


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


More information about the llvm-commits mailing list