mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-05 02:07:16 +00:00
Remove more calls to getSubtargetImpl from the schedulers and
remove cached or unnecessary TargetMachines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219387 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8e673570b9
commit
d9b7ba1506
@ -30,7 +30,6 @@
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Target/TargetLowering.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetRegisterInfo.h"
|
||||
#include "llvm/Target/TargetSubtargetInfo.h"
|
||||
#include <climits>
|
||||
@ -167,13 +166,11 @@ public:
|
||||
NeedLatency(needlatency), AvailableQueue(availqueue), CurCycle(0),
|
||||
Topo(SUnits, nullptr) {
|
||||
|
||||
const TargetMachine &tm = mf.getTarget();
|
||||
const TargetSubtargetInfo &STI = mf.getSubtarget();
|
||||
if (DisableSchedCycles || !NeedLatency)
|
||||
HazardRec = new ScheduleHazardRecognizer();
|
||||
else
|
||||
HazardRec =
|
||||
tm.getSubtargetImpl()->getInstrInfo()->CreateTargetHazardRecognizer(
|
||||
tm.getSubtargetImpl(), this);
|
||||
HazardRec = STI.getInstrInfo()->CreateTargetHazardRecognizer(&STI, this);
|
||||
}
|
||||
|
||||
~ScheduleDAGRRList() {
|
||||
@ -2979,9 +2976,9 @@ void RegReductionPQBase::AddPseudoTwoAddrDeps() {
|
||||
llvm::ScheduleDAGSDNodes *
|
||||
llvm::createBURRListDAGScheduler(SelectionDAGISel *IS,
|
||||
CodeGenOpt::Level OptLevel) {
|
||||
const TargetMachine &TM = IS->TM;
|
||||
const TargetInstrInfo *TII = TM.getSubtargetImpl()->getInstrInfo();
|
||||
const TargetRegisterInfo *TRI = TM.getSubtargetImpl()->getRegisterInfo();
|
||||
const TargetSubtargetInfo &STI = IS->MF->getSubtarget();
|
||||
const TargetInstrInfo *TII = STI.getInstrInfo();
|
||||
const TargetRegisterInfo *TRI = STI.getRegisterInfo();
|
||||
|
||||
BURegReductionPriorityQueue *PQ =
|
||||
new BURegReductionPriorityQueue(*IS->MF, false, false, TII, TRI, nullptr);
|
||||
@ -2993,9 +2990,9 @@ llvm::createBURRListDAGScheduler(SelectionDAGISel *IS,
|
||||
llvm::ScheduleDAGSDNodes *
|
||||
llvm::createSourceListDAGScheduler(SelectionDAGISel *IS,
|
||||
CodeGenOpt::Level OptLevel) {
|
||||
const TargetMachine &TM = IS->TM;
|
||||
const TargetInstrInfo *TII = TM.getSubtargetImpl()->getInstrInfo();
|
||||
const TargetRegisterInfo *TRI = TM.getSubtargetImpl()->getRegisterInfo();
|
||||
const TargetSubtargetInfo &STI = IS->MF->getSubtarget();
|
||||
const TargetInstrInfo *TII = STI.getInstrInfo();
|
||||
const TargetRegisterInfo *TRI = STI.getRegisterInfo();
|
||||
|
||||
SrcRegReductionPriorityQueue *PQ =
|
||||
new SrcRegReductionPriorityQueue(*IS->MF, false, true, TII, TRI, nullptr);
|
||||
@ -3007,9 +3004,9 @@ llvm::createSourceListDAGScheduler(SelectionDAGISel *IS,
|
||||
llvm::ScheduleDAGSDNodes *
|
||||
llvm::createHybridListDAGScheduler(SelectionDAGISel *IS,
|
||||
CodeGenOpt::Level OptLevel) {
|
||||
const TargetMachine &TM = IS->TM;
|
||||
const TargetInstrInfo *TII = TM.getSubtargetImpl()->getInstrInfo();
|
||||
const TargetRegisterInfo *TRI = TM.getSubtargetImpl()->getRegisterInfo();
|
||||
const TargetSubtargetInfo &STI = IS->MF->getSubtarget();
|
||||
const TargetInstrInfo *TII = STI.getInstrInfo();
|
||||
const TargetRegisterInfo *TRI = STI.getRegisterInfo();
|
||||
const TargetLowering *TLI = IS->TLI;
|
||||
|
||||
HybridBURRPriorityQueue *PQ =
|
||||
@ -3023,9 +3020,9 @@ llvm::createHybridListDAGScheduler(SelectionDAGISel *IS,
|
||||
llvm::ScheduleDAGSDNodes *
|
||||
llvm::createILPListDAGScheduler(SelectionDAGISel *IS,
|
||||
CodeGenOpt::Level OptLevel) {
|
||||
const TargetMachine &TM = IS->TM;
|
||||
const TargetInstrInfo *TII = TM.getSubtargetImpl()->getInstrInfo();
|
||||
const TargetRegisterInfo *TRI = TM.getSubtargetImpl()->getRegisterInfo();
|
||||
const TargetSubtargetInfo &STI = IS->MF->getSubtarget();
|
||||
const TargetInstrInfo *TII = STI.getInstrInfo();
|
||||
const TargetRegisterInfo *TRI = STI.getRegisterInfo();
|
||||
const TargetLowering *TLI = IS->TLI;
|
||||
|
||||
ILPBURRPriorityQueue *PQ =
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Target/TargetLowering.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetRegisterInfo.h"
|
||||
#include "llvm/Target/TargetSubtargetInfo.h"
|
||||
using namespace llvm;
|
||||
@ -425,7 +424,7 @@ void ScheduleDAGSDNodes::BuildSchedUnits() {
|
||||
}
|
||||
|
||||
void ScheduleDAGSDNodes::AddSchedEdges() {
|
||||
const TargetSubtargetInfo &ST = TM.getSubtarget<TargetSubtargetInfo>();
|
||||
const TargetSubtargetInfo &ST = MF.getSubtarget();
|
||||
|
||||
// Check to see if the scheduler cares about latencies.
|
||||
bool UnitLatencies = forceUnitLatencies();
|
||||
|
@ -72,11 +72,8 @@ public:
|
||||
AliasAnalysis *aa,
|
||||
SchedulingPriorityQueue *availqueue)
|
||||
: ScheduleDAGSDNodes(mf), AvailableQueue(availqueue), AA(aa) {
|
||||
|
||||
const TargetMachine &tm = mf.getTarget();
|
||||
HazardRec =
|
||||
tm.getSubtargetImpl()->getInstrInfo()->CreateTargetHazardRecognizer(
|
||||
tm.getSubtargetImpl(), this);
|
||||
const TargetSubtargetInfo &STI = mf.getSubtarget();
|
||||
HazardRec = STI.getInstrInfo()->CreateTargetHazardRecognizer(&STI, this);
|
||||
}
|
||||
|
||||
~ScheduleDAGVLIW() {
|
||||
|
Loading…
Reference in New Issue
Block a user