aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/PrologEpilogInserter.cpp
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2015-02-01 16:15:07 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2015-02-01 16:15:07 +0000
commite86aa9a8a455f90bf3d6dc567b9e39b2e4510246 (patch)
treee727b02e6da5596b9d3cce6b6f77155337ae2aa3 /llvm/lib/CodeGen/PrologEpilogInserter.cpp
parente6698d5305a29a186e035ab737931a139d70bcd2 (diff)
downloadllvm-e86aa9a8a455f90bf3d6dc567b9e39b2e4510246.zip
llvm-e86aa9a8a455f90bf3d6dc567b9e39b2e4510246.tar.gz
llvm-e86aa9a8a455f90bf3d6dc567b9e39b2e4510246.tar.bz2
Revert r227728 due to bad line endings.
llvm-svn: 227746
Diffstat (limited to 'llvm/lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r--llvm/lib/CodeGen/PrologEpilogInserter.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
index 61407fa..385e5a3 100644
--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -703,8 +703,7 @@ void PEI::insertPrologEpilogCode(MachineFunction &Fn) {
/// register references and actual offsets.
///
void PEI::replaceFrameIndices(MachineFunction &Fn) {
- const TargetFrameLowering &TFI = *Fn.getSubtarget().getFrameLowering();
- if (!TFI.needsFrameIndexResolution(Fn)) return;
+ if (!Fn.getFrameInfo()->hasStackObjects()) return; // Nothing to do?
// Store SPAdj at exit of a basic block.
SmallVector<int, 8> SPState;
@@ -770,6 +769,13 @@ void PEI::replaceFrameIndices(MachineBasicBlock *BB, MachineFunction &Fn,
continue;
}
+ // If we are looking at a call sequence, we need to keep track of
+ // the SP adjustment made by each instruction in the sequence.
+ // This includes both the frame setup/destroy pseudos (handled above),
+ // as well as other instructions that have side effects w.r.t the SP.
+ if (InsideCallSequence)
+ SPAdj += TII.getSPAdjust(I);
+
MachineInstr *MI = I;
bool DoIncr = true;
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
@@ -848,16 +854,6 @@ void PEI::replaceFrameIndices(MachineBasicBlock *BB, MachineFunction &Fn,
break;
}
- // If we are looking at a call sequence, we need to keep track of
- // the SP adjustment made by each instruction in the sequence.
- // This includes both the frame setup/destroy pseudos (handled above),
- // as well as other instructions that have side effects w.r.t the SP.
- // Note that this must come after eliminateFrameIndex, because
- // if I itself referred to a frame index, we shouldn't count its own
- // adjustment.
- if (MI && InsideCallSequence)
- SPAdj += TII.getSPAdjust(MI);
-
if (DoIncr && I != BB->end()) ++I;
// Update register states.