mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Replace DOUT.
llvm-svn: 78634
This commit is contained in:
parent
1c75a23299
commit
922f4878cd
@ -17,6 +17,7 @@
|
|||||||
#include "llvm/CodeGen/ScheduleHazardRecognizer.h"
|
#include "llvm/CodeGen/ScheduleHazardRecognizer.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/Target/TargetInstrItineraries.h"
|
#include "llvm/Target/TargetInstrItineraries.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
@ -47,8 +48,8 @@ ExactHazardRecognizer::ExactHazardRecognizer(const InstrItineraryData &LItinData
|
|||||||
Scoreboard = new unsigned[ScoreboardDepth];
|
Scoreboard = new unsigned[ScoreboardDepth];
|
||||||
ScoreboardHead = 0;
|
ScoreboardHead = 0;
|
||||||
|
|
||||||
DOUT << "Using exact hazard recognizer: ScoreboardDepth = "
|
DEBUG(errs() << "Using exact hazard recognizer: ScoreboardDepth = "
|
||||||
<< ScoreboardDepth << '\n';
|
<< ScoreboardDepth << '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
ExactHazardRecognizer::~ExactHazardRecognizer() {
|
ExactHazardRecognizer::~ExactHazardRecognizer() {
|
||||||
@ -65,7 +66,7 @@ unsigned ExactHazardRecognizer::getFutureIndex(unsigned offset) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ExactHazardRecognizer::dumpScoreboard() {
|
void ExactHazardRecognizer::dumpScoreboard() {
|
||||||
DOUT << "Scoreboard:\n";
|
DEBUG(errs() << "Scoreboard:\n");
|
||||||
|
|
||||||
unsigned last = ScoreboardDepth - 1;
|
unsigned last = ScoreboardDepth - 1;
|
||||||
while ((last > 0) && (Scoreboard[getFutureIndex(last)] == 0))
|
while ((last > 0) && (Scoreboard[getFutureIndex(last)] == 0))
|
||||||
@ -73,10 +74,10 @@ void ExactHazardRecognizer::dumpScoreboard() {
|
|||||||
|
|
||||||
for (unsigned i = 0; i <= last; i++) {
|
for (unsigned i = 0; i <= last; i++) {
|
||||||
unsigned FUs = Scoreboard[getFutureIndex(i)];
|
unsigned FUs = Scoreboard[getFutureIndex(i)];
|
||||||
DOUT << "\t";
|
DEBUG(errs() << "\t");
|
||||||
for (int j = 31; j >= 0; j--)
|
for (int j = 31; j >= 0; j--)
|
||||||
DOUT << ((FUs & (1 << j)) ? '1' : '0');
|
DEBUG(errs() << ((FUs & (1 << j)) ? '1' : '0'));
|
||||||
DOUT << '\n';
|
DEBUG(errs() << '\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,8 +97,8 @@ ExactHazardRecognizer::HazardType ExactHazardRecognizer::getHazardType(SUnit *SU
|
|||||||
unsigned index = getFutureIndex(cycle);
|
unsigned index = getFutureIndex(cycle);
|
||||||
unsigned freeUnits = IS->Units & ~Scoreboard[index];
|
unsigned freeUnits = IS->Units & ~Scoreboard[index];
|
||||||
if (!freeUnits) {
|
if (!freeUnits) {
|
||||||
DOUT << "*** Hazard in cycle " << cycle << ", ";
|
DEBUG(errs() << "*** Hazard in cycle " << cycle << ", ");
|
||||||
DOUT << "SU(" << SU->NodeNum << "): ";
|
DEBUG(errs() << "SU(" << SU->NodeNum << "): ");
|
||||||
DEBUG(SU->getInstr()->dump());
|
DEBUG(SU->getInstr()->dump());
|
||||||
return Hazard;
|
return Hazard;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@ -183,7 +184,7 @@ static bool isSchedulingBoundary(const MachineInstr *MI,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
|
bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
|
||||||
DOUT << "PostRAScheduler\n";
|
DEBUG(errs() << "PostRAScheduler\n");
|
||||||
|
|
||||||
const MachineLoopInfo &MLI = getAnalysis<MachineLoopInfo>();
|
const MachineLoopInfo &MLI = getAnalysis<MachineLoopInfo>();
|
||||||
const MachineDominatorTree &MDT = getAnalysis<MachineDominatorTree>();
|
const MachineDominatorTree &MDT = getAnalysis<MachineDominatorTree>();
|
||||||
@ -310,7 +311,7 @@ void SchedulePostRATDList::StartBlock(MachineBasicBlock *BB) {
|
|||||||
/// Schedule - Schedule the instruction range using list scheduling.
|
/// Schedule - Schedule the instruction range using list scheduling.
|
||||||
///
|
///
|
||||||
void SchedulePostRATDList::Schedule() {
|
void SchedulePostRATDList::Schedule() {
|
||||||
DOUT << "********** List Scheduling **********\n";
|
DEBUG(errs() << "********** List Scheduling **********\n");
|
||||||
|
|
||||||
// Build the scheduling graph.
|
// Build the scheduling graph.
|
||||||
BuildSchedGraph();
|
BuildSchedGraph();
|
||||||
@ -525,8 +526,8 @@ bool SchedulePostRATDList::BreakAntiDependencies() {
|
|||||||
Max = SU;
|
Max = SU;
|
||||||
}
|
}
|
||||||
|
|
||||||
DOUT << "Critical path has total latency "
|
DEBUG(errs() << "Critical path has total latency "
|
||||||
<< (Max->getDepth() + Max->Latency) << "\n";
|
<< (Max->getDepth() + Max->Latency) << "\n");
|
||||||
|
|
||||||
// Track progress along the critical path through the SUnit graph as we walk
|
// Track progress along the critical path through the SUnit graph as we walk
|
||||||
// the instructions.
|
// the instructions.
|
||||||
@ -691,10 +692,10 @@ bool SchedulePostRATDList::BreakAntiDependencies() {
|
|||||||
if (KillIndices[NewReg] == ~0u &&
|
if (KillIndices[NewReg] == ~0u &&
|
||||||
Classes[NewReg] != reinterpret_cast<TargetRegisterClass *>(-1) &&
|
Classes[NewReg] != reinterpret_cast<TargetRegisterClass *>(-1) &&
|
||||||
KillIndices[AntiDepReg] <= DefIndices[NewReg]) {
|
KillIndices[AntiDepReg] <= DefIndices[NewReg]) {
|
||||||
DOUT << "Breaking anti-dependence edge on "
|
DEBUG(errs() << "Breaking anti-dependence edge on "
|
||||||
<< TRI->getName(AntiDepReg)
|
<< TRI->getName(AntiDepReg)
|
||||||
<< " with " << RegRefs.count(AntiDepReg) << " references"
|
<< " with " << RegRefs.count(AntiDepReg) << " references"
|
||||||
<< " using " << TRI->getName(NewReg) << "!\n";
|
<< " using " << TRI->getName(NewReg) << "!\n");
|
||||||
|
|
||||||
// Update the references to the old register to refer to the new
|
// Update the references to the old register to refer to the new
|
||||||
// register.
|
// register.
|
||||||
@ -777,7 +778,7 @@ void SchedulePostRATDList::ReleaseSuccessors(SUnit *SU) {
|
|||||||
/// count of its successors. If a successor pending count is zero, add it to
|
/// count of its successors. If a successor pending count is zero, add it to
|
||||||
/// the Available queue.
|
/// the Available queue.
|
||||||
void SchedulePostRATDList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
|
void SchedulePostRATDList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
|
||||||
DOUT << "*** Scheduling [" << CurCycle << "]: ";
|
DEBUG(errs() << "*** Scheduling [" << CurCycle << "]: ");
|
||||||
DEBUG(SU->dump(this));
|
DEBUG(SU->dump(this));
|
||||||
|
|
||||||
Sequence.push_back(SU);
|
Sequence.push_back(SU);
|
||||||
@ -866,7 +867,7 @@ void SchedulePostRATDList::ListScheduleTopDown() {
|
|||||||
} else if (!HasNoopHazards) {
|
} else if (!HasNoopHazards) {
|
||||||
// Otherwise, we have a pipeline stall, but no other problem, just advance
|
// Otherwise, we have a pipeline stall, but no other problem, just advance
|
||||||
// the current cycle and try again.
|
// the current cycle and try again.
|
||||||
DOUT << "*** Advancing cycle, no work to do\n";
|
DEBUG(errs() << "*** Advancing cycle, no work to do\n");
|
||||||
HazardRec->AdvanceCycle();
|
HazardRec->AdvanceCycle();
|
||||||
++NumStalls;
|
++NumStalls;
|
||||||
++CurCycle;
|
++CurCycle;
|
||||||
@ -874,7 +875,7 @@ void SchedulePostRATDList::ListScheduleTopDown() {
|
|||||||
// Otherwise, we have no instructions to issue and we have instructions
|
// Otherwise, we have no instructions to issue and we have instructions
|
||||||
// that will fault if we don't do this right. This is the case for
|
// that will fault if we don't do this right. This is the case for
|
||||||
// processors without pipeline interlocks and other cases.
|
// processors without pipeline interlocks and other cases.
|
||||||
DOUT << "*** Emitting noop\n";
|
DEBUG(errs() << "*** Emitting noop\n");
|
||||||
HazardRec->EmitNoop();
|
HazardRec->EmitNoop();
|
||||||
Sequence.push_back(0); // NULL here means noop
|
Sequence.push_back(0); // NULL here means noop
|
||||||
++NumNoops;
|
++NumNoops;
|
||||||
|
Loading…
Reference in New Issue
Block a user