diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-20 06:20:02 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-20 06:20:02 +0000 |
| commit | 4060abb4b91e76657fe36c924560784582b9d332 (patch) | |
| tree | 637e39fe3e5a5757a81bd12621b6354731527747 /llvm/lib/CodeGen | |
| parent | 145755f1d60909407ea4382c0b120871541002c5 (diff) | |
| download | bcm5719-llvm-4060abb4b91e76657fe36c924560784582b9d332.tar.gz bcm5719-llvm-4060abb4b91e76657fe36c924560784582b9d332.zip | |
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
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index e616d3536fe..a859f6e0745 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -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) { |

