diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-04-17 20:25:11 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-04-17 20:25:11 +0000 |
commit | e52eef8e9a10ada9efc1fed115e5b6eefb22b1da (patch) | |
tree | d554e5fce4f632d58ca4e23a3d4eb82cad1b006a /include | |
parent | eff03db46d5d1df315cf2aa020ccd7f50ab3848e (diff) | |
download | llvm-e52eef8e9a10ada9efc1fed115e5b6eefb22b1da.tar.gz llvm-e52eef8e9a10ada9efc1fed115e5b6eefb22b1da.tar.bz2 llvm-e52eef8e9a10ada9efc1fed115e5b6eefb22b1da.tar.xz |
Add a register allocation preference field; add a method to compute size of a live interval.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36216 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/LiveInterval.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index 63d02c8573..1912d64296 100644 --- a/include/llvm/CodeGen/LiveInterval.h +++ b/include/llvm/CodeGen/LiveInterval.h @@ -81,6 +81,7 @@ namespace llvm { struct LiveInterval { typedef SmallVector<LiveRange,4> Ranges; unsigned reg; // the register of this interval + unsigned preference; // preferred register to allocate for this interval float weight; // weight of this interval MachineInstr* remat; // definition if the definition rematerializable Ranges ranges; // the ranges in which this register is live @@ -94,7 +95,7 @@ namespace llvm { public: LiveInterval(unsigned Reg, float Weight) - : reg(Reg), weight(Weight), remat(NULL) { + : reg(Reg), preference(0), weight(Weight), remat(NULL) { } typedef Ranges::iterator iterator; @@ -256,6 +257,10 @@ namespace llvm { removeRange(LR.start, LR.end); } + /// getSize - Returns the sum of sizes of all the LiveRange's. + /// + unsigned getSize() const; + bool operator<(const LiveInterval& other) const { return beginNumber() < other.beginNumber(); } |