[llvm] [TableGen][DecoderEmitter] Print the size of the decoder tables (PR #155139)
Sergei Barannikov via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 23 21:12:39 PDT 2025
https://github.com/s-barannikov created https://github.com/llvm/llvm-project/pull/155139
So we can see the changes in table sizes after making changes to DecoderEmitter by simply running `grep DecoderTable`.
Also, remove an unnecessary terminating 0 from the end of the tables.
>From 7d7c89e0455277ecd958a53d2d3d8137612e318f Mon Sep 17 00:00:00 2001
From: Sergei Barannikov <barannikov88 at gmail.com>
Date: Sun, 24 Aug 2025 07:08:16 +0300
Subject: [PATCH] [TableGen][DecoderEmitter] Print the size of the decoder
tables
So we can see the changes in table sizes after making changes to
DecoderEmitter by simply running `grep DecoderTable`.
Also, remove an unnecessary terminating 0 from the end of the tables.
---
llvm/utils/TableGen/DecoderEmitter.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index 84a9d35436bef..d232195e38534 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -795,7 +795,7 @@ unsigned DecoderEmitter::emitTable(formatted_raw_ostream &OS,
OS << "static const uint8_t DecoderTable" << Namespace;
if (HwModeID != DefaultMode)
OS << '_' << Target.getHwModes().getModeName(HwModeID);
- OS << BitWidth << "[] = {\n";
+ OS << BitWidth << "[" << Table.size() << "] = {\n";
// Emit ULEB128 encoded value to OS, returning the number of bytes emitted.
auto emitULEB128 = [](DecoderTable::const_iterator &I,
@@ -978,7 +978,6 @@ unsigned DecoderEmitter::emitTable(formatted_raw_ostream &OS,
break;
}
}
- OS << " 0\n";
OS << "};\n\n";
return OpcodeMask;
More information about the llvm-commits
mailing list