summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-05-27 22:14:26 +0000
committerMatthias Braun <matze@braunis.de>2016-05-27 22:14:26 +0000
commit49cb6e909d71bd52a0c78b0baa21e3f73d09f632 (patch)
tree8f5723145cc96987fd522e06857eaa56fffa7526 /llvm/lib/CodeGen/MachineScheduler.cpp
parent27b6692fe22fe2a54556a5ad7c68892e02b661f7 (diff)
downloadbcm5719-llvm-49cb6e909d71bd52a0c78b0baa21e3f73d09f632.tar.gz
bcm5719-llvm-49cb6e909d71bd52a0c78b0baa21e3f73d09f632.zip
MachineScheduler: Introduce ONLY1 reason to improve debug output
llvm-svn: 271058
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index d2b1b8fa6b3..5ea20c58620 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -2396,7 +2396,8 @@ const char *GenericSchedulerBase::getReasonStr(
GenericSchedulerBase::CandReason Reason) {
switch (Reason) {
case NoCand: return "NOCAND ";
- case PhysRegCopy: return "PREG-COPY";
+ case Only1: return "ONLY1 ";
+ case PhysRegCopy: return "PREG-COPY ";
case RegExcess: return "REG-EXCESS";
case RegCritical: return "REG-CRIT ";
case Stall: return "STALL ";
@@ -2528,10 +2529,14 @@ static bool tryLatency(GenericSchedulerBase::SchedCandidate &TryCand,
return false;
}
+static void tracePick(GenericSchedulerBase::CandReason Reason, bool IsTop) {
+ DEBUG(dbgs() << "Pick " << (IsTop ? "Top " : "Bot ")
+ << GenericSchedulerBase::getReasonStr(Reason) << '\n');
+}
+
static void tracePick(const GenericSchedulerBase::SchedCandidate &Cand,
bool IsTop) {
- DEBUG(dbgs() << "Pick " << (IsTop ? "Top " : "Bot ")
- << GenericSchedulerBase::getReasonStr(Cand.Reason) << '\n');
+ tracePick(Cand.Reason, IsTop);
}
void GenericScheduler::initialize(ScheduleDAGMI *dag) {
@@ -2917,12 +2922,12 @@ SUnit *GenericScheduler::pickNodeBidirectional(bool &IsTopNode) {
// efficient, but also provides the best heuristics for CriticalPSets.
if (SUnit *SU = Bot.pickOnlyChoice()) {
IsTopNode = false;
- DEBUG(dbgs() << "Pick Bot ONLY1\n");
+ tracePick(Only1, false);
return SU;
}
if (SUnit *SU = Top.pickOnlyChoice()) {
IsTopNode = true;
- DEBUG(dbgs() << "Pick Top ONLY1\n");
+ tracePick(Only1, true);
return SU;
}
CandPolicy NoPolicy;
@@ -3187,7 +3192,9 @@ SUnit *PostGenericScheduler::pickNode(bool &IsTopNode) {
SUnit *SU;
do {
SU = Top.pickOnlyChoice();
- if (!SU) {
+ if (SU) {
+ tracePick(Only1, true);
+ } else {
CandPolicy NoPolicy;
SchedCandidate TopCand(NoPolicy);
// Set the top-down policy based on the state of the current top zone and
OpenPOWER on IntegriCloud