[llvm] [GlobalISel] Change MatchTable entries to 1 byte each (PR #74429)
Wang Pengcheng via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 7 02:06:46 PST 2023
================
@@ -111,6 +148,17 @@ template std::vector<Matcher *> optimizeRules<SwitchMatcher>(
ArrayRef<Matcher *> Rules,
std::vector<std::unique_ptr<Matcher>> &MatcherStorage);
+static std::string getEncodedEmitStr(StringRef NamedValue, unsigned NumBytes) {
+ if (NumBytes == 2)
----------------
wangpc-pp wrote:
This can be simplified to:
```c
static std::string getEncodedEmitStr(StringRef NamedValue, unsigned NumBytes) {
if (NumBytes == 2 || NumBytes == 4 || NumBytes == 8)
return ("GIMT_Encode" + NumBytes + "(" + NamedValue + ")").str();
else
llvm_unreachable("Unsupported number of bytes!");
}
```
https://github.com/llvm/llvm-project/pull/74429
More information about the llvm-commits
mailing list