Gracefully handle invalid live ranges. Fix PR9831.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 3 May 2011 20:42:13 +0000 (20:42 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 3 May 2011 20:42:13 +0000 (20:42 +0000)
commit7d6b6a05b549da70b4473f015c97954c2a422724
treee680a75be37810632e1b8755158e6ad70dba67be
parentad20681cdeaf72383891b153b925624aa585be4d
Gracefully handle invalid live ranges. Fix PR9831.

Register coalescing can sometimes create live ranges that end in the middle of a
basic block without any killing instruction. When SplitKit detects this, it will
repair the live range by shrinking it to its uses.

Live range splitting also needs to know about this. When the range shrinks so
much that it becomes allocatable, live range splitting fails because it can't
find a good split point. It is paranoid about making progress, so an allocatable
range is considered an error.

The coalescer should really not be creating these bad live ranges. They appear
when coalescing dead copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130787 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegAllocGreedy.cpp
lib/CodeGen/SplitKit.cpp
lib/CodeGen/SplitKit.h