forked from OSchip/llvm-project
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:
parent
145755f1d6
commit
4060abb4b9
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue