forked from OSchip/llvm-project
Grab a subtarget off of an AMDGPUTargetMachine rather than a
bare target machine in preparation for the TargetMachine bare getSubtarget/getSubtargetImpl calls going away. llvm-svn: 232880
This commit is contained in:
parent
c5a85af3b2
commit
8024d030fb
|
@ -118,7 +118,7 @@ public:
|
|||
|
||||
ScheduleDAGInstrs *
|
||||
createMachineScheduler(MachineSchedContext *C) const override {
|
||||
const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
|
||||
const AMDGPUSubtarget &ST = *getAMDGPUTargetMachine().getSubtargetImpl();
|
||||
if (ST.getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS)
|
||||
return createR600MachineScheduler(C);
|
||||
return nullptr;
|
||||
|
@ -174,7 +174,7 @@ void AMDGPUPassConfig::addIRPasses() {
|
|||
}
|
||||
|
||||
void AMDGPUPassConfig::addCodeGenPrepare() {
|
||||
const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
|
||||
const AMDGPUSubtarget &ST = *getAMDGPUTargetMachine().getSubtargetImpl();
|
||||
if (ST.isPromoteAllocaEnabled()) {
|
||||
addPass(createAMDGPUPromoteAlloca(ST));
|
||||
addPass(createSROAPass());
|
||||
|
@ -184,7 +184,7 @@ void AMDGPUPassConfig::addCodeGenPrepare() {
|
|||
|
||||
bool
|
||||
AMDGPUPassConfig::addPreISel() {
|
||||
const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
|
||||
const AMDGPUSubtarget &ST = *getAMDGPUTargetMachine().getSubtargetImpl();
|
||||
addPass(createFlattenCFGPass());
|
||||
if (ST.IsIRStructurizerEnabled())
|
||||
addPass(createStructurizeCFGPass());
|
||||
|
@ -211,7 +211,7 @@ void R600PassConfig::addPreRegAlloc() {
|
|||
}
|
||||
|
||||
void R600PassConfig::addPreSched2() {
|
||||
const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
|
||||
const AMDGPUSubtarget &ST = *getAMDGPUTargetMachine().getSubtargetImpl();
|
||||
addPass(createR600EmitClauseMarkers(), false);
|
||||
if (ST.isIfCvtEnabled())
|
||||
addPass(&IfConverterID, false);
|
||||
|
@ -251,15 +251,15 @@ bool GCNPassConfig::addInstSelector() {
|
|||
}
|
||||
|
||||
void GCNPassConfig::addPreRegAlloc() {
|
||||
const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
|
||||
const AMDGPUSubtarget &ST = *getAMDGPUTargetMachine().getSubtargetImpl();
|
||||
if (getOptLevel() > CodeGenOpt::None && ST.loadStoreOptEnabled()) {
|
||||
// Don't do this with no optimizations since it throws away debug info by
|
||||
// merging nonadjacent loads.
|
||||
// Don't do this with no optimizations since it throws away debug info by
|
||||
// merging nonadjacent loads.
|
||||
|
||||
// This should be run after scheduling, but before register allocation. It
|
||||
// also need extra copies to the address operand to be eliminated.
|
||||
initializeSILoadStoreOptimizerPass(*PassRegistry::getPassRegistry());
|
||||
insertPass(&MachineSchedulerID, &SILoadStoreOptimizerID);
|
||||
// This should be run after scheduling, but before register allocation. It
|
||||
// also need extra copies to the address operand to be eliminated.
|
||||
initializeSILoadStoreOptimizerPass(*PassRegistry::getPassRegistry());
|
||||
insertPass(&MachineSchedulerID, &SILoadStoreOptimizerID);
|
||||
}
|
||||
addPass(createSIShrinkInstructionsPass(), false);
|
||||
addPass(createSIFixSGPRLiveRangesPass(), false);
|
||||
|
|
Loading…
Reference in New Issue