[llvm] [LLVM][MC] Add support to cull inactive decoders in decoder emitter (PR #154865)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 25 23:21:44 PDT 2025


================
@@ -1158,6 +1158,13 @@ class InstrInfo {
   //
   // This option is a temporary migration help. It will go away.
   bit guessInstructionProperties = true;
+
+  // Generate decoders that are specialized per bit width in the generated
+  // decoder/disassembler. This requires use of different `InsnType` for
+  // different bitwidths and defining `InsnBitWidth` template specialization for
+  // the `InsnType` types used. Some common specializations are already defined
+  // in MCDecoder.h.
+  bit SpecializeDecodersPerBitwidth = false;
----------------
s-barannikov wrote:

It's not about InstrInfo. My point is that decoder options should be, well, *decoder* options. Otherwise we regenerate *all* `*.inc` files, all `*.cpp` files that include them, and relink `llc` when the option changes. Changing the option value on the command line would lead to recompiling YourTargetDisassembler.cpp only. It is also useful when you want to experiment with various options / combinations of thereof, and makes unittests simpler (since you no longer need to duplicate tests for each option value, you can pass it on the command like and use `--check-prefix`).


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


More information about the llvm-commits mailing list