summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocGreedy.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-09-14 17:34:37 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-09-14 17:34:37 +0000
commit0d4fea786670473b53d285be378e619399e03488 (patch)
tree92e58e154d4b2689c5ccd70c818b11970944f677 /lib/CodeGen/RegAllocGreedy.cpp
parent1c0b24f91a5a6f3aeca483e753e7fd27357ecb71 (diff)
downloadllvm-0d4fea786670473b53d285be378e619399e03488.tar.gz
llvm-0d4fea786670473b53d285be378e619399e03488.tar.bz2
llvm-0d4fea786670473b53d285be378e619399e03488.tar.xz
Ignore the cloning of unknown registers.
THe LRE_DidCloneVirtReg callback may be called with vitual registers that RAGreedy doesn't even know about yet. In that case, there are no data structures to update. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139702 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r--lib/CodeGen/RegAllocGreedy.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp
index 08767a0d05..f54a2c85d1 100644
--- a/lib/CodeGen/RegAllocGreedy.cpp
+++ b/lib/CodeGen/RegAllocGreedy.cpp
@@ -377,6 +377,10 @@ void RAGreedy::LRE_WillShrinkVirtReg(unsigned VirtReg) {
}
void RAGreedy::LRE_DidCloneVirtReg(unsigned New, unsigned Old) {
+ // Cloning a register we haven't even heard about yet? Just ignore it.
+ if (!ExtraRegInfo.inBounds(Old))
+ return;
+
// LRE may clone a virtual register because dead code elimination causes it to
// be split into connected components. The new components are much smaller
// than the original, so they should get a new chance at being assigned.