summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Goodwin <david_goodwin@apple.com>2009-08-17 16:02:57 +0000
committerDavid Goodwin <david_goodwin@apple.com>2009-08-17 16:02:57 +0000
commitd813cbfe721ad70c8a9d9cd1f274c6d20e4e4411 (patch)
tree5e65fe7ec1c43463865f74756a4dd24c0dc0626a /llvm/lib/CodeGen
parentee97b8b11c4555fd59b3d0db7b0100298070492d (diff)
downloadbcm5719-llvm-d813cbfe721ad70c8a9d9cd1f274c6d20e4e4411.tar.gz
bcm5719-llvm-d813cbfe721ad70c8a9d9cd1f274c6d20e4e4411.zip
Extend the instruction itinerary model to include the ability to indicate the def and use cycle for each operand. This additional information is optional, so existing itineraries do not need to be changed.
llvm-svn: 79247
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/ExactHazardRecognizer.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/ExactHazardRecognizer.cpp b/llvm/lib/CodeGen/ExactHazardRecognizer.cpp
index 8bac08a4a05..33ee233dac0 100644
--- a/llvm/lib/CodeGen/ExactHazardRecognizer.cpp
+++ b/llvm/lib/CodeGen/ExactHazardRecognizer.cpp
@@ -33,7 +33,8 @@ ExactHazardRecognizer::ExactHazardRecognizer(const InstrItineraryData &LItinData
for (unsigned idx = 0; ; ++idx) {
// If the begin stage of an itinerary has 0 cycles and units,
// then we have reached the end of the itineraries.
- const InstrStage *IS = ItinData.begin(idx), *E = ItinData.end(idx);
+ const InstrStage *IS = ItinData.beginStage(idx);
+ const InstrStage *E = ItinData.endStage(idx);
if ((IS->getCycles() == 0) && (IS->getUnits() == 0))
break;
@@ -87,8 +88,8 @@ ExactHazardRecognizer::HazardType ExactHazardRecognizer::getHazardType(SUnit *SU
// Use the itinerary for the underlying instruction to check for
// free FU's in the scoreboard at the appropriate future cycles.
unsigned idx = SU->getInstr()->getDesc().getSchedClass();
- for (const InstrStage *IS = ItinData.begin(idx), *E = ItinData.end(idx);
- IS != E; ++IS) {
+ for (const InstrStage *IS = ItinData.beginStage(idx),
+ *E = ItinData.endStage(idx); IS != E; ++IS) {
// We must find one of the stage's units free for every cycle the
// stage is occupied. FIXME it would be more accurate to find the
// same unit free in all the cycles.
@@ -119,8 +120,8 @@ void ExactHazardRecognizer::EmitInstruction(SUnit *SU) {
// Use the itinerary for the underlying instruction to reserve FU's
// in the scoreboard at the appropriate future cycles.
unsigned idx = SU->getInstr()->getDesc().getSchedClass();
- for (const InstrStage *IS = ItinData.begin(idx), *E = ItinData.end(idx);
- IS != E; ++IS) {
+ for (const InstrStage *IS = ItinData.beginStage(idx),
+ *E = ItinData.endStage(idx); IS != E; ++IS) {
// We must reserve one of the stage's units for every cycle the
// stage is occupied. FIXME it would be more accurate to reserve
// the same unit free in all the cycles.
OpenPOWER on IntegriCloud