[llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h

Evan Cheng evan.cheng at apple.com
Wed Sep 27 17:07:35 PDT 2006



Changes in directory llvm/include/llvm/Target:

MRegisterInfo.h updated: 1.83 -> 1.84
---
Log message:

- Added a hook processFunctionBeforeCalleeSaveScn(). This is called by PEI just
before it determines which callee-save registers are to be spilled. This allows
the target to make changes such as forcing certain physical registers to be
spilled.
- Modified comments. It's important to note the order of registers in the array
returns by getCalleeSaveRegs() determines the order of callee save spill code.


---
Diffs of the changes:  (+10 -4)

 MRegisterInfo.h |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/Target/MRegisterInfo.h
diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.83 llvm/include/llvm/Target/MRegisterInfo.h:1.84
--- llvm/include/llvm/Target/MRegisterInfo.h:1.83	Wed Aug 23 19:21:32 2006
+++ llvm/include/llvm/Target/MRegisterInfo.h	Wed Sep 27 19:07:19 2006
@@ -283,7 +283,9 @@
   }
 
   /// getCalleeSaveRegs - Return a null-terminated list of all of the
-  /// callee-save registers on this target.
+  /// callee-save registers on this target. The register should be in the
+  /// order of desired callee-save stack frame offset. The first register is
+  /// closed to the incoming stack pointer if stack grows down, and vice versa.
   virtual const unsigned* getCalleeSaveRegs() const = 0;
 
   /// getCalleeSaveRegClasses - Return a null-terminated list of the preferred
@@ -371,12 +373,16 @@
     assert(0 && "Call Frame Pseudo Instructions do not exist on this target!");
   }
 
+  /// processFunctionBeforeCalleeSaveScan - This method is called immediately
+  /// before PrologEpilogInserter scans the physical registers used to determine
+  /// what callee-save registers should be spilled. This method is optional.
+  virtual void processFunctionBeforeCalleeSaveScan(MachineFunction &MF) const {
+  }
+
   /// processFunctionBeforeFrameFinalized - This method is called immediately
   /// before the specified functions frame layout (MF.getFrameInfo()) is
   /// finalized.  Once the frame is finalized, MO_FrameIndex operands are
-  /// replaced with direct constants.  This method is optional. The return value
-  /// is the number of instructions added to (negative if removed from) the
-  /// basic block
+  /// replaced with direct constants.  This method is optional.
   ///
   virtual void processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
   }






More information about the llvm-commits mailing list