[llvm-commits] [llvm] r132140 - in /llvm/trunk/lib/Target/Mips: MipsFrameLowering.cpp MipsISelLowering.cpp MipsMachineFunction.h
Akira Hatanaka
ahatanak at gmail.com
Thu May 26 13:30:31 PDT 2011
Author: ahatanak
Date: Thu May 26 15:30:31 2011
New Revision: 132140
URL: http://llvm.org/viewvc/llvm-project?rev=132140&view=rev
Log:
Use MachineFrameInfo::hasCalls instead of MipsFunctionInfo::hasCall to check if
a function has any function calls.
Modified:
llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
llvm/trunk/lib/Target/Mips/MipsMachineFunction.h
Modified: llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp?rev=132140&r1=132139&r2=132140&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp Thu May 26 15:30:31 2011
@@ -279,7 +279,6 @@
processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
RegScavenger *RS) const {
MachineRegisterInfo& MRI = MF.getRegInfo();
- MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
// FIXME: remove this code if register allocator can correctly mark
// $fp and $ra used or unused.
@@ -293,7 +292,7 @@
// instructions to save/restore $ra unless there is a function call.
// To correct this, $ra is explicitly marked unused if there is no
// function call.
- if (MipsFI->hasCall())
+ if (MF.getFrameInfo()->hasCalls())
MRI.setPhysRegUsed(Mips::RA);
else
MRI.setPhysRegUnused(Mips::RA);
Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=132140&r1=132139&r2=132140&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Thu May 26 15:30:31 2011
@@ -1171,8 +1171,6 @@
SmallVector<std::pair<unsigned, SDValue>, 16> RegsToPass;
SmallVector<SDValue, 8> MemOpChains;
- MipsFI->setHasCall();
-
// If this is the first call, create a stack frame object that points to
// a location to which .cprestore saves $gp. The offset of this frame object
// is set to 0, since we know nothing about the size of the argument area at
Modified: llvm/trunk/lib/Target/Mips/MipsMachineFunction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsMachineFunction.h?rev=132140&r1=132139&r2=132140&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsMachineFunction.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsMachineFunction.h Thu May 26 15:30:31 2011
@@ -47,14 +47,12 @@
// LowerCall except for the frame object for restoring $gp.
std::pair<int, int> InArgFIRange, OutArgFIRange;
int GPFI; // Index of the frame object for restoring $gp
- bool HasCall; // True if function has a function call.
unsigned MaxCallFrameSize;
public:
MipsFunctionInfo(MachineFunction& MF)
: SRetReturnReg(0), GlobalBaseReg(0),
VarArgsFrameIndex(0), InArgFIRange(std::make_pair(-1, 0)),
- OutArgFIRange(std::make_pair(-1, 0)), GPFI(0), HasCall(false),
- MaxCallFrameSize(0)
+ OutArgFIRange(std::make_pair(-1, 0)), GPFI(0), MaxCallFrameSize(0)
{}
bool isInArgFI(int FI) const {
@@ -86,9 +84,6 @@
int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
- bool hasCall() const { return HasCall; }
- void setHasCall() { HasCall = true; }
-
unsigned getMaxCallFrameSize() const { return MaxCallFrameSize; }
void setMaxCallFrameSize(unsigned S) { MaxCallFrameSize = S; }
};
More information about the llvm-commits
mailing list