mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-31 01:15:36 +00:00
4a5c408c28
Summary: GCNSchedStrategy re-uses most of GenericScheduler, it's just uses a different method to compute the excess and critical register pressure limits. It's not enabled by default, to enable it you need to pass -misched=gcn to llc. Shader DB stats: 32464 shaders in 17874 tests Totals: SGPRS: 1542846 -> 1643125 (6.50 %) VGPRS: 1005595 -> 904653 (-10.04 %) Spilled SGPRs: 29929 -> 27745 (-7.30 %) Spilled VGPRs: 334 -> 352 (5.39 %) Scratch VGPRs: 1612 -> 1624 (0.74 %) dwords per thread Code Size: 36688188 -> 37034900 (0.95 %) bytes LDS: 1913 -> 1913 (0.00 %) blocks Max Waves: 254101 -> 265125 (4.34 %) Wait states: 0 -> 0 (0.00 %) Totals from affected shaders: SGPRS: 1338220 -> 1438499 (7.49 %) VGPRS: 886221 -> 785279 (-11.39 %) Spilled SGPRs: 29869 -> 27685 (-7.31 %) Spilled VGPRs: 334 -> 352 (5.39 %) Scratch VGPRs: 1612 -> 1624 (0.74 %) dwords per thread Code Size: 34315716 -> 34662428 (1.01 %) bytes LDS: 1551 -> 1551 (0.00 %) blocks Max Waves: 188127 -> 199151 (5.86 %) Wait states: 0 -> 0 (0.00 %) Reviewers: arsenm, mareko, nhaehnle, MatzeB, atrick Subscribers: arsenm, kzhuravl, llvm-commits Differential Revision: https://reviews.llvm.org/D23688 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279995 91177308-0d34-0410-b5e6-96231b3b80d8
139 lines
4.1 KiB
TableGen
139 lines
4.1 KiB
TableGen
//===-- SISchedule.td - SI Scheduling definitons -------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// MachineModel definitions for Southern Islands (SI)
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
def : PredicateProlog<[{
|
|
const SIInstrInfo *TII =
|
|
static_cast<const SIInstrInfo*>(SchedModel->getInstrInfo());
|
|
(void)TII;
|
|
}]>;
|
|
|
|
def WriteBranch : SchedWrite;
|
|
def WriteExport : SchedWrite;
|
|
def WriteLDS : SchedWrite;
|
|
def WriteSALU : SchedWrite;
|
|
def WriteSMEM : SchedWrite;
|
|
def WriteVMEM : SchedWrite;
|
|
def WriteBarrier : SchedWrite;
|
|
|
|
// Vector ALU instructions
|
|
def Write32Bit : SchedWrite;
|
|
def WriteQuarterRate32 : SchedWrite;
|
|
def WriteFullOrQuarterRate32 : SchedWrite;
|
|
|
|
def WriteFloatFMA : SchedWrite;
|
|
|
|
// Slow quarter rate f64 instruction.
|
|
def WriteDouble : SchedWrite;
|
|
|
|
// half rate f64 instruction (same as v_add_f64)
|
|
def WriteDoubleAdd : SchedWrite;
|
|
|
|
// Half rate 64-bit instructions.
|
|
def Write64Bit : SchedWrite;
|
|
|
|
// FIXME: Should there be a class for instructions which are VALU
|
|
// instructions and have VALU rates, but write to the SALU (i.e. VOPC
|
|
// instructions)
|
|
|
|
class SISchedMachineModel : SchedMachineModel {
|
|
let CompleteModel = 1;
|
|
// MicroOpBufferSize = 1 means that instructions will always be added
|
|
// the ready queue when they become available. This exposes them
|
|
// to the register pressure analysis.
|
|
let MicroOpBufferSize = 1;
|
|
let IssueWidth = 1;
|
|
let PostRAScheduler = 1;
|
|
}
|
|
|
|
def SIFullSpeedModel : SISchedMachineModel;
|
|
def SIQuarterSpeedModel : SISchedMachineModel;
|
|
|
|
// XXX: Are the resource counts correct?
|
|
def HWBranch : ProcResource<1> {
|
|
let BufferSize = 1;
|
|
}
|
|
def HWExport : ProcResource<1> {
|
|
let BufferSize = 7; // Taken from S_WAITCNT
|
|
}
|
|
def HWLGKM : ProcResource<1> {
|
|
let BufferSize = 31; // Taken from S_WAITCNT
|
|
}
|
|
def HWSALU : ProcResource<1> {
|
|
let BufferSize = 1;
|
|
}
|
|
def HWVMEM : ProcResource<1> {
|
|
let BufferSize = 15; // Taken from S_WAITCNT
|
|
}
|
|
def HWVALU : ProcResource<1> {
|
|
let BufferSize = 1;
|
|
}
|
|
|
|
class HWWriteRes<SchedWrite write, list<ProcResourceKind> resources,
|
|
int latency> : WriteRes<write, resources> {
|
|
let Latency = latency;
|
|
}
|
|
|
|
class HWVALUWriteRes<SchedWrite write, int latency> :
|
|
HWWriteRes<write, [HWVALU], latency>;
|
|
|
|
|
|
// The latency numbers are taken from AMD Accelerated Parallel Processing
|
|
// guide. They may not be accurate.
|
|
|
|
// The latency values are 1 / (operations / cycle) / 4.
|
|
multiclass SICommonWriteRes {
|
|
|
|
def : HWWriteRes<WriteBranch, [HWBranch], 8>;
|
|
def : HWWriteRes<WriteExport, [HWExport], 4>;
|
|
def : HWWriteRes<WriteLDS, [HWLGKM], 5>; // Can be between 2 and 64
|
|
def : HWWriteRes<WriteSALU, [HWSALU], 1>;
|
|
def : HWWriteRes<WriteSMEM, [HWLGKM], 5>;
|
|
def : HWWriteRes<WriteVMEM, [HWVMEM], 80>;
|
|
def : HWWriteRes<WriteBarrier, [HWBranch], 500>; // XXX: Guessed ???
|
|
|
|
def : HWVALUWriteRes<Write32Bit, 1>;
|
|
def : HWVALUWriteRes<Write64Bit, 2>;
|
|
def : HWVALUWriteRes<WriteQuarterRate32, 4>;
|
|
}
|
|
|
|
def PredIsVGPR32Copy : SchedPredicate<[{TII->isVGPRCopy(*MI) && TII->getOpSize(*MI, 0) <= 32}]>;
|
|
def PredIsVGPR64Copy : SchedPredicate<[{TII->isVGPRCopy(*MI) && TII->getOpSize(*MI, 0) > 32}]>;
|
|
def WriteCopy : SchedWriteVariant<[
|
|
SchedVar<PredIsVGPR32Copy, [Write32Bit]>,
|
|
SchedVar<PredIsVGPR64Copy, [Write64Bit]>,
|
|
SchedVar<NoSchedPred, [WriteSALU]>]>;
|
|
|
|
let SchedModel = SIFullSpeedModel in {
|
|
|
|
defm : SICommonWriteRes;
|
|
|
|
def : HWVALUWriteRes<WriteFloatFMA, 1>;
|
|
def : HWVALUWriteRes<WriteDouble, 4>;
|
|
def : HWVALUWriteRes<WriteDoubleAdd, 2>;
|
|
|
|
def : InstRW<[WriteCopy], (instrs COPY)>;
|
|
|
|
} // End SchedModel = SIFullSpeedModel
|
|
|
|
let SchedModel = SIQuarterSpeedModel in {
|
|
|
|
defm : SICommonWriteRes;
|
|
|
|
def : HWVALUWriteRes<WriteFloatFMA, 16>;
|
|
def : HWVALUWriteRes<WriteDouble, 16>;
|
|
def : HWVALUWriteRes<WriteDoubleAdd, 8>;
|
|
|
|
def : InstRW<[WriteCopy], (instrs COPY)>;
|
|
|
|
} // End SchedModel = SIQuarterSpeedModel
|