summaryrefslogtreecommitdiff
path: root/lib/CodeGen/PrologEpilogInserter.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2009-10-20 16:33:57 +0000
committerJim Grosbach <grosbach@apple.com>2009-10-20 16:33:57 +0000
commitf7a0c0de6d73df8f24438234485b7950323b3d44 (patch)
treea46f99593917ec091be2f8eab37f55e63f25c189 /lib/CodeGen/PrologEpilogInserter.cpp
parent1a49295eae19cb70b451d513aceddc12ba6aaa61 (diff)
downloadllvm-f7a0c0de6d73df8f24438234485b7950323b3d44.tar.gz
llvm-f7a0c0de6d73df8f24438234485b7950323b3d44.tar.bz2
llvm-f7a0c0de6d73df8f24438234485b7950323b3d44.tar.xz
Register re-use for scavenged frame indices must check for re-deginition
of the register in the instruction which kills the scavenged value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r--lib/CodeGen/PrologEpilogInserter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp
index 693bf052a2..873d2372c5 100644
--- a/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/lib/CodeGen/PrologEpilogInserter.cpp
@@ -873,6 +873,10 @@ void PEI::scavengeFrameVirtualRegs(MachineFunction &Fn) {
PrevLastUseOp = i;
CurrentScratchReg = CurrentVirtReg = 0;
havePrevValue = trackingCurrentValue;
+ // Re-scan the operands of this instruction to catch definitions
+ // of the scratch register we're using. This is to handle things
+ // like ldr "r2, [scratch]" where scratch is r2.
+ i = 0;
}
}
RS->forward(MI);