[llvm] 0384069 - [AArch64] Use GenericTable PrimaryKey to remove some SearchIndexes. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 23:10:40 PST 2025


Author: Craig Topper
Date: 2025-01-10T23:04:28-08:00
New Revision: 0384069d6ca5cd025cae414e65ab08f174fcc175

URL: https://github.com/llvm/llvm-project/commit/0384069d6ca5cd025cae414e65ab08f174fcc175
DIFF: https://github.com/llvm/llvm-project/commit/0384069d6ca5cd025cae414e65ab08f174fcc175.diff

LOG: [AArch64] Use GenericTable PrimaryKey to remove some SearchIndexes. NFC

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64SystemOperands.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64SystemOperands.td b/llvm/lib/Target/AArch64/AArch64SystemOperands.td
index 355a9d2a0415af..df5db8fa514a1b 100644
--- a/llvm/lib/Target/AArch64/AArch64SystemOperands.td
+++ b/llvm/lib/Target/AArch64/AArch64SystemOperands.td
@@ -61,6 +61,9 @@ def ATValues : GenericEnum {
 def ATsList : GenericTable {
   let FilterClass = "AT";
   let Fields = ["Name", "Encoding", "Requires"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupATByEncoding";
 }
 
 def lookupATByName : SearchIndex {
@@ -68,11 +71,6 @@ def lookupATByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupATByEncoding : SearchIndex {
-  let Table = ATsList;
-  let Key = ["Encoding"];
-}
-
 def : AT<"S1E1R",  0b000, 0b0111, 0b1000, 0b000>;
 def : AT<"S1E2R",  0b100, 0b0111, 0b1000, 0b000>;
 def : AT<"S1E3R",  0b110, 0b0111, 0b1000, 0b000>;
@@ -114,6 +112,9 @@ def DBValues : GenericEnum {
 def DBsList : GenericTable {
   let FilterClass = "DB";
   let Fields = ["Name", "Encoding"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupDBByEncoding";
 }
 
 def lookupDBByName : SearchIndex {
@@ -121,11 +122,6 @@ def lookupDBByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupDBByEncoding : SearchIndex {
-  let Table = DBsList;
-  let Key = ["Encoding"];
-}
-
 def : DB<"oshld", 0x1>;
 def : DB<"oshst", 0x2>;
 def : DB<"osh",   0x3>;
@@ -155,6 +151,9 @@ def DBnXSValues : GenericEnum {
 def DBnXSsList : GenericTable {
   let FilterClass = "DBnXS";
   let Fields = ["Name", "Encoding", "ImmValue", "Requires"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupDBnXSByEncoding";
 }
 
 def lookupDBnXSByName : SearchIndex {
@@ -162,11 +161,6 @@ def lookupDBnXSByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupDBnXSByEncoding : SearchIndex {
-  let Table = DBnXSsList;
-  let Key = ["Encoding"];
-}
-
 def lookupDBnXSByImmValue : SearchIndex {
   let Table = DBnXSsList;
   let Key = ["ImmValue"];
@@ -201,6 +195,9 @@ def DCValues : GenericEnum {
 def DCsList : GenericTable {
   let FilterClass = "DC";
   let Fields = ["Name", "Encoding", "Requires"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupDCByEncoding";
 }
 
 def lookupDCByName : SearchIndex {
@@ -208,11 +205,6 @@ def lookupDCByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupDCByEncoding : SearchIndex {
-  let Table = DCsList;
-  let Key = ["Encoding"];
-}
-
 def : DC<"ZVA",   0b011, 0b0111, 0b0100, 0b001>;
 def : DC<"IVAC",  0b000, 0b0111, 0b0110, 0b001>;
 def : DC<"ISW",   0b000, 0b0111, 0b0110, 0b010>;
@@ -289,6 +281,9 @@ def ICValues : GenericEnum {
 def ICsList : GenericTable {
   let FilterClass = "IC";
   let Fields = ["Name", "Encoding", "NeedsReg"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupICByEncoding";
 }
 
 def lookupICByName : SearchIndex {
@@ -296,11 +291,6 @@ def lookupICByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupICByEncoding : SearchIndex {
-  let Table = ICsList;
-  let Key = ["Encoding"];
-}
-
 def : IC<"IALLUIS", 0b000, 0b0111, 0b0001, 0b000, 0>;
 def : IC<"IALLU",   0b000, 0b0111, 0b0101, 0b000, 0>;
 def : IC<"IVAU",    0b011, 0b0111, 0b0101, 0b001, 1>;
@@ -324,6 +314,9 @@ def ISBValues : GenericEnum {
 def ISBsList : GenericTable {
   let FilterClass = "ISB";
   let Fields = ["Name", "Encoding"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupISBByEncoding";
 }
 
 def lookupISBByName : SearchIndex {
@@ -331,11 +324,6 @@ def lookupISBByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupISBByEncoding : SearchIndex {
-  let Table = ISBsList;
-  let Key = ["Encoding"];
-}
-
 def : ISB<"sy", 0xf>;
 
 //===----------------------------------------------------------------------===//
@@ -359,6 +347,9 @@ def TSBValues : GenericEnum {
 def TSBsList : GenericTable {
   let FilterClass = "TSB";
   let Fields = ["Name", "Encoding", "Requires"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupTSBByEncoding";
 }
 
 def lookupTSBByName : SearchIndex {
@@ -366,11 +357,6 @@ def lookupTSBByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupTSBByEncoding : SearchIndex {
-  let Table = TSBsList;
-  let Key = ["Encoding"];
-}
-
 def : TSB<"csync", 0>;
 
 //===----------------------------------------------------------------------===//
@@ -398,6 +384,9 @@ def PRFMValues : GenericEnum {
 def PRFMsList : GenericTable {
   let FilterClass = "PRFM";
   let Fields = ["Name", "Encoding", "Requires"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupPRFMByEncoding";
 }
 
 def lookupPRFMByName : SearchIndex {
@@ -405,11 +394,6 @@ def lookupPRFMByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupPRFMByEncoding : SearchIndex {
-  let Table = PRFMsList;
-  let Key = ["Encoding"];
-}
-
 def : PRFM<"pld", 0b00, "l1",  0b00, "keep", 0b0>;
 def : PRFM<"pld", 0b00, "l1",  0b00, "strm", 0b1>;
 def : PRFM<"pld", 0b00, "l2",  0b01, "keep", 0b0>;
@@ -461,6 +445,9 @@ def SVEPRFMValues : GenericEnum {
 def SVEPRFMsList : GenericTable {
   let FilterClass = "SVEPRFM";
   let Fields = ["Name", "Encoding", "Requires"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupSVEPRFMByEncoding";
 }
 
 def lookupSVEPRFMByName : SearchIndex {
@@ -468,11 +455,6 @@ def lookupSVEPRFMByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupSVEPRFMByEncoding : SearchIndex {
-  let Table = SVEPRFMsList;
-  let Key = ["Encoding"];
-}
-
 let Requires = [{ {AArch64::FeatureSVE} }] in {
 def : SVEPRFM<"pldl1keep", 0x00>;
 def : SVEPRFM<"pldl1strm", 0x01>;
@@ -545,6 +527,9 @@ def SVEPREDPATValues : GenericEnum {
 def SVEPREDPATsList : GenericTable {
   let FilterClass = "SVEPREDPAT";
   let Fields = ["Name", "Encoding"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupSVEPREDPATByEncoding";
 }
 
 def lookupSVEPREDPATByName : SearchIndex {
@@ -552,11 +537,6 @@ def lookupSVEPREDPATByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupSVEPREDPATByEncoding : SearchIndex {
-  let Table = SVEPREDPATsList;
-  let Key = ["Encoding"];
-}
-
 def : SVEPREDPAT<"pow2",  0x00>;
 def : SVEPREDPAT<"vl1",   0x01>;
 def : SVEPREDPAT<"vl2",   0x02>;
@@ -594,6 +574,9 @@ def SVEVECLENSPECIFIERValues : GenericEnum {
 def SVEVECLENSPECIFIERsList : GenericTable {
   let FilterClass = "SVEVECLENSPECIFIER";
   let Fields = ["Name", "Encoding"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupSVEVECLENSPECIFIERByEncoding";
 }
 
 def lookupSVEVECLENSPECIFIERByName : SearchIndex {
@@ -601,11 +584,6 @@ def lookupSVEVECLENSPECIFIERByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupSVEVECLENSPECIFIERByEncoding : SearchIndex {
-  let Table = SVEVECLENSPECIFIERsList;
-  let Key = ["Encoding"];
-}
-
 def : SVEVECLENSPECIFIER<"vlx2", 0x0>;
 def : SVEVECLENSPECIFIER<"vlx4", 0x1>;
 
@@ -664,6 +642,9 @@ def PStateImm0_15Values : GenericEnum {
 def PStateImm0_15sList : GenericTable {
   let FilterClass = "PStateImm0_15";
   let Fields = ["Name", "Encoding", "Requires"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupPStateImm0_15ByEncoding";
 }
 
 def lookupPStateImm0_15ByName : SearchIndex {
@@ -671,11 +652,6 @@ def lookupPStateImm0_15ByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupPStateImm0_15ByEncoding : SearchIndex {
-  let Table = PStateImm0_15sList;
-  let Key = ["Encoding"];
-}
-
 class PStateImm0_1<string name, bits<3> op1, bits<3> op2, bits<3> crm_high> {
   string Name = name;
   bits<9> Encoding;
@@ -694,6 +670,9 @@ def PStateImm0_1Values : GenericEnum {
 def PStateImm0_1sList : GenericTable {
   let FilterClass = "PStateImm0_1";
   let Fields = ["Name", "Encoding", "Requires"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupPStateImm0_1ByEncoding";
 }
 
 def lookupPStateImm0_1ByName : SearchIndex {
@@ -701,11 +680,6 @@ def lookupPStateImm0_1ByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupPStateImm0_1ByEncoding : SearchIndex {
-  let Table = PStateImm0_1sList;
-  let Key = ["Encoding"];
-}
-
 //                   Name,     Op1,   Op2
 def : PStateImm0_15<"SPSel",   0b000, 0b101>;
 def : PStateImm0_15<"DAIFSet", 0b011, 0b110>;
@@ -753,6 +727,9 @@ def SVCRValues : GenericEnum {
 def SVCRsList : GenericTable {
   let FilterClass = "SVCR";
   let Fields = ["Name", "Encoding", "Requires"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupSVCRByEncoding";
 }
 
 def lookupSVCRByName : SearchIndex {
@@ -760,11 +737,6 @@ def lookupSVCRByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupSVCRByEncoding : SearchIndex {
-  let Table = SVCRsList;
-  let Key = ["Encoding"];
-}
-
 let Requires = [{ {AArch64::FeatureSME} }] in {
 def : SVCR<"SVCRSM",   0b001>;
 def : SVCR<"SVCRZA",   0b010>;
@@ -790,6 +762,9 @@ def PSBValues : GenericEnum {
 def PSBsList : GenericTable {
   let FilterClass = "PSB";
   let Fields = ["Name", "Encoding"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupPSBByEncoding";
 }
 
 def lookupPSBByName : SearchIndex {
@@ -797,11 +772,6 @@ def lookupPSBByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupPSBByEncoding : SearchIndex {
-  let Table = PSBsList;
-  let Key = ["Encoding"];
-}
-
 def : PSB<"csync", 0x11>;
 
 //===----------------------------------------------------------------------===//
@@ -823,6 +793,9 @@ def BTIValues : GenericEnum {
 def BTIsList : GenericTable {
   let FilterClass = "BTI";
   let Fields = ["Name", "Encoding"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupBTIByEncoding";
 }
 
 def lookupBTIByName : SearchIndex {
@@ -830,11 +803,6 @@ def lookupBTIByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupBTIByEncoding : SearchIndex {
-  let Table = BTIsList;
-  let Key = ["Encoding"];
-}
-
 def : BTI<"c",  0b010>;
 def : BTI<"j",  0b100>;
 def : BTI<"jc", 0b110>;
@@ -861,6 +829,9 @@ def TLBITable : GenericTable {
   let FilterClass = "TLBIEntry";
   let CppTypeName = "TLBI";
   let Fields = ["Name", "Encoding", "NeedsReg", "RequiresStr"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupTLBIByEncoding";
 }
 
 def lookupTLBIByName : SearchIndex {
@@ -868,11 +839,6 @@ def lookupTLBIByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupTLBIByEncoding : SearchIndex {
-  let Table = TLBITable;
-  let Key = ["Encoding"];
-}
-
 multiclass TLBI<string name, bits<3> op1, bits<4> crn, bits<4> crm,
              bits<3> op2, bit needsreg = 1> {
   def : TLBIEntry<name, op1, crn, crm, op2, needsreg>;
@@ -2382,6 +2348,9 @@ def PHintValues : GenericEnum {
 def PHintsList : GenericTable {
   let FilterClass = "PHint";
   let Fields = ["Name", "Encoding", "Requires"];
+
+  let PrimaryKey = ["Encoding"];
+  let PrimaryKeyName = "lookupPHintByEncoding";
 }
 
 def lookupPHintByName : SearchIndex {
@@ -2389,11 +2358,6 @@ def lookupPHintByName : SearchIndex {
   let Key = ["Name"];
 }
 
-def lookupPHintByEncoding : SearchIndex {
-  let Table = PHintsList;
-  let Key = ["Encoding"];
-}
-
 let Requires = [{ {AArch64::FeaturePCDPHINT} }] in {
   def KEEP : PHint<0b00, 0b000, 0b0000, 0b0000, 0b000, "keep">;
   def STRM : PHint<0b00, 0b000, 0b0000, 0b0000, 0b001, "strm">;


        


More information about the llvm-commits mailing list