diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2008-03-11 07:19:34 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2008-03-11 07:19:34 +0000 |
| commit | 676dd7c80b6f91178452535ac45ca58feb23cc42 (patch) | |
| tree | 33282790f7a542b3ef2f3af7a23646d8f8514a1c /include/llvm/CodeGen | |
| parent | 204496d58e7e740f0da6d41c6214a91d67950d26 (diff) | |
When the register allocator runs out of registers, spill a physical register around the def's and use's of the interval being allocated to make it possible for the interval to target a register and spill it right away and restore a register for uses. This likely generates terrible code but is before than aborting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
| -rw-r--r-- | include/llvm/CodeGen/LiveIntervalAnalysis.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index f2991c6197..a6e08167a6 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -282,11 +282,25 @@ namespace llvm { addIntervalsForSpills(const LiveInterval& i, const MachineLoopInfo *loopInfo, VirtRegMap& vrm); + /// spillPhysRegAroundRegDefsUses - Spill the specified physical register + /// around all defs and uses of the specified interval. + void spillPhysRegAroundRegDefsUses(const LiveInterval &li, + unsigned PhysReg, VirtRegMap &vrm); + /// isReMaterializable - Returns true if every definition of MI of every /// val# of the specified interval is re-materializable. Also returns true /// by reference if all of the defs are load instructions. bool isReMaterializable(const LiveInterval &li, bool &isLoad); + /// getRepresentativeReg - Find the largest super register of the specified + /// physical register. + unsigned getRepresentativeReg(unsigned Reg) const; + + /// getNumConflictsWithPhysReg - Return the number of uses and defs of the + /// specified interval that conflicts with the specified physical register. + unsigned getNumConflictsWithPhysReg(const LiveInterval &li, + unsigned PhysReg) const; + private: /// computeIntervals - Compute live intervals. void computeIntervals(); @@ -360,6 +374,10 @@ namespace llvm { /// within a single basic block. bool intervalIsInOneMBB(const LiveInterval &li) const; + /// hasAllocatableSuperReg - Return true if the specified physical register + /// has any super register that's allocatable. + bool hasAllocatableSuperReg(unsigned Reg) const; + /// SRInfo - Spill / restore info. struct SRInfo { int index; |
