[llvm-branch-commits] [llvm-branch] r86058 - in /llvm/branches/Apple/Leela: lib/Target/ARM/ARMBaseRegisterInfo.cpp test/CodeGen/Thumb2/ldr-str-imm12.ll
Bill Wendling
isanbard at gmail.com
Wed Nov 4 14:46:37 PST 2009
Author: void
Date: Wed Nov 4 16:46:37 2009
New Revision: 86058
URL: http://llvm.org/viewvc/llvm-project?rev=86058&view=rev
Log:
$ svn merge -c 85743 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r85743 into '.':
A test/CodeGen/Thumb2/ldr-str-imm12.ll
U lib/Target/ARM/ARMBaseRegisterInfo.cpp
Added:
llvm/branches/Apple/Leela/test/CodeGen/Thumb2/ldr-str-imm12.ll
- copied unchanged from r85743, llvm/trunk/test/CodeGen/Thumb2/ldr-str-imm12.ll
Modified:
llvm/branches/Apple/Leela/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Modified: llvm/branches/Apple/Leela/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=86058&r1=86057&r2=86058&view=diff
==============================================================================
--- llvm/branches/Apple/Leela/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/branches/Apple/Leela/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Nov 4 16:46:37 2009
@@ -1124,6 +1124,7 @@
unsigned FrameReg = ARM::SP;
int FrameIndex = MI.getOperand(i).getIndex();
int Offset = MFI->getObjectOffset(FrameIndex) + MFI->getStackSize() + SPAdj;
+ bool isFixed = MFI->isFixedObjectIndex(FrameIndex);
// When doing dynamic stack realignment, all of these need to change(?)
if (AFI->isGPRCalleeSavedArea1Frame(FrameIndex))
@@ -1136,7 +1137,7 @@
// When dynamically realigning the stack, use the frame pointer for
// parameters, and the stack pointer for locals.
assert (hasFP(MF) && "dynamic stack realignment without a FP!");
- if (FrameIndex < 0) {
+ if (isFixed) {
FrameReg = getFrameRegister(MF);
Offset -= AFI->getFramePtrSpillOffset();
// When referencing from the frame pointer, stack pointer adjustments
@@ -1145,13 +1146,22 @@
}
} else if (hasFP(MF) && AFI->hasStackFrame()) {
assert(SPAdj == 0 && "Unexpected stack offset!");
- // Use frame pointer to reference fixed objects unless this is a
- // frameless function.
- FrameReg = getFrameRegister(MF);
- Offset -= AFI->getFramePtrSpillOffset();
+ if (isFixed || MFI->hasVarSizedObjects()) {
+ // Use frame pointer to reference fixed objects unless this is a
+ // frameless function.
+ FrameReg = getFrameRegister(MF);
+ Offset -= AFI->getFramePtrSpillOffset();
+ } else if (AFI->isThumb2Function()) {
+ // In Thumb2 mode, the negative offset is very limited.
+ int FPOffset = Offset - AFI->getFramePtrSpillOffset();
+ if (FPOffset >= -255 && FPOffset < 0) {
+ FrameReg = getFrameRegister(MF);
+ Offset = FPOffset;
+ }
+ }
}
- // modify MI as necessary to handle as much of 'Offset' as possible
+ // Modify MI as necessary to handle as much of 'Offset' as possible
bool Done = false;
if (!AFI->isThumbFunction())
Done = rewriteARMFrameIndex(MI, i, FrameReg, Offset, TII);
More information about the llvm-branch-commits
mailing list