aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocBase.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-02-26 22:03:50 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-02-26 22:03:50 +0000
commitd0e4e96dc17a6c1c6de3340842c80f0e187ba349 (patch)
treeddf53b8bd9235bcb0b8aae16c5e22310dcdad665 /lib/CodeGen/RegAllocBase.h
parentcf099d11218cb6f6c5cce947d6738e347f07fb12 (diff)
downloadsrc-d0e4e96dc17a6c1c6de3340842c80f0e187ba349.tar.gz
src-d0e4e96dc17a6c1c6de3340842c80f0e187ba349.zip
Vendor import of llvm trunk r126547:vendor/llvm/llvm-r126547
Notes
Notes: svn path=/vendor/llvm/dist/; revision=219067 svn path=/vendor/llvm/llvm-r126547/; revision=219068; tag=vendor/llvm/llvm-r126547
Diffstat (limited to 'lib/CodeGen/RegAllocBase.h')
-rw-r--r--lib/CodeGen/RegAllocBase.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/CodeGen/RegAllocBase.h b/lib/CodeGen/RegAllocBase.h
index 8c7e5f53b824..5af0ce79acf7 100644
--- a/lib/CodeGen/RegAllocBase.h
+++ b/lib/CodeGen/RegAllocBase.h
@@ -39,7 +39,6 @@
#include "llvm/ADT/OwningPtr.h"
#include "LiveIntervalUnion.h"
-#include <queue>
namespace llvm {
@@ -58,8 +57,8 @@ class LiveVirtRegQueue;
/// be extended to add interesting heuristics.
///
/// Register allocators must override the selectOrSplit() method to implement
-/// live range splitting. They may also override getPriority() which otherwise
-/// defaults to the spill weight computed by CalculateSpillWeights.
+/// live range splitting. They must also override enqueue/dequeue to provide an
+/// assignment order.
class RegAllocBase {
LiveIntervalUnion::Allocator UnionAllocator;
protected:
@@ -120,9 +119,11 @@ protected:
// Get a temporary reference to a Spiller instance.
virtual Spiller &spiller() = 0;
- // getPriority - Calculate the allocation priority for VirtReg.
- // Virtual registers with higher priorities are allocated first.
- virtual float getPriority(LiveInterval *LI) = 0;
+ /// enqueue - Add VirtReg to the priority queue of unassigned registers.
+ virtual void enqueue(LiveInterval *LI) = 0;
+
+ /// dequeue - Return the next unassigned register, or NULL.
+ virtual LiveInterval *dequeue() = 0;
// A RegAlloc pass should override this to provide the allocation heuristics.
// Each call must guarantee forward progess by returning an available PhysReg
@@ -170,7 +171,7 @@ public:
static bool VerifyEnabled;
private:
- void seedLiveVirtRegs(std::priority_queue<std::pair<float, unsigned> >&);
+ void seedLiveRegs();
void spillReg(LiveInterval &VirtReg, unsigned PhysReg,
SmallVectorImpl<LiveInterval*> &SplitVRegs);