[llvm] [GlobalISel] Change MatchTable entries to 1 byte each (PR #74429)

Wang Pengcheng via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 20:23:53 PST 2023


================
@@ -92,28 +93,53 @@ bool GIMatchTableExecutor::executeMatchTable(
 
   // If the index is >= 0, it's an index in the type objects generated by
   // TableGen. If the index is <0, it's an index in the recorded types object.
-  auto getTypeFromIdx = [&](int64_t Idx) -> LLT {
+  const auto getTypeFromIdx = [&](int64_t Idx) -> LLT {
     if (Idx >= 0)
       return ExecInfo.TypeObjects[Idx];
     return State.RecordedTypes[1 - Idx];
   };
 
+  const auto nextULEB128 = [&]() {
+    unsigned N = 0;
+    uint64_t Val = decodeULEB128(MatchTable + CurrentIdx, &N);
+    CurrentIdx += N;
+    return Val;
+  };
+
+  const auto next2Bytes = [&]() {
----------------
wangpc-pp wrote:

What about `readULEB128`, `readUInt16`, `readUInt32`, `readUInt64`?

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


More information about the llvm-commits mailing list