diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-09-10 01:29:16 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-09-10 01:29:16 +0000 |
commit | 3ef1c8759a20167457eb7fd82ebcaffe7ccaa1d1 (patch) | |
tree | ffcb01b1621bcedb427d701cfaee9ea9a19b0a2c /lib/CodeGen/PostRAHazardRecognizer.cpp | |
parent | 920a2089d9b737820631bc6de4c4fb9fa9ad1e07 (diff) | |
download | external_llvm-3ef1c8759a20167457eb7fd82ebcaffe7ccaa1d1.zip external_llvm-3ef1c8759a20167457eb7fd82ebcaffe7ccaa1d1.tar.gz external_llvm-3ef1c8759a20167457eb7fd82ebcaffe7ccaa1d1.tar.bz2 |
Teach if-converter to be more careful with predicating instructions that would
take multiple cycles to decode.
For the current if-converter clients (actually only ARM), the instructions that
are predicated on false are not nops. They would still take machine cycles to
decode. Micro-coded instructions such as LDM / STM can potentially take multiple
cycles to decode. If-converter should take treat them as non-micro-coded
simple instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PostRAHazardRecognizer.cpp')
-rw-r--r-- | lib/CodeGen/PostRAHazardRecognizer.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/CodeGen/PostRAHazardRecognizer.cpp b/lib/CodeGen/PostRAHazardRecognizer.cpp index cbde2b0..2e39196 100644 --- a/lib/CodeGen/PostRAHazardRecognizer.cpp +++ b/lib/CodeGen/PostRAHazardRecognizer.cpp @@ -23,19 +23,19 @@ using namespace llvm; PostRAHazardRecognizer:: -PostRAHazardRecognizer(const InstrItineraryData &LItinData) : +PostRAHazardRecognizer(const InstrItineraryData *LItinData) : ScheduleHazardRecognizer(), ItinData(LItinData) { // 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.isEmpty()) { + if (ItinData && !ItinData->isEmpty()) { for (unsigned idx = 0; ; ++idx) { - if (ItinData.isEndMarker(idx)) + if (ItinData->isEndMarker(idx)) break; - const InstrStage *IS = ItinData.beginStage(idx); - const InstrStage *E = ItinData.endStage(idx); + const InstrStage *IS = ItinData->beginStage(idx); + const InstrStage *E = ItinData->endStage(idx); unsigned ItinDepth = 0; for (; IS != E; ++IS) ItinDepth += IS->getCycles(); @@ -74,7 +74,7 @@ void PostRAHazardRecognizer::ScoreBoard::dump() const { ScheduleHazardRecognizer::HazardType PostRAHazardRecognizer::getHazardType(SUnit *SU) { - if (ItinData.isEmpty()) + if (!ItinData || ItinData->isEmpty()) return NoHazard; unsigned cycle = 0; @@ -82,8 +82,8 @@ PostRAHazardRecognizer::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.beginStage(idx), - *E = ItinData.endStage(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. @@ -121,7 +121,7 @@ PostRAHazardRecognizer::getHazardType(SUnit *SU) { } void PostRAHazardRecognizer::EmitInstruction(SUnit *SU) { - if (ItinData.isEmpty()) + if (!ItinData || ItinData->isEmpty()) return; unsigned cycle = 0; @@ -129,8 +129,8 @@ void PostRAHazardRecognizer::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.beginStage(idx), - *E = ItinData.endStage(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. |