From 6845dfe07e50eb2b5e4151d38849f339ff74b92d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 12 Aug 2004 17:56:01 +0000 Subject: [PATCH] When we want a constant, just use it, instead of calling through layers of 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 | 10 +++++----- lib/Target/SparcV9/SparcV9FrameInfo.h | 1 - lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp | 9 +++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/Target/SparcV9/SparcV9BurgISel.cpp b/lib/Target/SparcV9/SparcV9BurgISel.cpp index a32eb340af3..d837453e7bf 100644 --- a/lib/Target/SparcV9/SparcV9BurgISel.cpp +++ b/lib/Target/SparcV9/SparcV9BurgISel.cpp @@ -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(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; diff --git a/lib/Target/SparcV9/SparcV9FrameInfo.h b/lib/Target/SparcV9/SparcV9FrameInfo.h index 0a1bf207e35..788730ad0ef 100644 --- a/lib/Target/SparcV9/SparcV9FrameInfo.h +++ b/lib/Target/SparcV9/SparcV9FrameInfo.h @@ -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, diff --git a/lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp b/lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp index d852dee1ed3..ca802df8fa9 100644 --- a/lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp +++ b/lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp @@ -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) { -- 2.11.0