Skip to content

Commit 73a42dd

Browse files
committed
[AArch64] Initial sched model for Neoverse V3, V3AE
Add the scheduling models for Neoverse V3 and Neoverse V3AE based on information taken from the V3 Software Optimization guide: https://developer.arm.com/documentation/109678/300/?lang=en and on information taken from the V3AE Software Optimization guide: https://developer.arm.com/documentation/109703/300/?lang=en Implements #134977 Change-Id: Ica2d4c5d869553508feeee17acb4feec68f39aba
1 parent 30c27a4 commit 73a42dd

File tree

4 files changed

+288
-280
lines changed

4 files changed

+288
-280
lines changed

llvm/lib/Target/AArch64/AArch64SchedNeoverseV3.td

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def V3Write_0c : SchedWriteRes<[]> { let Latency = 0; }
9999
// Define generic 1 micro-op types
100100

101101
def V3Write_1c_1B : SchedWriteRes<[V3UnitB]> { let Latency = 1; }
102-
def V3Write_1c_1I_1Flg : SchedWriteRes<[V3UnitI, V3UnitFlg]> { let Latency = 1; }
102+
def V3Write_1c_1F_1Flg : SchedWriteRes<[V3UnitI, V3UnitFlg]> { let Latency = 1; }
103103
def V3Write_1c_1I : SchedWriteRes<[V3UnitI]> { let Latency = 1; }
104104
def V3Write_1c_1M : SchedWriteRes<[V3UnitM]> { let Latency = 1; }
105105
def V3Write_1c_1SA : SchedWriteRes<[V3UnitSA]> { let Latency = 1; }
@@ -851,8 +851,12 @@ def V3Write_ArithI : SchedWriteVariant<[
851851
SchedVar<IsCheapLSL, [V3Write_1c_1I]>,
852852
SchedVar<NoSchedPred, [V3Write_2c_1M]>]>;
853853

854+
def V3Write_ArithF : SchedWriteVariant<[
855+
SchedVar<IsCheapLSL, [V3Write_1c_1F_1Flg]>,
856+
SchedVar<NoSchedPred, [V3Write_2c_1M_1Flg]>]>;
857+
854858
def V3Write_Logical : SchedWriteVariant<[
855-
SchedVar<NeoverseNoLSL, [V3Write_1c_1I_1Flg]>,
859+
SchedVar<NeoverseNoLSL, [V3Write_1c_1F_1Flg]>,
856860
SchedVar<NoSchedPred, [V3Write_2c_1M_1Flg]>]>;
857861

