summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LatencyPriorityQueue.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2010-12-24 05:03:26 +0000
committerAndrew Trick <atrick@apple.com>2010-12-24 05:03:26 +0000
commit2da8bc8a5f7705ac131184cd247f48500da0d74e (patch)
treecff1dbbc4e29f2b8be4c46e8454fe29228daeecb /lib/CodeGen/LatencyPriorityQueue.cpp
parent6e8f4c404825b79f9b9176483653f1aa927dfbde (diff)
downloadllvm-2da8bc8a5f7705ac131184cd247f48500da0d74e.tar.gz
llvm-2da8bc8a5f7705ac131184cd247f48500da0d74e.tar.bz2
llvm-2da8bc8a5f7705ac131184cd247f48500da0d74e.tar.xz
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/CodeGen/LatencyPriorityQueue.cpp')
-rw-r--r--lib/CodeGen/LatencyPriorityQueue.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/CodeGen/LatencyPriorityQueue.cpp b/lib/CodeGen/LatencyPriorityQueue.cpp
index f0d830b11e..0eb009ddac 100644
--- a/lib/CodeGen/LatencyPriorityQueue.cpp
+++ b/lib/CodeGen/LatencyPriorityQueue.cpp
@@ -16,6 +16,7 @@
#define DEBUG_TYPE "scheduler"
#include "llvm/CodeGen/LatencyPriorityQueue.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
bool latency_sort::operator()(const SUnit *LHS, const SUnit *RHS) const {
@@ -136,3 +137,16 @@ void LatencyPriorityQueue::remove(SUnit *SU) {
std::swap(*I, Queue.back());
Queue.pop_back();
}
+
+#ifdef NDEBUG
+void LatencyPriorityQueue::dump(ScheduleDAG *DAG) const {}
+#else
+void LatencyPriorityQueue::dump(ScheduleDAG *DAG) const {
+ LatencyPriorityQueue q = *this;
+ while (!q.empty()) {
+ SUnit *su = q.pop();
+ dbgs() << "Height " << su->getHeight() << ": ";
+ su->dump(DAG);
+ }
+}
+#endif