Skip to content

Commit

Permalink
[AArch64] Initial sched model for Neoverse N2
Browse files Browse the repository at this point in the history
The optimization guide can be found here:
https://developer.arm.com/documentation/PJDOC-466751330-18256/latest/

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D128631
  • Loading branch information
c-rhodes committed Jul 8, 2022
1 parent 86a2f2e commit 03af9ba
Show file tree
Hide file tree
Showing 22 changed files with 21,390 additions and 18 deletions.
3 changes: 2 additions & 1 deletion llvm/lib/Target/AArch64/AArch64.td
Expand Up @@ -650,6 +650,7 @@ include "AArch64SchedA64FX.td"
include "AArch64SchedThunderX3T110.td"
include "AArch64SchedTSV110.td"
include "AArch64SchedAmpere1.td"
include "AArch64SchedNeoverseN2.td"

def TuneA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
"Cortex-A35 ARM processors">;
Expand Down Expand Up @@ -1151,7 +1152,7 @@ def : ProcessorModel<"neoverse-e1", CortexA53Model,
ProcessorFeatures.NeoverseE1, [TuneNeoverseE1]>;
def : ProcessorModel<"neoverse-n1", CortexA57Model,
ProcessorFeatures.NeoverseN1, [TuneNeoverseN1]>;
def : ProcessorModel<"neoverse-n2", CortexA57Model,
def : ProcessorModel<"neoverse-n2", NeoverseN2Model,
ProcessorFeatures.NeoverseN2, [TuneNeoverseN2]>;
def : ProcessorModel<"neoverse-512tvb", CortexA57Model,
ProcessorFeatures.Neoverse512TVB, [TuneNeoverse512TVB]>;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AArch64/AArch64InstrFormats.td
Expand Up @@ -1505,7 +1505,7 @@ class CRmSystemI<Operand crmtype, bits<3> opc, string asm,

class SystemNoOperands<bits<3> op2, string asm, list<dag> pattern = []>
: SimpleSystemI<0, (ins), asm, "", pattern>,
Sched<[]> {
Sched<[WriteHint]> {
bits<4> CRm;
let CRm = 0b0011;
let Inst{31-12} = 0b11010101000000110010;
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Target/AArch64/AArch64SchedA53.td
Expand Up @@ -28,7 +28,8 @@ def CortexA53Model : SchedMachineModel {

list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
PAUnsupported.F,
SMEUnsupported.F);
SMEUnsupported.F,
[HasMTE]);
}


Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AArch64/AArch64SchedA55.td
Expand Up @@ -29,7 +29,7 @@ def CortexA55Model : SchedMachineModel {
let PostRAScheduler = 1; // Enable PostRA scheduler pass.
let CompleteModel = 0; // Covers instructions applicable to Cortex-A55.

list<Predicate> UnsupportedFeatures = [HasSVE];
list<Predicate> UnsupportedFeatures = [HasSVE, HasMTE];

// FIXME: Remove when all errors have been fixed.
let FullInstRWOverlapCheck = 0;
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Target/AArch64/AArch64SchedA57.td
Expand Up @@ -33,7 +33,8 @@ def CortexA57Model : SchedMachineModel {

list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
PAUnsupported.F,
SMEUnsupported.F);
SMEUnsupported.F,
[HasMTE]);
}

//===----------------------------------------------------------------------===//
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AArch64/AArch64SchedA64FX.td
Expand Up @@ -18,11 +18,11 @@ def A64FXModel : SchedMachineModel {
// Determined via a mix of micro-arch details and experimentation.
let LoopMicroOpBufferSize = 128;
let PostRAScheduler = 1; // Using PostRA sched.
let CompleteModel = 1;
let CompleteModel = 0;

list<Predicate> UnsupportedFeatures =
[HasSVE2, HasSVE2AES, HasSVE2SM4, HasSVE2SHA3, HasSVE2BitPerm, HasPAuth,
HasSVE2orSME];
HasSVE2orSME, HasMTE, HasMatMulInt8, HasBF16];

let FullInstRWOverlapCheck = 0;
}
Expand Down
4 changes: 3 additions & 1 deletion llvm/lib/Target/AArch64/AArch64SchedAmpere1.td
Expand Up @@ -25,7 +25,9 @@ def Ampere1Model : SchedMachineModel {
let CompleteModel = 1;

list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
SMEUnsupported.F);
SMEUnsupported.F,
PAUnsupported.F,
[HasMTE]);
}

let SchedModel = Ampere1Model in {
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Target/AArch64/AArch64SchedCyclone.td
Expand Up @@ -20,7 +20,8 @@ def CycloneModel : SchedMachineModel {

list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
PAUnsupported.F,
SMEUnsupported.F);
SMEUnsupported.F,
[HasMTE]);
}

//===----------------------------------------------------------------------===//
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Target/AArch64/AArch64SchedExynosM3.td
Expand Up @@ -26,7 +26,8 @@ def ExynosM3Model : SchedMachineModel {

list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
PAUnsupported.F,
SMEUnsupported.F);
SMEUnsupported.F,
[HasMTE]);
}

//===----------------------------------------------------------------------===//
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Target/AArch64/AArch64SchedExynosM4.td
Expand Up @@ -26,7 +26,8 @@ def ExynosM4Model : SchedMachineModel {

list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
PAUnsupported.F,
SMEUnsupported.F);
SMEUnsupported.F,
[HasMTE]);
}

//===----------------------------------------------------------------------===//
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Target/AArch64/AArch64SchedExynosM5.td
Expand Up @@ -26,7 +26,8 @@ def ExynosM5Model : SchedMachineModel {

list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
PAUnsupported.F,
SMEUnsupported.F);
SMEUnsupported.F,
[HasMTE]);
}

//===----------------------------------------------------------------------===//
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Target/AArch64/AArch64SchedFalkor.td
Expand Up @@ -25,7 +25,8 @@ def FalkorModel : SchedMachineModel {

list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
PAUnsupported.F,
SMEUnsupported.F);
SMEUnsupported.F,
[HasMTE]);
// FIXME: Remove when all errors have been fixed.
let FullInstRWOverlapCheck = 0;
}
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Target/AArch64/AArch64SchedKryo.td
Expand Up @@ -29,7 +29,8 @@ def KryoModel : SchedMachineModel {

list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
PAUnsupported.F,
SMEUnsupported.F);
SMEUnsupported.F,
[HasMTE]);
// FIXME: Remove when all errors have been fixed.
let FullInstRWOverlapCheck = 0;
}
Expand Down

0 comments on commit 03af9ba

Please sign in to comment.