diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-02-19 21:49:54 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-02-19 21:49:54 +0000 |
commit | b371f457b0ea4a652a9f526ba4375c80ae542252 (patch) | |
tree | ec68e7096a3f2101af8713fb7cba5ac5cf354664 /include/llvm/CodeGen/LiveIntervalAnalysis.h | |
parent | d1b2c5b34df35e0f582be44e0d7d2240a0b80812 (diff) | |
download | llvm-b371f457b0ea4a652a9f526ba4375c80ae542252.tar.gz llvm-b371f457b0ea4a652a9f526ba4375c80ae542252.tar.bz2 llvm-b371f457b0ea4a652a9f526ba4375c80ae542252.tar.xz |
Re-apply my liveintervalanalysis changes. Now with PR1207 fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34428 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/LiveIntervalAnalysis.h')
-rw-r--r-- | include/llvm/CodeGen/LiveIntervalAnalysis.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index 362b3545fb..ef48453b10 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -118,6 +118,11 @@ namespace llvm { return I->second; } + bool hasInterval(unsigned reg) const { + Reg2IntervalMap::const_iterator I = r2iMap_.find(reg); + return I != r2iMap_.end(); + } + /// getMBBStartIdx - Return the base index of the first instruction in the /// specified MachineBasicBlock. unsigned getMBBStartIdx(MachineBasicBlock *MBB) const { @@ -189,6 +194,7 @@ namespace llvm { /// copies that cannot yet be coallesced into the "TryAgain" list. void CopyCoallesceInMBB(MachineBasicBlock *MBB, std::vector<CopyRec> &TryAgain); + /// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg, /// which are the src/dst of the copy instruction CopyMI. This returns true /// if the copy was successfully coallesced away, or if it is never possible @@ -233,6 +239,9 @@ namespace llvm { LiveInterval &interval, unsigned SrcReg); + /// handleLiveInRegister - Create interval for a livein register. + void handleLiveInRegister(MachineBasicBlock* mbb, LiveInterval &interval); + /// Return true if the two specified registers belong to different /// register classes. The registers may be either phys or virt regs. bool differingRegisterClasses(unsigned RegA, unsigned RegB) const; @@ -241,11 +250,16 @@ namespace llvm { bool AdjustCopiesBackFrom(LiveInterval &IntA, LiveInterval &IntB, MachineInstr *CopyMI); - bool overlapsAliases(const LiveInterval *lhs, - const LiveInterval *rhs) const; + /// hasRegisterUse - Returns true if there is any use of the specific + /// reg between indexes Start and End. + bool hasRegisterUse(unsigned Reg, unsigned Start, unsigned End); static LiveInterval createInterval(unsigned Reg); + void removeInterval(unsigned Reg) { + r2iMap_.erase(Reg); + } + LiveInterval &getOrCreateInterval(unsigned reg) { Reg2IntervalMap::iterator I = r2iMap_.find(reg); if (I == r2iMap_.end()) |