summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocGreedy.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-26 00:54:56 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-26 00:54:56 +0000
commit165e231c4295deb5cabd124d08e231b551bcc0b2 (patch)
treedab1609dcdb585c28624226a3389e9aa14f7c7cc /lib/CodeGen/RegAllocGreedy.cpp
parent28c85a81a17dd719a254dc00cbeb484774893197 (diff)
downloadllvm-165e231c4295deb5cabd124d08e231b551bcc0b2.tar.gz
llvm-165e231c4295deb5cabd124d08e231b551bcc0b2.tar.bz2
llvm-165e231c4295deb5cabd124d08e231b551bcc0b2.tar.xz
Revert to RA_Assign when a virtreg separates into components.
When dead code elimination deletes a PHI value, the virtual register may split into multiple connected components. In that case, revert each component to the RS_Assign stage. The new components are guaranteed to be smaller (the original value numbers are distributed among the components), so this will always be making progress. The components are now allowed to evict other live ranges or be split again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r--lib/CodeGen/RegAllocGreedy.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp
index 147e803534..d0b40dd113 100644
--- a/lib/CodeGen/RegAllocGreedy.cpp
+++ b/lib/CodeGen/RegAllocGreedy.cpp
@@ -341,8 +341,10 @@ void RAGreedy::LRE_WillShrinkVirtReg(unsigned VirtReg) {
void RAGreedy::LRE_DidCloneVirtReg(unsigned New, unsigned Old) {
// LRE may clone a virtual register because dead code elimination causes it to
- // be split into connected components. Ensure that the new register gets the
+ // be split into connected components. The new components are much smaller
+ // than the original, so they should get a new chance at being assigned.
// same stage as the parent.
+ ExtraRegInfo[Old].Stage = RS_Assign;
ExtraRegInfo.grow(New);
ExtraRegInfo[New] = ExtraRegInfo[Old];
}