diff options
author | Akira Hatanaka <ahatanak@gmail.com> | 2011-06-21 00:40:49 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanak@gmail.com> | 2011-06-21 00:40:49 +0000 |
commit | 21afc63ea7b8227ccb1b735255be55bf422136d6 (patch) | |
tree | 7e0235f0c69c6251065a42d8e51c12a7c1d6265b /lib/Target/Mips/MipsRegisterInfo.cpp | |
parent | 48b93b10e30398f22481bf272b76a50b1a5a9bdd (diff) | |
download | external_llvm-21afc63ea7b8227ccb1b735255be55bf422136d6.zip external_llvm-21afc63ea7b8227ccb1b735255be55bf422136d6.tar.gz external_llvm-21afc63ea7b8227ccb1b735255be55bf422136d6.tar.bz2 |
Re-apply 132758 and 132768 which were speculatively reverted in 132777.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133494 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsRegisterInfo.cpp')
-rw-r--r-- | lib/Target/Mips/MipsRegisterInfo.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Target/Mips/MipsRegisterInfo.cpp b/lib/Target/Mips/MipsRegisterInfo.cpp index b0984af..fa64f63 100644 --- a/lib/Target/Mips/MipsRegisterInfo.cpp +++ b/lib/Target/Mips/MipsRegisterInfo.cpp @@ -179,12 +179,14 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, int Offset; // Calculate final offset. - // - There is no need to change the offset if the frame object is an outgoing - // argument or a $gp restore location, + // - There is no need to change the offset if the frame object is one of the + // following: an outgoing argument, pointer to a dynamically allocated + // stack space or a $gp restore location, // - If the frame object is any of the following, its offset must be adjusted // by adding the size of the stack: // incoming argument, callee-saved register location or local variable. - if (MipsFI->isOutArgFI(FrameIndex) || MipsFI->isGPFI(FrameIndex)) + if (MipsFI->isOutArgFI(FrameIndex) || MipsFI->isGPFI(FrameIndex) || + MipsFI->isDynAllocFI(FrameIndex)) Offset = spOffset; else Offset = spOffset + stackSize; @@ -213,7 +215,7 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, // 3. Locations for callee-saved registers. // Everything else is referenced relative to whatever register // getFrameRegister() returns. - if (MipsFI->isOutArgFI(FrameIndex) || + if (MipsFI->isOutArgFI(FrameIndex) || MipsFI->isDynAllocFI(FrameIndex) || (FrameIndex >= MinCSFI && FrameIndex <= MaxCSFI)) FrameReg = Mips::SP; else |