[llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp SparcV9FrameInfo.h SparcV9PrologEpilogInserter.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Aug 12 10:56:13 PDT 2004



Changes in directory llvm/lib/Target/SparcV9:

SparcV9BurgISel.cpp updated: 1.2 -> 1.3
SparcV9FrameInfo.h updated: 1.5 -> 1.6
SparcV9PrologEpilogInserter.cpp updated: 1.40 -> 1.41
---
Log message:

When we want a constant, just use it, instead of calling through layers of
virtual methods and register name mapping functions


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

Index: llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp
diff -u llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.2 llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.3
--- llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.2	Wed Aug  4 03:05:27 2004
+++ llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp	Thu Aug 12 12:56:00 2004
@@ -19,6 +19,8 @@
 #include "SparcV9InstrForest.h"
 #include "SparcV9Internals.h"
 #include "SparcV9TmpInstr.h"
+#include "SparcV9FrameInfo.h"
+#include "SparcV9RegisterInfo.h"
 #include "llvm/CodeGen/IntrinsicLowering.h"
 #include "llvm/CodeGen/MachineConstantPool.h"
 #include "llvm/CodeGen/MachineFunction.h"
@@ -2779,13 +2781,11 @@
     assert(0 && "Unknown intrinsic function call should have been lowered!");
   case Intrinsic::vastart: {
     // Get the address of the first incoming vararg argument on the stack
-    bool ignore;
     Function* func = cast<Function>(callInstr.getParent()->getParent());
     int numFixedArgs   = func->getFunctionType()->getNumParams();
-    int fpReg          = target.getFrameInfo()->getIncomingArgBaseRegNum();
-    int argSize        = target.getFrameInfo()->getSizeOfEachArgOnStack();
-    int firstVarArgOff = numFixedArgs * argSize + target.getFrameInfo()->
-      getFirstIncomingArgOffset(MachineFunction::get(func), ignore);
+    int fpReg          = SparcV9::i6;
+    int firstVarArgOff = numFixedArgs * 8 + 
+                         SparcV9FrameInfo::FirstIncomingArgOffsetFromFP;
     mvec.push_back(BuildMI(V9::ADDi, 3).addMReg(fpReg).addSImm(firstVarArgOff).
                    addRegDef(&callInstr));
     return true;


Index: llvm/lib/Target/SparcV9/SparcV9FrameInfo.h
diff -u llvm/lib/Target/SparcV9/SparcV9FrameInfo.h:1.5 llvm/lib/Target/SparcV9/SparcV9FrameInfo.h:1.6
--- llvm/lib/Target/SparcV9/SparcV9FrameInfo.h:1.5	Wed Jun  2 00:54:42 2004
+++ llvm/lib/Target/SparcV9/SparcV9FrameInfo.h	Thu Aug 12 12:56:00 2004
@@ -112,7 +112,6 @@
     return growUp ? firstArg + relativeOffset : firstArg - relativeOffset; 
   }
   
-private:
   /*----------------------------------------------------------------------
     This diagram shows the stack frame layout used by llc on SparcV9 V9.
     Note that only the location of automatic variables, spill area,


Index: llvm/lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp
diff -u llvm/lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp:1.40 llvm/lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp:1.41
--- llvm/lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp:1.40	Mon Jul 19 02:52:35 2004
+++ llvm/lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp	Thu Aug 12 12:56:01 2004
@@ -18,6 +18,8 @@
 
 #include "SparcV9Internals.h"
 #include "SparcV9RegClassInfo.h"
+#include "SparcV9RegisterInfo.h"
+#include "SparcV9FrameInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineFunctionInfo.h"
 #include "llvm/CodeGen/MachineCodeForInstruction.h"
@@ -123,13 +125,12 @@
     int numArgRegs      = TM.getRegInfo()->getNumOfIntArgRegs();
     if (numFixedArgs < numArgRegs) {
       const TargetFrameInfo &FI = *TM.getFrameInfo();
-      bool ignore;
       int firstArgReg   = TM.getRegInfo()->getUnifiedRegNum(
                              TM.getRegInfo()->getRegClassIDOfType(Type::IntTy),
                              SparcV9IntRegClass::i0);
-      int fpReg         = FI.getIncomingArgBaseRegNum();
-      int argSize       = FI.getSizeOfEachArgOnStack();
-      int firstArgOffset= FI.getFirstIncomingArgOffset(MF,ignore);
+      int fpReg         = SparcV9::i6;
+      int argSize       = 8;
+      int firstArgOffset= SparcV9FrameInfo::FirstIncomingArgOffsetFromFP;
       int nextArgOffset = firstArgOffset + numFixedArgs * argSize;
 
       for (int i=numFixedArgs; i < numArgRegs; ++i) {






More information about the llvm-commits mailing list