[llvm] [GlobalISel] Optimize ULEB128 usage (PR #90565)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 06:20:34 PDT 2024


================
@@ -713,6 +713,27 @@ class GIMatchTableExecutor {
     memcpy(&Ret, MatchTable, sizeof(Ret));
     return Ret;
   }
+
+public:
+  // Faster ULEB128 decoder tailored for the Match Table Executor.
+  //
+  // - Arguments are fixed to avoid mid-function checks.
+  // - Unchecked execution, assumes no error.
+  // - Fast common case handling (1 byte values).
+  LLVM_ATTRIBUTE_ALWAYS_INLINE static uint64_t
+  fastDecodeULEB128(const uint8_t *__restrict MatchTable,
----------------
arsenm wrote:

This isn't really worthy of an RFC. We just need another macro in Support/Compiler.h

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


More information about the llvm-commits mailing list