Add a LiveRangeEdit delegate callback before shrinking a live range.
The register allocator needs to adjust its live interval unions when that happens.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127774 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/LiveRangeEdit.cpp b/lib/CodeGen/LiveRangeEdit.cpp
index e994d8c..489d88c 100644
--- a/lib/CodeGen/LiveRangeEdit.cpp
+++ b/lib/CodeGen/LiveRangeEdit.cpp
@@ -201,8 +201,11 @@
break;
// Shrink just one live interval. Then delete new dead defs.
- LIS.shrinkToUses(ToShrink.back(), &Dead);
+ LiveInterval *LI = ToShrink.back();
ToShrink.pop_back();
+ if (delegate_)
+ delegate_->LRE_WillShrinkVirtReg(LI->reg);
+ LIS.shrinkToUses(LI, &Dead);
}
}