[llvm] [RISCV] Remove feature implication from TuneSiFive7. (PR #100694)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 25 22:26:57 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-risc-v
Author: Craig Topper (topperc)
<details>
<summary>Changes</summary>
Add all the implied feature directly to the SiFive7 CPUs tuning feature list instead.
The implication is dangerous because explicitly disalbing any of the implied features through the command line would also clear the SiFive7 feature bit.
---
Full diff: https://github.com/llvm/llvm-project/pull/100694.diff
2 Files Affected:
- (modified) llvm/lib/Target/RISCV/RISCVFeatures.td (+1-3)
- (modified) llvm/lib/Target/RISCV/RISCVProcessors.td (+11-9)
``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVFeatures.td b/llvm/lib/Target/RISCV/RISCVFeatures.td
index 3c868dbbf8b3a..2da03d81d9d7a 100644
--- a/llvm/lib/Target/RISCV/RISCVFeatures.td
+++ b/llvm/lib/Target/RISCV/RISCVFeatures.td
@@ -1370,9 +1370,7 @@ def HasConditionalMoveFusion : Predicate<"Subtarget->hasConditionalMoveFusion()"
def NoConditionalMoveFusion : Predicate<"!Subtarget->hasConditionalMoveFusion()">;
def TuneSiFive7 : SubtargetFeature<"sifive7", "RISCVProcFamily", "SiFive7",
- "SiFive 7-Series processors",
- [TuneNoDefaultUnroll,
- TuneShortForwardBranchOpt]>;
+ "SiFive 7-Series processors">;
def TuneVentanaVeyron : SubtargetFeature<"ventana-veyron", "RISCVProcFamily", "VentanaVeyron",
"Ventana Veyron-Series processors">;
diff --git a/llvm/lib/Target/RISCV/RISCVProcessors.td b/llvm/lib/Target/RISCV/RISCVProcessors.td
index 6eed2ae01f646..1729bc0282f51 100644
--- a/llvm/lib/Target/RISCV/RISCVProcessors.td
+++ b/llvm/lib/Target/RISCV/RISCVProcessors.td
@@ -83,9 +83,11 @@ def ROCKET_RV64 : RISCVProcessorModel<"rocket-rv64",
def ROCKET : RISCVTuneProcessorModel<"rocket",
RocketModel>;
+defvar SiFive7TuneFeatures = [TuneSiFive7, TuneNoDefaultUnroll,
+ TuneShortForwardBranchOpt,
+ FeaturePostRAScheduler];
def SIFIVE_7 : RISCVTuneProcessorModel<"sifive-7-series",
- SiFive7Model,
- [TuneSiFive7, FeaturePostRAScheduler]>;
+ SiFive7Model, SiFive7TuneFeatures>;
def SIFIVE_E20 : RISCVProcessorModel<"sifive-e20",
RocketModel,
@@ -145,7 +147,7 @@ def SIFIVE_E76 : RISCVProcessorModel<"sifive-e76",
FeatureStdExtA,
FeatureStdExtF,
FeatureStdExtC],
- [TuneSiFive7, FeaturePostRAScheduler]>;
+ SiFive7TuneFeatures>;
def SIFIVE_S21 : RISCVProcessorModel<"sifive-s21",
RocketModel,
@@ -189,7 +191,7 @@ def SIFIVE_S76 : RISCVProcessorModel<"sifive-s76",
FeatureStdExtD,
FeatureStdExtC,
FeatureStdExtZihintpause],
- [TuneSiFive7, FeaturePostRAScheduler]>;
+ SiFive7TuneFeatures>;
def SIFIVE_U54 : RISCVProcessorModel<"sifive-u54",
RocketModel,
@@ -212,8 +214,11 @@ def SIFIVE_U74 : RISCVProcessorModel<"sifive-u74",
FeatureStdExtF,
FeatureStdExtD,
FeatureStdExtC],
- [TuneSiFive7, FeaturePostRAScheduler]>;
+ SiFive7TuneFeatures>;
+defvar SiFiveX280TuneFeatures = !listconcat(SiFive7TuneFeatures,
+ [TuneDLenFactor2,
+ TuneOptimizedZeroStrideLoad]);
def SIFIVE_X280 : RISCVProcessorModel<"sifive-x280", SiFive7Model,
[Feature64Bit,
FeatureStdExtI,
@@ -229,10 +234,7 @@ def SIFIVE_X280 : RISCVProcessorModel<"sifive-x280", SiFive7Model,
FeatureStdExtZvfh,
FeatureStdExtZba,
FeatureStdExtZbb],
- [TuneSiFive7,
- FeaturePostRAScheduler,
- TuneDLenFactor2,
- TuneOptimizedZeroStrideLoad]>;
+ SiFiveX280TuneFeatures>;
def SIFIVE_P450 : RISCVProcessorModel<"sifive-p450", SiFiveP400Model,
[Feature64Bit,
``````````
</details>
https://github.com/llvm/llvm-project/pull/100694
More information about the llvm-commits
mailing list