summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp
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
commited7c96d7d9564e530a414080def75bd3473214a3 (patch)
treed9d9b5305b1d109c2f9097db1b31359404973e84 /llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp
parent515f131786173bc0f86d67e9b10831f9fced64fb (diff)
downloadbcm5719-llvm-ed7c96d7d9564e530a414080def75bd3473214a3.tar.gz
bcm5719-llvm-ed7c96d7d9564e530a414080def75bd3473214a3.zip
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. llvm-svn: 157977
Diffstat (limited to 'llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp')
-rw-r--r--llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp b/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp
index f3bad943193..ac62d7ef0d4 100644
--- a/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp
+++ b/llvm/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() {
OpenPOWER on IntegriCloud