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

Mikhail Gudim via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 13:11:09 PDT 2023


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

>From bd53e6f4e308a5895f053412242c8d751c53fa51 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/2] [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 b128d2fa0c7717cde0475b5a0e1401c2e44e0ab5 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/2] 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();
 



More information about the llvm-commits mailing list