diff options
author | Jim Grosbach <grosbach@apple.com> | 2010-03-10 00:13:42 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2010-03-10 00:13:42 +0000 |
commit | e6201784362534cd76c8f09ceaa2fb0ae14e8bf7 (patch) | |
tree | b30cfdeee7488112de63c7e1ddd848f2a7237f2d /llvm/lib/CodeGen/PrologEpilogInserter.cpp | |
parent | bf9a4ad1ce1f6abab79ce78734ba465103c71f96 (diff) | |
download | llvm-e6201784362534cd76c8f09ceaa2fb0ae14e8bf7.zip llvm-e6201784362534cd76c8f09ceaa2fb0ae14e8bf7.tar.gz llvm-e6201784362534cd76c8f09ceaa2fb0ae14e8bf7.tar.bz2 |
Clear up the last (famous last words) frame index value reuse issues for Thumb1.
llvm-svn: 98109
Diffstat (limited to 'llvm/lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PrologEpilogInserter.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp index f50fd5a..2d54cd4 100644 --- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp +++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp @@ -57,6 +57,7 @@ bool PEI::runOnMachineFunction(MachineFunction &Fn) { const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo(); RS = TRI->requiresRegisterScavenging(Fn) ? new RegScavenger() : NULL; FrameIndexVirtualScavenging = TRI->requiresFrameIndexScavenging(Fn); + FrameConstantRegMap.clear(); // Get MachineModuleInfo so that we can track the construction of the // frame. @@ -693,8 +694,7 @@ void PEI::replaceFrameIndices(MachineFunction &Fn) { assert (FrameIndexVirtualScavenging && "Not scavenging, but virtual returned from " "eliminateFrameIndex()!"); - FrameConstantRegMap[VReg] = FrameConstantEntry(Value.second, - SPAdj); + FrameConstantRegMap[VReg] = FrameConstantEntry(Value, SPAdj); } // Reset the iterator if we were at the beginning of the BB. @@ -765,12 +765,12 @@ void PEI::scavengeFrameVirtualRegs(MachineFunction &Fn) { unsigned CurrentVirtReg = 0; unsigned CurrentScratchReg = 0; bool havePrevValue = false; - int PrevValue = 0; + TargetRegisterInfo::FrameIndexValue PrevValue(0,0); + TargetRegisterInfo::FrameIndexValue Value(0,0); MachineInstr *PrevLastUseMI = NULL; unsigned PrevLastUseOp = 0; bool trackingCurrentValue = false; int SPAdj = 0; - int Value = 0; // The instruction stream may change in the loop, so check BB->end() // directly. @@ -827,8 +827,11 @@ void PEI::scavengeFrameVirtualRegs(MachineFunction &Fn) { if (trackingCurrentValue) { SPAdj = (*Entry).second.second; Value = (*Entry).second.first; - } else - SPAdj = Value = 0; + } else { + SPAdj = 0; + Value.first = 0; + Value.second = 0; + } // If the scratch register from the last allocation is still // available, see if the value matches. If it does, just re-use it. |