summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-06-05 03:44:32 +0000
committerAndrew Trick <atrick@apple.com>2012-06-05 03:44:32 +0000
commitd327d3ddddaf23fe920a01bf6304f6a8f4986e89 (patch)
treea3d98b611d91732f06b3071906753600e1da011d
parentd05b46115f5049b7b094d4049aa88f09f7d6b65a (diff)
downloadllvm-d327d3ddddaf23fe920a01bf6304f6a8f4986e89.tar.gz
llvm-d327d3ddddaf23fe920a01bf6304f6a8f4986e89.tar.bz2
llvm-d327d3ddddaf23fe920a01bf6304f6a8f4986e89.tar.xz
misched: Allow disabling scoreboard hazard checking for subtargets with a
valid itinerary but no pipeline stages. An itinerary can contain useful scheduling information without specifying pipeline stages for each instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157977 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/ScheduleHazardRecognizer.h2
-rw-r--r--lib/CodeGen/ScoreboardHazardRecognizer.cpp18
2 files changed, 14 insertions, 6 deletions
diff --git a/include/llvm/CodeGen/ScheduleHazardRecognizer.h b/include/llvm/CodeGen/ScheduleHazardRecognizer.h
index fd62841918..9dfa3446ef 100644
--- a/include/llvm/CodeGen/ScheduleHazardRecognizer.h
+++ b/include/llvm/CodeGen/ScheduleHazardRecognizer.h
@@ -46,6 +46,8 @@ public:
/// atIssueLimit - Return true if no more instructions may be issued in this
/// cycle.
+ ///
+ /// FIXME: remove this once MachineScheduler is the only client.
virtual bool atIssueLimit() const { return false; }
/// getHazardType - Return the hazard type of emitting this node. There are
diff --git a/lib/CodeGen/ScoreboardHazardRecognizer.cpp b/lib/CodeGen/ScoreboardHazardRecognizer.cpp
index f3bad94319..ac62d7ef0d 100644
--- a/lib/CodeGen/ScoreboardHazardRecognizer.cpp
+++ b/lib/CodeGen/ScoreboardHazardRecognizer.cpp
@@ -39,9 +39,9 @@ ScoreboardHazardRecognizer(const InstrItineraryData *II,
DebugType = ParentDebugType;
#endif
- // Determine the maximum depth of any itinerary. This determines the
- // depth of the scoreboard. We always make the scoreboard at least 1
- // cycle deep to avoid dealing with the boundary condition.
+ // Determine the maximum depth of any itinerary. This determines the depth of
+ // the scoreboard. We always make the scoreboard at least 1 cycle deep to
+ // avoid dealing with the boundary condition.
unsigned ScoreboardDepth = 1;
if (ItinData && !ItinData->isEmpty()) {
IssueWidth = ItinData->IssueWidth;
@@ -63,16 +63,22 @@ ScoreboardHazardRecognizer(const InstrItineraryData *II,
// Find the next power-of-2 >= ItinDepth
while (ItinDepth > ScoreboardDepth) {
ScoreboardDepth *= 2;
+ // Don't set MaxLookAhead until we find at least one nonzero stage.
+ // This way, an itinerary with no stages has MaxLookAhead==0, which
+ // completely bypasses the scoreboard hazard logic.
+ MaxLookAhead = ScoreboardDepth;
}
}
- MaxLookAhead = ScoreboardDepth;
}
ReservedScoreboard.reset(ScoreboardDepth);
RequiredScoreboard.reset(ScoreboardDepth);
- DEBUG(dbgs() << "Using scoreboard hazard recognizer: Depth = "
- << ScoreboardDepth << '\n');
+ if (!MaxLookAhead)
+ DEBUG(dbgs() << "Disabled scoreboard hazard recognizer\n");
+ else
+ DEBUG(dbgs() << "Using scoreboard hazard recognizer: Depth = "
+ << ScoreboardDepth << '\n');
}
void ScoreboardHazardRecognizer::Reset() {