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

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 00:39:59 PST 2023


================
@@ -427,8 +458,8 @@ bool GIMatchTableExecutor::executeMatchTable(
       break;
     }
     case GIM_CheckAtomicOrdering: {
-      int64_t InsnID = MatchTable[CurrentIdx++];
-      AtomicOrdering Ordering = (AtomicOrdering)MatchTable[CurrentIdx++];
+      uint64_t InsnID = nextULEB128();
+      auto Ordering = (AtomicOrdering)nextULEB128();
----------------
Pierre-vh wrote:

Why? It's more verbose
Coding style says it's fine if it's casting between integral types:
https://llvm.org/docs/CodingStandards.html#prefer-c-style-casts

> When casting between integral types (including enums that are not strongly- typed), functional-style casts are permitted as an alternative to static_cast.


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


More information about the llvm-commits mailing list