[llvm] [RISCV] Add `TuneVentanaVeyron` subtarget feature. (PR #70414)

Mikhail Gudim via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 12:03:15 PDT 2023


https://github.com/mgudim updated https://github.com/llvm/llvm-project/pull/70414

>From 6fda36048de1d1ceb7e55e56c95466192f29db59 Mon Sep 17 00:00:00 2001
From: Mikhail Gudim <mgudim at gmail.com>
Date: Thu, 26 Oct 2023 22:30:01 -0400
Subject: [PATCH 1/3] [RISCV] Add `TuneVentanaVeyron` subtarget feature.

This will be used to add veyron fusions in a later commit.
---
 llvm/lib/Target/RISCV/RISCVFeatures.td   | 4 ++++
 llvm/lib/Target/RISCV/RISCVProcessors.td | 3 ++-
 llvm/lib/Target/RISCV/RISCVSubtarget.h   | 5 +----
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/llvm/lib/Target/RISCV/RISCVFeatures.td b/llvm/lib/Target/RISCV/RISCVFeatures.td
index 979bc0ea8c7d065..ba6c63d8958e647 100644
--- a/llvm/lib/Target/RISCV/RISCVFeatures.td
+++ b/llvm/lib/Target/RISCV/RISCVFeatures.td
@@ -954,6 +954,10 @@ def TuneSiFive7 : SubtargetFeature<"sifive7", "RISCVProcFamily", "SiFive7",
                                    [TuneNoDefaultUnroll,
                                     TuneShortForwardBranchOpt]>;
 
+def TuneVentanaVeyron : SubtargetFeature<"ventana-veyron", "RISCVProcFamily", "VentanaVeyron",
+                                         "Ventana-Veyron Series processors",
+                                         [TuneLUIADDIFusion]>;
+
 // Assume that lock-free native-width atomics are available, even if the target
 // and operating system combination would not usually provide them. The user
 // is responsible for providing any necessary __sync implementations. Code
diff --git a/llvm/lib/Target/RISCV/RISCVProcessors.td b/llvm/lib/Target/RISCV/RISCVProcessors.td
index e4008d145ffa572..5465e0c998ca6f8 100644
--- a/llvm/lib/Target/RISCV/RISCVProcessors.td
+++ b/llvm/lib/Target/RISCV/RISCVProcessors.td
@@ -242,4 +242,5 @@ def VENTANA_VEYRON_V1 : RISCVProcessorModel<"veyron-v1",
                                              FeatureStdExtZicbom,
                                              FeatureStdExtZicbop,
                                              FeatureStdExtZicboz,
-                                             FeatureVendorXVentanaCondOps]>;
+                                             FeatureVendorXVentanaCondOps],
+                                             [TuneVentanaVeyron]>;
diff --git a/llvm/lib/Target/RISCV/RISCVSubtarget.h b/llvm/lib/Target/RISCV/RISCVSubtarget.h
index 6b915e61c136086..4e84d7932c61c41 100644
--- a/llvm/lib/Target/RISCV/RISCVSubtarget.h
+++ b/llvm/lib/Target/RISCV/RISCVSubtarget.h
@@ -46,10 +46,7 @@ struct RISCVTuneInfo {
 
 class RISCVSubtarget : public RISCVGenSubtargetInfo {
 public:
-  enum RISCVProcFamilyEnum : uint8_t {
-    Others,
-    SiFive7,
-  };
+  enum RISCVProcFamilyEnum : uint8_t { Others, SiFive7, VentanaVeyron };
 
 private:
   virtual void anchor();

>From 33fee70bc867ec8039e2bc393834c2354b773c28 Mon Sep 17 00:00:00 2001
From: Mikhail Gudim <mgudim at gmail.com>
Date: Fri, 27 Oct 2023 16:09:29 -0400
Subject: [PATCH 2/3] Turned off clang-format for RISCVProcFamilyEnum.

---
 llvm/lib/Target/RISCV/RISCVSubtarget.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/RISCV/RISCVSubtarget.h b/llvm/lib/Target/RISCV/RISCVSubtarget.h
index 4e84d7932c61c41..ff216991837555f 100644
--- a/llvm/lib/Target/RISCV/RISCVSubtarget.h
+++ b/llvm/lib/Target/RISCV/RISCVSubtarget.h
@@ -46,8 +46,13 @@ struct RISCVTuneInfo {
 
 class RISCVSubtarget : public RISCVGenSubtargetInfo {
 public:
-  enum RISCVProcFamilyEnum : uint8_t { Others, SiFive7, VentanaVeyron };
-
+  // clang-format off
+  enum RISCVProcFamilyEnum : uint8_t {
+    Others,
+    SiFive7,
+    VentanaVeyron
+  };
+  // clang-format on
 private:
   virtual void anchor();
 

>From 874568edaad553ab8df83300875a4f5f66a276eb Mon Sep 17 00:00:00 2001
From: Mikhail Gudim <mgudim at gmail.com>
Date: Mon, 30 Oct 2023 15:01:28 -0400
Subject: [PATCH 3/3] added a trailing comma in `RISCVProcFamilyEnum`.

---
 llvm/lib/Target/RISCV/RISCVSubtarget.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/RISCV/RISCVSubtarget.h b/llvm/lib/Target/RISCV/RISCVSubtarget.h
index ff216991837555f..f8fab7601406819 100644
--- a/llvm/lib/Target/RISCV/RISCVSubtarget.h
+++ b/llvm/lib/Target/RISCV/RISCVSubtarget.h
@@ -50,7 +50,7 @@ class RISCVSubtarget : public RISCVGenSubtargetInfo {
   enum RISCVProcFamilyEnum : uint8_t {
     Others,
     SiFive7,
-    VentanaVeyron
+    VentanaVeyron,
   };
   // clang-format on
 private:



More information about the llvm-commits mailing list