Index: src/IceRegAlloc.cpp |
diff --git a/src/IceRegAlloc.cpp b/src/IceRegAlloc.cpp |
index 69353a1df9bb20ff8dd3ee86cd8ed9b6f5ccc1db..589cd134428565ef469f77171f0eff4fedd6bf42 100644 |
--- a/src/IceRegAlloc.cpp |
+++ b/src/IceRegAlloc.cpp |
@@ -98,6 +98,7 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull) { |
// it was never referenced. |
if (Var->getLiveRange().isEmpty()) |
continue; |
+ Var->untrimLiveRange(); |
LiveRangeWrapper R(Var); |
Unhandled.insert(R); |
if (Var->hasReg()) { |
@@ -159,6 +160,7 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull) { |
Next = I; |
++Next; |
LiveRangeWrapper Item = *I; |
+ Item.Var->trimLiveRange(Cur.range().getStart()); |
bool Moved = false; |
if (Item.endsBefore(Cur)) { |
// Move Item from Active to Handled list. |
@@ -195,6 +197,16 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull) { |
Next = I; |
++Next; |
LiveRangeWrapper Item = *I; |
+ Item.Var->trimLiveRange(Cur.range().getStart()); |
+ // As an optimization, don't bother checking pure point-valued |
+ // Inactive ranges, because the overlapsStart() test will never |
+ // succeed, and the endsBefore() test will generally only |
+ // succeed after the last call instruction, which statistically |
+ // happens near the end. TODO(stichnot): Consider suppressing |
+ // this check every N iterations in case calls are only at the |
+ // beginning of the function. |
+ if (!Item.range().isNonpoints()) |
+ continue; |
if (Item.endsBefore(Cur)) { |
// Move Item from Inactive to Handled list. |
if (Verbose) { |