From 3f23744df4809eba94284e601e81489212c974d4 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 16 Dec 2008 03:25:46 +0000 Subject: Fix some register-alias-related bugs in the post-RA scheduler liveness computation code. Also, avoid adding output-depenency edges when both defs are dead, which frequently happens with EFLAGS defs. Compute Depth and Height lazily, and always in terms of edge latency values. For the schedulers that don't care about latency, edge latencies are set to 1. Eliminate Cycle and CycleBound, and LatencyPriorityQueue's Latencies array. These are all subsumed by the Depth and Height fields. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61073 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/LatencyPriorityQueue.h | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'include/llvm/CodeGen/LatencyPriorityQueue.h') diff --git a/include/llvm/CodeGen/LatencyPriorityQueue.h b/include/llvm/CodeGen/LatencyPriorityQueue.h index f7eb3a62a2a9..71fae2aeabb5 100644 --- a/include/llvm/CodeGen/LatencyPriorityQueue.h +++ b/include/llvm/CodeGen/LatencyPriorityQueue.h @@ -34,10 +34,6 @@ namespace llvm { // SUnits - The SUnits for the current graph. std::vector *SUnits; - // Latencies - The latency (max of latency from this node to the bb exit) - // for each node. - std::vector Latencies; - /// NumNodesSolelyBlocking - This vector contains, for every node in the /// Queue, the number of nodes that the node is the sole unscheduled /// predecessor for. This is used as a tie-breaker heuristic for better @@ -51,29 +47,23 @@ public: void initNodes(std::vector &sunits) { SUnits = &sunits; - // Calculate node priorities. - CalculatePriorities(); + NumNodesSolelyBlocking.resize(SUnits->size(), 0); } void addNode(const SUnit *SU) { - Latencies.resize(SUnits->size(), -1); NumNodesSolelyBlocking.resize(SUnits->size(), 0); - CalcLatency(*SU); } void updateNode(const SUnit *SU) { - Latencies[SU->NodeNum] = -1; - CalcLatency(*SU); } void releaseState() { SUnits = 0; - Latencies.clear(); } unsigned getLatency(unsigned NodeNum) const { - assert(NodeNum < Latencies.size()); - return Latencies[NodeNum]; + assert(NodeNum < (*SUnits).size()); + return (*SUnits)[NodeNum].getHeight(); } unsigned getNumSolelyBlockNodes(unsigned NodeNum) const { @@ -114,8 +104,6 @@ public: void ScheduledNode(SUnit *Node); private: - void CalculatePriorities(); - void CalcLatency(const SUnit &SU); void AdjustPriorityOfUnscheduledPreds(SUnit *SU); SUnit *getSingleUnscheduledPred(SUnit *SU); }; -- cgit v1.2.3