When we want a constant, just use it, instead of calling through layers of
authorChris Lattner <sabre@nondot.org>
Thu, 12 Aug 2004 17:56:01 +0000 (17:56 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 12 Aug 2004 17:56:01 +0000 (17:56 +0000)
virtual methods and register name mapping functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15690 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9BurgISel.cpp
lib/Target/SparcV9/SparcV9FrameInfo.h
lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp

index a32eb340af368857073dd6325d257c903ab0fcdc..d837453e7bf03bb2578b49055ae56dafdca0cea0 100644 (file)
@@ -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 @@ static bool CodeGenIntrinsic(Intrinsic::ID iid, CallInst &callInstr,
     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 0a1bf207e3560001118053f55bae2fc575db9a42..788730ad0efc2bc1aaeb31298528ee1d2c2d4692 100644 (file)
@@ -112,7 +112,6 @@ public:
     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 d852dee1ed3aca37b558d0b3db8713acac723939..ca802df8fa91de89c57eefb31003d84d286c925f 100644 (file)
@@ -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 @@ void InsertPrologEpilogCode::InsertPrologCode(MachineFunction &MF)
     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) {