[llvm] [TableGen] Emit Debug code for dynamic bits(eg: instruction operands) in DecoderEmitter (PR #194699)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Sat May 2 08:15:12 PDT 2026


================
@@ -683,6 +683,58 @@ static std::vector<EncodingIsland> getIslands(const KnownBits &EncodingBits,
   return Islands;
 }
 
+static std::string getOperandFieldDescForDebug(const OperandInfo &OpInfo) {
+  if (OpInfo.Fields.empty() && !OpInfo.InitValue)
+    return "bits<0>";
+  if (OpInfo.fields().empty())
----------------
s-barannikov wrote:

It seems like I actually wanted to do the opposite and turn it into a class.
https://github.com/llvm/llvm-project/pull/156759#discussion_r2320325744

I don't remember what was on my mind, either works for me now.


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


More information about the llvm-commits mailing list