[llvm] [RISCV] Add searchable table for tune information (PR #66193)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 07:29:05 PDT 2023


================
@@ -10,20 +10,36 @@
 // RISC-V processors supported.
 //===----------------------------------------------------------------------===//
 
+class RISCVTuneInfo {
+  bits<8> PrefFunctionAlignment = 1;
+  bits<8> PrefLoopAlignment = 1;
+}
+
+def RISCVTuneInfoTable : GenericTable {
+  let FilterClass = "RISCVTuneInfo";
+  let CppTypeName = "RISCVTuneInfo";
+  let Fields = ["Name", "PrefFunctionAlignment", "PrefLoopAlignment"];
+}
+
+def getRISCVTuneInfo : SearchIndex {
+  let Table = RISCVTuneInfoTable;
+  let Key = ["Name"];
+}
+
 class RISCVProcessorModel<string n,
                           SchedMachineModel m,
                           list<SubtargetFeature> f,
                           list<SubtargetFeature> tunef = [],
                           string default_march = "">
-      :  ProcessorModel<n, m, f, tunef> {
+      :  ProcessorModel<n, m, f, tunef>, RISCVTuneInfo {
----------------
michaelmaitland wrote:

Should `RISCVTuneInfo` be an optional argument to `ProcessorModel`? Should `RISCVTuneInfo` be an optional argument to `RISCVProcessorModel`?

If we organize it like this, it becomes more clear to clients of `ProcessorModel` and `RISCVProcessorModel` that they have the ability to specify these tunings.

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


More information about the llvm-commits mailing list