mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-05 14:34:55 +00:00
mi-sched: Reuse an invalid HazardRecognizer to save compile time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189989 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
40b52bb8f2
commit
00b5fa4c28
@ -1469,13 +1469,16 @@ public:
|
|||||||
|
|
||||||
void reset() {
|
void reset() {
|
||||||
// A new HazardRec is created for each DAG and owned by SchedBoundary.
|
// A new HazardRec is created for each DAG and owned by SchedBoundary.
|
||||||
delete HazardRec;
|
// Detroying and reconstructing it is very expensive though. So keep
|
||||||
|
// invalid, placeholder HazardRecs.
|
||||||
|
if (HazardRec && HazardRec->isEnabled()) {
|
||||||
|
delete HazardRec;
|
||||||
|
HazardRec = 0;
|
||||||
|
}
|
||||||
Available.clear();
|
Available.clear();
|
||||||
Pending.clear();
|
Pending.clear();
|
||||||
CheckPending = false;
|
CheckPending = false;
|
||||||
NextSUs.clear();
|
NextSUs.clear();
|
||||||
HazardRec = 0;
|
|
||||||
CurrCycle = 0;
|
CurrCycle = 0;
|
||||||
CurrMOps = 0;
|
CurrMOps = 0;
|
||||||
MinReadyCycle = UINT_MAX;
|
MinReadyCycle = UINT_MAX;
|
||||||
@ -1681,9 +1684,14 @@ void ConvergingScheduler::initialize(ScheduleDAGMI *dag) {
|
|||||||
// are disabled, then these HazardRecs will be disabled.
|
// are disabled, then these HazardRecs will be disabled.
|
||||||
const InstrItineraryData *Itin = SchedModel->getInstrItineraries();
|
const InstrItineraryData *Itin = SchedModel->getInstrItineraries();
|
||||||
const TargetMachine &TM = DAG->MF.getTarget();
|
const TargetMachine &TM = DAG->MF.getTarget();
|
||||||
Top.HazardRec = TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
|
if (!Top.HazardRec) {
|
||||||
Bot.HazardRec = TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
|
Top.HazardRec =
|
||||||
|
TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
|
||||||
|
}
|
||||||
|
if (!Bot.HazardRec) {
|
||||||
|
Bot.HazardRec =
|
||||||
|
TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
|
||||||
|
}
|
||||||
assert((!ForceTopDown || !ForceBottomUp) &&
|
assert((!ForceTopDown || !ForceBottomUp) &&
|
||||||
"-misched-topdown incompatible with -misched-bottomup");
|
"-misched-topdown incompatible with -misched-bottomup");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user