[llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h

Evan Cheng evan.cheng at apple.com
Tue Apr 17 13:32:48 PDT 2007



Changes in directory llvm/include/llvm/CodeGen:

LiveIntervalAnalysis.h updated: 1.77 -> 1.78
---
Log message:

Copy coalescing change to prevent a physical register from being pin to a
long live interval that has low usage density.
1. Change order of coalescing to join physical registers with virtual
   registers first before virtual register intervals become too long.
2. Check size and usage density to determine if it's worthwhile to join.
3. If joining is aborted, assign virtual register live interval allocation
   preference field to the physical register.
4. Register allocator should try to allocate to the preferred register
   first (if available) to create identify moves that can be eliminated.


---
Diffs of the changes:  (+6 -2)

 LiveIntervalAnalysis.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h
diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.77 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.78
--- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.77	Mon Apr  2 13:49:18 2007
+++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h	Tue Apr 17 15:32:26 2007
@@ -23,6 +23,7 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/LiveInterval.h"
 #include "llvm/ADT/BitVector.h"
+#include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/IndexedMap.h"
 
 namespace llvm {
@@ -30,6 +31,7 @@
   class LiveVariables;
   class MRegisterInfo;
   class TargetInstrInfo;
+  class TargetRegisterClass;
   class VirtRegMap;
 
   class LiveIntervals : public MachineFunctionPass {
@@ -56,6 +58,7 @@
     Reg2RegMap r2rMap_;
 
     BitVector allocatableRegs_;
+    DenseMap<const TargetRegisterClass*, BitVector> allocatableRCRegs_;
 
     /// JoinedLIs - Keep track which register intervals have been coalesced
     /// with other intervals.
@@ -202,7 +205,7 @@
     /// CopyCoallesceInMBB - Coallsece copies in the specified MBB, putting
     /// copies that cannot yet be coallesced into the "TryAgain" list.
     void CopyCoallesceInMBB(MachineBasicBlock *MBB,
-                            std::vector<CopyRec> &TryAgain);
+                         std::vector<CopyRec> &TryAgain, bool PhysOnly = false);
 
     /// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg,
     /// which are the src/dst of the copy instruction CopyMI.  This returns true
@@ -210,7 +213,8 @@
     /// to coallesce these this copy, due to register constraints.  It returns
     /// false if it is not currently possible to coallesce this interval, but
     /// it may be possible if other things get coallesced.
-    bool JoinCopy(MachineInstr *CopyMI, unsigned SrcReg, unsigned DstReg);
+    bool JoinCopy(MachineInstr *CopyMI, unsigned SrcReg, unsigned DstReg,
+                  bool PhysOnly = false);
     
     /// JoinIntervals - Attempt to join these two intervals.  On failure, this
     /// returns false.  Otherwise, if one of the intervals being joined is a






More information about the llvm-commits mailing list