858862
def V3Write_Extr : SchedWriteVariant<[
@@ -1046,7 +1050,7 @@ def : InstRW<[V3Write_1c_1B_1S], (instrs BL, BLR)>;
10461050
def : SchedAlias<WriteI, V3Write_1c_1I>;
10471051

10481052
// ALU, basic, flagset
1049-
def : InstRW<[V3Write_1c_1I_1Flg],
1053+
def : InstRW<[V3Write_1c_1F_1Flg],
10501054
(instregex "^(ADD|SUB)S[WX]r[ir]$",
10511055
"^(ADC|SBC)S[WX]r$",
10521056
"^ANDS[WX]ri$",
@@ -1060,14 +1064,14 @@ def : SchedAlias<WriteIEReg, V3Write_2c_1M>;
10601064
// Arithmetic, flagset, LSL shift, shift <= 4
10611065
// Arithmetic, LSR/ASR/ROR shift or LSL shift > 4
10621066
def : SchedAlias<WriteISReg, V3Write_ArithI>;
1063-
def : InstRW<[V3Write_ArithI],
1067+
def : InstRW<[V3Write_ArithF],
10641068
(instregex "^(ADD|SUB)S[WX]rs$")>;
10651069

10661070
// Arithmetic, immediate to logical address tag
10671071
def : InstRW<[V3Write_2c_1M], (instrs ADDG, SUBG)>;
10681072

10691073
// Conditional compare
1070-
def : InstRW<[V3Write_1c_1I_1Flg], (instregex "^CCM[NP][WX][ir]")>;
1074+
def : InstRW<[V3Write_1c_1F_1Flg], (instregex "^CCM[NP][WX][ir]")>;
10711075

10721076
// Convert floating-point condition flags
10731077
// Flag manipulation instructions
@@ -1081,7 +1085,7 @@ def : InstRW<[V3Write_2c_1M], (instrs IRG, IRGstack)>;
10811085
def : InstRW<[V3Write_1c_1I], (instrs GMI, SUBP)>;
10821086

10831087
// Subtract Pointer, flagset
1084-
def : InstRW<[V3Write_1c_1I_1Flg], (instrs SUBPS)>;
1088+
def : InstRW<[V3Write_1c_1F_1Flg], (instrs SUBPS)>;
10851089

10861090
// Logical, shift, no flagset
10871091
def : InstRW<[V3Write_1c_1I], (instregex "^(AND|BIC|EON|EOR|ORN)[WX]rs$")>;

llvm/lib/Target/AArch64/AArch64SchedNeoverseV3AE.td

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def V3AEWrite_0c : SchedWriteRes<[]> { let Latency = 0; }
9494
// Define generic 1 micro-op types
9595

9696
def V3AEWrite_1c_1B : SchedWriteRes<[V3AEUnitB]> { let Latency = 1; }
97-
def V3AEWrite_1c_1I_1Flg : SchedWriteRes<[V3AEUnitI, V3AEUnitFlg]> { let Latency = 1; }
97+
def V3AEWrite_1c_1F_1Flg : SchedWriteRes<[V3AEUnitI, V3AEUnitFlg]> { let Latency = 1; }
9898
def V3AEWrite_1c_1I : SchedWriteRes<[V3AEUnitI]> { let Latency = 1; }
9999
def V3AEWrite_1c_1M : SchedWriteRes<[V3AEUnitM]> { let Latency = 1; }
100100
def V3AEWrite_1c_1SA : SchedWriteRes<[V3AEUnitSA]> { let Latency = 1; }
@@ -780,8 +780,12 @@ def V3AEWrite_ArithI : SchedWriteVariant<[
780780
SchedVar<IsCheapLSL, [V3AEWrite_1c_1I]>,
781781
SchedVar<NoSchedPred, [V3AEWrite_2c_1M]>]>;
782782

783+
def V3AEWrite_ArithF : SchedWriteVariant<[
784+
SchedVar<IsCheapLSL, [V3AEWrite_1c_1F_1Flg]>,
785+
SchedVar<NoSchedPred, [V3AEWrite_2c_1M_1Flg]>]>;
786+
783787
def V3AEWrite_Logical : SchedWriteVariant<[
784-
SchedVar<NeoverseNoLSL, [V3AEWrite_1c_1I_1Flg]>,
788+
SchedVar<NeoverseNoLSL, [V3AEWrite_1c_1F_1Flg]>,
785789
SchedVar<NoSchedPred, [V3AEWrite_2c_1M_1Flg]>]>;
786790

787791
def V3AEWrite_Extr : SchedWriteVariant<[
@@ -975,7 +979,7 @@ def : InstRW<[V3AEWrite_1c_1B_1S], (instrs BL, BLR)>;
975979
def : SchedAlias<WriteI, V3AEWrite_1c_1I>;
976980

977981
// ALU, basic, flagset
978-
def : InstRW<[V3AEWrite_1c_1I_1Flg],
982+
def : InstRW<[V3AEWrite_1c_1F_1Flg],
979983
(instregex "^(ADD|SUB)S[WX]r[ir]$",
980984
"^(ADC|SBC)S[WX]r$",
981985
"^ANDS[WX]ri$",
@@ -989,14 +993,14 @@ def : SchedAlias<WriteIEReg, V3AEWrite_2c_1M>;
989993
// Arithmetic, flagset, LSL shift, shift <= 4
990994
// Arithmetic, LSR/ASR/ROR shift or LSL shift > 4
991995
def : SchedAlias<WriteISReg, V3AEWrite_ArithI>;
992-
def : InstRW<[V3AEWrite_ArithI],
996+
def : InstRW<[V3AEWrite_ArithF],
993997
(instregex "^(ADD|SUB)S[WX]rs$")>;
994998

995999
// Arithmetic, immediate to logical address tag
9961000
def : InstRW<[V3AEWrite_2c_1M], (instrs ADDG, SUBG)>;
9971001

9981002
// Conditional compare
999-
def : InstRW<[V3AEWrite_1c_1I_1Flg], (instregex "^CCM[NP][WX][ir]")>;
1003+
def : InstRW<[V3AEWrite_1c_1F_1Flg], (instregex "^CCM[NP][WX][ir]")>;
10001004

10011005
// Convert floating-point condition flags
10021006
// Flag manipulation instructions
@@ -1010,7 +1014,7 @@ def : InstRW<[V3AEWrite_2c_1M], (instrs IRG, IRGstack)>;
10101014
def : InstRW<[V3AEWrite_1c_1I], (instrs GMI, SUBP)>;
10111015

10121016
// Subtract Pointer, flagset
1013-
def : InstRW<[V3AEWrite_1c_1I_1Flg], (instrs SUBPS)>;
1017+
def : InstRW<[V3AEWrite_1c_1F_1Flg], (instrs SUBPS)>;
10141018

10151019
// Logical, shift, no flagset
10161020
def : InstRW<[V3AEWrite_1c_1I], (instregex "^(AND|BIC|EON|EOR|ORN)[WX]rs$")>;

0 commit comments

Comments
 (0)