Check that a live range exists before shortening it. This fixes PR8989.

The live range may have been deleted earlier because of rematerialization.

llvm-svn: 123891
This commit is contained in:
Jakob Stoklund Olesen 2011-01-20 06:20:02 +00:00
parent 145755f1d6
commit 4060abb4b9
1 changed files with 5 additions and 3 deletions

View File

@ -1685,9 +1685,11 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
DoDelete = false;
if (MI->allDefsAreDead()) {
LiveInterval &li = li_->getInterval(SrcReg);
if (!ShortenDeadCopySrcLiveRange(li, MI))
ShortenDeadCopyLiveRange(li, MI);
if (li_->hasInterval(SrcReg)) {
LiveInterval &li = li_->getInterval(SrcReg);
if (!ShortenDeadCopySrcLiveRange(li, MI))
ShortenDeadCopyLiveRange(li, MI);
}
DoDelete = true;
}
if (!DoDelete) {