Don't crash when target has no itineraries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80962 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Goodwin
2009-09-03 22:48:51 +00:00
parent eb3a766529
commit 4f7228f851

View File

@@ -83,6 +83,7 @@ void ExactHazardRecognizer::dumpScoreboard() {
} }
ExactHazardRecognizer::HazardType ExactHazardRecognizer::getHazardType(SUnit *SU) { ExactHazardRecognizer::HazardType ExactHazardRecognizer::getHazardType(SUnit *SU) {
if (!ItinData.isEmpty()) {
unsigned cycle = 0; unsigned cycle = 0;
// Use the itinerary for the underlying instruction to check for // Use the itinerary for the underlying instruction to check for
@@ -110,11 +111,13 @@ ExactHazardRecognizer::HazardType ExactHazardRecognizer::getHazardType(SUnit *SU
// Advance the cycle to the next stage. // Advance the cycle to the next stage.
cycle += IS->getNextCycles(); cycle += IS->getNextCycles();
} }
}
return NoHazard; return NoHazard;
} }
void ExactHazardRecognizer::EmitInstruction(SUnit *SU) { void ExactHazardRecognizer::EmitInstruction(SUnit *SU) {
if (!ItinData.isEmpty()) {
unsigned cycle = 0; unsigned cycle = 0;
// Use the itinerary for the underlying instruction to reserve FU's // Use the itinerary for the underlying instruction to reserve FU's
@@ -149,6 +152,7 @@ void ExactHazardRecognizer::EmitInstruction(SUnit *SU) {
DEBUG(dumpScoreboard()); DEBUG(dumpScoreboard());
} }
}
void ExactHazardRecognizer::AdvanceCycle() { void ExactHazardRecognizer::AdvanceCycle() {
Scoreboard[ScoreboardHead] = 0; Scoreboard[ScoreboardHead] = 0;