[llvm] [TableGen] Add a field to filter out GenericTable entries (PR #65458)
Michael Maitland via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 6 09:14:21 PDT 2023
================
@@ -734,22 +738,25 @@ irrelevant.
def ATable : GenericTable {
let FilterClass = "AEntry";
+ let FilterClassField = "IsNeeded";
let Fields = ["Str", "Val1", "Val2"];
let PrimaryKey = ["Val1", "Val2"];
let PrimaryKeyName = "lookupATableByValues";
}
- class AEntry<string str, int val1, int val2> {
+ class AEntry<string str, int val1, int val2, bit isNeeded> {
string Str = str;
bits<8> Val1 = val1;
bits<10> Val2 = val2;
+ bit IsNeeded = isNeeded;
}
- def : AEntry<"Bob", 5, 3>;
- def : AEntry<"Carol", 2, 6>;
- def : AEntry<"Ted", 4, 4>;
- def : AEntry<"Alice", 4, 5>;
- def : AEntry<"Costa", 2, 1>;
+ def : AEntry<"Bob", 5, 3, 1>;
+ def : AEntry<"Carol", 2, 6, 1>;
+ def : AEntry<"Ted", 4, 4, 1>;
+ def : AEntry<"Alice", 4, 5, 1>;
+ def : AEntry<"Costa", 2, 1, 1>;
+ def : AEntry<"Dale", 2, 1, 0>;
----------------
michaelmaitland wrote:
Yes you make a great point @statham-arm. @wangpc-pp are you able to make a note of that so it's obvious to anyone who reads the docs?
https://github.com/llvm/llvm-project/pull/65458
More information about the llvm-commits
mailing list