Extensive changes to the way code generation occurs for function
call arguments and return values:
Now all copy operations before and after a call are generated during
selection instead of during register allocation.
The values are copied to virtual registers (or to the stack), but
in the former case these operands are marked with the correct physical
registers according to the calling convention.
Although this complicates scheduling and does not work well with
live range analysis, it simplifies the machine-dependent part of
register allocation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6465 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/SparcV9/SparcV9Internals.h b/lib/Target/SparcV9/SparcV9Internals.h
index 3e49efd..b4ce617 100644
--- a/lib/Target/SparcV9/SparcV9Internals.h
+++ b/lib/Target/SparcV9/SparcV9Internals.h
@@ -272,12 +272,6 @@
   //
   unsigned const NumOfFloatArgRegs;
 
-  // An out of bound register number that can be used to initialize register
-  // numbers. Useful for error detection.
-  //
-  int const InvalidRegNum;
-
-
   // ========================  Private Methods =============================
 
   // The following methods are used to color special live ranges (e.g.
@@ -295,13 +289,9 @@
                              int  UniArgReg, unsigned int argNo,
                              std::vector<MachineInstr *>& AddedInstrnsBefore)
     const;
-  
-  // Get the register type for a register identified different ways.
-  // The first function is a helper used by the all the hoter functions.
+
+  // Helper used by the all the getRegType() functions.
   int getRegTypeForClassAndType(unsigned regClassID, const Type* type) const;
-  int getRegType(const Type* type) const;
-  int getRegType(const LiveRange *LR) const;
-  int getRegType(int unifiedRegNum) const;
 
   // Used to generate a copy instruction based on the register class of
   // value.
@@ -322,17 +312,6 @@
                          std::vector<MachineInstr *> &OrdVec,
                          PhyRegAlloc &PRA) const;
 
-
-  // Compute which register can be used for an argument, if any
-  // 
-  int regNumForIntArg(bool inCallee, bool isVarArgsCall,
-                      unsigned argNo, unsigned intArgNo, unsigned fpArgNo,
-                      unsigned& regClassId) const;
-
-  int regNumForFPArg(unsigned RegType, bool inCallee, bool isVarArgsCall,
-                     unsigned argNo, unsigned intArgNo, unsigned fpArgNo,
-                     unsigned& regClassId) const;
-  
 public:
   // Type of registers available in Sparc. There can be several reg types
   // in the same class. For instace, the float reg class has Single/Double
@@ -380,6 +359,14 @@
   unsigned const getNumOfIntArgRegs() const   { return NumOfIntArgRegs; }
   unsigned const getNumOfFloatArgRegs() const { return NumOfFloatArgRegs; }
   
+  // Compute which register can be used for an argument, if any
+  // 
+  int regNumForIntArg(bool inCallee, bool isVarArgsCall,
+                      unsigned argNo, unsigned& regClassId) const;
+
+  int regNumForFPArg(unsigned RegType, bool inCallee, bool isVarArgsCall,
+                     unsigned argNo, unsigned& regClassId) const;
+  
   // The following methods are used to color special live ranges (e.g.
   // function args and return values etc.) with specific hardware registers
   // as required. See SparcRegInfo.cpp for the implementation for Sparc.
@@ -458,14 +445,14 @@
     return MachineRegClassArr[RegClassID]->isRegVolatile(Reg);
   }
 
+  // Get the register type for a register identified different ways.
+  int getRegType(const Type* type) const;
+  int getRegType(const LiveRange *LR) const;
+  int getRegType(int unifiedRegNum) const;
 
   virtual unsigned getFramePointer() const;
   virtual unsigned getStackPointer() const;
 
-  virtual int getInvalidRegNum() const {
-    return InvalidRegNum;
-  }
-
   // This method inserts the caller saving code for call instructions
   //
   void insertCallerSavingCode(std::vector<MachineInstr*>& instrnsBefore,