Skip to content

Commit 483d196

Browse files
authored
[RISCV] Add tune features for Andes 45 series cpus (#143899)
Add tune features TuneNoDefaultUnroll, TuneShortForwardBranchOpt and TunePostRAScheduler for Andes 45 series cpus.
1 parent f64b3bb commit 483d196

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,9 @@ def TuneSiFive7 : SubtargetFeature<"sifive7", "RISCVProcFamily", "SiFive7",
17421742
def TuneVentanaVeyron : SubtargetFeature<"ventana-veyron", "RISCVProcFamily", "VentanaVeyron",
17431743
"Ventana Veyron-Series processors">;
17441744

1745+
def TuneAndes45 : SubtargetFeature<"andes45", "RISCVProcFamily", "Andes45",
1746+
"Andes 45-Series processors">;
1747+
17451748
def TuneVXRMPipelineFlush : SubtargetFeature<"vxrm-pipeline-flush", "HasVXRMPipelineFlush",
17461749
"true", "VXRM writes causes pipeline flush">;
17471750

llvm/lib/Target/RISCV/RISCVProcessors.td

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,13 @@ def ANDES_AX25 : RISCVProcessorModel<"andes-ax25",
722722
FeatureStdExtZbc,
723723
FeatureVendorXAndesPerf]>;
724724

725+
defvar Andes45TuneFeatures = [TuneAndes45,
726+
TuneNoDefaultUnroll,
727+
TuneShortForwardBranchOpt,
728+
TunePostRAScheduler];
729+
725730
def ANDES_45 : RISCVTuneProcessorModel<"andes-45-series",
726-
Andes45Model>;
731+
Andes45Model, Andes45TuneFeatures>;
727732

728733
def ANDES_N45 : RISCVProcessorModel<"andes-n45",
729734
Andes45Model,
@@ -737,7 +742,8 @@ def ANDES_N45 : RISCVProcessorModel<"andes-n45",
737742
FeatureStdExtD,
738743
FeatureStdExtC,
739744
FeatureStdExtB,
740-
FeatureVendorXAndesPerf]>;
745+
FeatureVendorXAndesPerf],
746+
Andes45TuneFeatures>;
741747

742748
def ANDES_NX45 : RISCVProcessorModel<"andes-nx45",
743749
Andes45Model,
@@ -751,7 +757,8 @@ def ANDES_NX45 : RISCVProcessorModel<"andes-nx45",
751757
FeatureStdExtD,
752758
FeatureStdExtC,
753759
FeatureStdExtB,
754-
FeatureVendorXAndesPerf]>;
760+
FeatureVendorXAndesPerf],
761+
Andes45TuneFeatures>;
755762

756763
def ANDES_A45 : RISCVProcessorModel<"andes-a45",
757764
Andes45Model,
@@ -765,7 +772,8 @@ def ANDES_A45 : RISCVProcessorModel<"andes-a45",
765772
FeatureStdExtD,
766773
FeatureStdExtC,
767774
FeatureStdExtB,
768-
FeatureVendorXAndesPerf]>;
775+
FeatureVendorXAndesPerf],
776+
Andes45TuneFeatures>;
769777

770778
def ANDES_AX45 : RISCVProcessorModel<"andes-ax45",
771779
Andes45Model,
@@ -779,4 +787,5 @@ def ANDES_AX45 : RISCVProcessorModel<"andes-ax45",
779787
FeatureStdExtD,
780788
FeatureStdExtC,
781789
FeatureStdExtB,
782-
FeatureVendorXAndesPerf]>;
790+
FeatureVendorXAndesPerf],
791+
Andes45TuneFeatures>;

llvm/lib/Target/RISCV/RISCVSubtarget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class RISCVSubtarget : public RISCVGenSubtargetInfo {
8383
SiFive7,
8484
VentanaVeyron,
8585
MIPSP8700,
86+
Andes45,
8687
};
8788
enum RISCVVRGatherCostModelEnum : uint8_t {
8889
Quadratic,

llvm/test/CodeGen/RISCV/features-info.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
; CHECK-NEXT: 32bit - Implements RV32.
77
; CHECK-NEXT: 64bit - Implements RV64.
88
; CHECK-NEXT: a - 'A' (Atomic Instructions).
9+
; CHECK-NEXT: andes45 - Andes 45-Series processors.
910
; CHECK-NEXT: auipc-addi-fusion - Enable AUIPC+ADDI macrofusion.
1011
; CHECK-NEXT: b - 'B' (the collection of the Zba, Zbb, Zbs extensions).
1112
; CHECK-NEXT: c - 'C' (Compressed Instructions).

0 commit comments

Comments
 (0)