diff options
author | Andrew Trick <atrick@apple.com> | 2010-12-24 05:03:26 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2010-12-24 05:03:26 +0000 |
commit | 2da8bc8a5f7705ac131184cd247f48500da0d74e (patch) | |
tree | cff1dbbc4e29f2b8be4c46e8454fe29228daeecb /lib/Target/ARM/ARMHazardRecognizer.cpp | |
parent | 6e8f4c404825b79f9b9176483653f1aa927dfbde (diff) |
Various bits of framework needed for precise machine-level selection
DAG scheduling during isel. Most new functionality is currently
guarded by -enable-sched-cycles and -enable-sched-hazard.
Added InstrItineraryData::IssueWidth field, currently derived from
ARM itineraries, but could be initialized differently on other targets.
Added ScheduleHazardRecognizer::MaxLookAhead to indicate whether it is
active, and if so how many cycles of state it holds.
Added SchedulingPriorityQueue::HasReadyFilter to allowing gating entry
into the scheduler's available queue.
ScoreboardHazardRecognizer now accesses the ScheduleDAG in order to
get information about it's SUnits, provides RecedeCycle for bottom-up
scheduling, correctly computes scoreboard depth, tracks IssueCount, and
considers potential stall cycles when checking for hazards.
ScheduleDAGRRList now models machine cycles and hazards (under
flags). It tracks MinAvailableCycle, drives the hazard recognizer and
priority queue's ready filter, manages a new PendingQueue, properly
accounts for stall cycles, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122541 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMHazardRecognizer.cpp')
-rw-r--r-- | lib/Target/ARM/ARMHazardRecognizer.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Target/ARM/ARMHazardRecognizer.cpp b/lib/Target/ARM/ARMHazardRecognizer.cpp index b8d385b6e3..683a7cc169 100644 --- a/lib/Target/ARM/ARMHazardRecognizer.cpp +++ b/lib/Target/ARM/ARMHazardRecognizer.cpp @@ -34,7 +34,9 @@ static bool hasRAWHazard(MachineInstr *DefMI, MachineInstr *MI, } ScheduleHazardRecognizer::HazardType -ARMHazardRecognizer::getHazardType(SUnit *SU) { +ARMHazardRecognizer::getHazardType(SUnit *SU, int Stalls) { + assert(Stalls == 0 && "ARM hazards don't support scoreboard lookahead"); + MachineInstr *MI = SU->getInstr(); if (!MI->isDebugValue()) { @@ -61,19 +63,19 @@ ARMHazardRecognizer::getHazardType(SUnit *SU) { (TII.canCauseFpMLxStall(MI->getOpcode()) || hasRAWHazard(DefMI, MI, TRI))) { // Try to schedule another instruction for the next 4 cycles. - if (Stalls == 0) - Stalls = 4; + if (FpMLxStalls == 0) + FpMLxStalls = 4; return Hazard; } } } - return ScoreboardHazardRecognizer::getHazardType(SU); + return ScoreboardHazardRecognizer::getHazardType(SU, Stalls); } void ARMHazardRecognizer::Reset() { LastMI = 0; - Stalls = 0; + FpMLxStalls = 0; ITBlockSize = 0; ScoreboardHazardRecognizer::Reset(); } @@ -100,14 +102,14 @@ void ARMHazardRecognizer::EmitInstruction(SUnit *SU) { if (!MI->isDebugValue()) { LastMI = MI; - Stalls = 0; + FpMLxStalls = 0; } ScoreboardHazardRecognizer::EmitInstruction(SU); } void ARMHazardRecognizer::AdvanceCycle() { - if (Stalls && --Stalls == 0) + if (FpMLxStalls && --FpMLxStalls == 0) // Stalled for 4 cycles but still can't schedule any other instructions. LastMI = 0; ScoreboardHazardRecognizer::AdvanceCycle(); |