forked from OSchip/llvm-project
AMDGPU/SI: Pass whether to use the SI scheduler via Target Attribute
Summary: Currently the SI scheduler can be selected via command line option, but it turned out it would be better if it was selectable via a Target Attribute. This patch adds "si-scheduler" attribute to the backend. Reviewers: tstellarAMD, echristo Subscribers: echristo, arsenm Differential Revision: http://reviews.llvm.org/D16192 llvm-svn: 258386
This commit is contained in:
parent
90f76fbb54
commit
de008d338c
|
@ -144,6 +144,11 @@ def FeatureEnableHugeScratchBuffer : SubtargetFeature<"huge-scratch-buffer",
|
|||
"true",
|
||||
"Enable scratch buffer sizes greater than 128 GB">;
|
||||
|
||||
def FeatureEnableSIScheduler : SubtargetFeature<"si-scheduler",
|
||||
"EnableSIScheduler",
|
||||
"true",
|
||||
"Enable SI Machine Scheduler">;
|
||||
|
||||
class SubtargetFeatureFetchLimit <string Value> :
|
||||
SubtargetFeature <"fetch"#Value,
|
||||
"TexVTXClauseSize",
|
||||
|
|
|
@ -81,7 +81,7 @@ AMDGPUSubtarget::AMDGPUSubtarget(const Triple &TT, StringRef GPU, StringRef FS,
|
|||
EnableVGPRSpilling(false), SGPRInitBug(false), IsGCN(false),
|
||||
GCN1Encoding(false), GCN3Encoding(false), CIInsts(false), LDSBankCount(0),
|
||||
IsaVersion(ISAVersion0_0_0), EnableHugeScratchBuffer(false),
|
||||
FrameLowering(nullptr),
|
||||
EnableSIScheduler(false), FrameLowering(nullptr),
|
||||
InstrItins(getInstrItineraryForCPU(GPU)), TargetTriple(TT) {
|
||||
|
||||
initializeSubtargetDependencies(TT, GPU, FS);
|
||||
|
|
|
@ -92,6 +92,7 @@ private:
|
|||
int LDSBankCount;
|
||||
unsigned IsaVersion;
|
||||
bool EnableHugeScratchBuffer;
|
||||
bool EnableSIScheduler;
|
||||
|
||||
std::unique_ptr<AMDGPUFrameLowering> FrameLowering;
|
||||
std::unique_ptr<AMDGPUTargetLowering> TLInfo;
|
||||
|
@ -286,6 +287,10 @@ public:
|
|||
return EnableHugeScratchBuffer;
|
||||
}
|
||||
|
||||
bool enableSIScheduler() const {
|
||||
return EnableSIScheduler;
|
||||
}
|
||||
|
||||
bool dumpCode() const {
|
||||
return DumpCode;
|
||||
}
|
||||
|
|
|
@ -148,6 +148,8 @@ public:
|
|||
const AMDGPUSubtarget &ST = *getAMDGPUTargetMachine().getSubtargetImpl();
|
||||
if (ST.getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS)
|
||||
return createR600MachineScheduler(C);
|
||||
else if (ST.enableSIScheduler())
|
||||
return createSIMachineScheduler(C);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue