[llvm-commits] [llvm] r159240 - in /llvm/trunk/lib/Target/Mips: MipsFrameLowering.cpp MipsISelDAGToDAG.cpp
Akira Hatanaka
ahatanaka at mips.com
Tue Jun 26 17:20:39 PDT 2012
Author: ahatanak
Date: Tue Jun 26 19:20:39 2012
New Revision: 159240
URL: http://llvm.org/viewvc/llvm-project?rev=159240&view=rev
Log:
Fix bug in computation of stack size in MipsFrameLowering.cpp.
Modified:
llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp
llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp?rev=159240&r1=159239&r2=159240&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp Tue Jun 26 19:20:39 2012
@@ -112,9 +112,12 @@
// First, compute final stack size.
unsigned StackAlign = getStackAlignment();
- uint64_t StackSize = STI.inMips16Mode()? 0:
- MFI->getObjectOffset(MipsFI->getGlobalRegFI()) +
- StackAlign + RoundUpToAlignment(MFI->getStackSize(), StackAlign);
+ uint64_t StackSize = RoundUpToAlignment(MFI->getStackSize(), StackAlign);
+
+ if (MipsFI->globalBaseRegSet())
+ StackSize += MFI->getObjectOffset(MipsFI->getGlobalRegFI()) + StackAlign;
+ else
+ StackSize += RoundUpToAlignment(MipsFI->getMaxCallFrameSize(), StackAlign);
// Update stack size
MFI->setStackSize(StackSize);
Modified: llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp?rev=159240&r1=159239&r2=159240&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp Tue Jun 26 19:20:39 2012
@@ -117,6 +117,10 @@
void MipsDAGToDAGISel::InitGlobalBaseReg(MachineFunction &MF) {
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
+ if (((MF.getTarget().getRelocationModel() == Reloc::Static) ||
+ Subtarget.inMips16Mode()) && !MipsFI->globalBaseRegSet())
+ return;
+
MachineBasicBlock &MBB = MF.front();
MachineBasicBlock::iterator I = MBB.begin();
MachineRegisterInfo &RegInfo = MF.getRegInfo();
More information about the llvm-commits
mailing list