diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-19 23:14:56 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-19 23:14:56 +0000 |
commit | 92e6939d29d206b5f094e0dcc4febf909f77a134 (patch) | |
tree | 5d4bb28d05fb137bd1ead7c5d2321e73276d7ec9 /lib | |
parent | 4121e8a0bd56a63e2d5186d99b62c7bd6afc9b5d (diff) | |
download | llvm-92e6939d29d206b5f094e0dcc4febf909f77a134.tar.gz llvm-92e6939d29d206b5f094e0dcc4febf909f77a134.tar.bz2 llvm-92e6939d29d206b5f094e0dcc4febf909f77a134.tar.xz |
Don't accidentally leave small gaps in the live ranges when leaving the active
interval after an instruction. The leaveIntvAfter() method only adds liveness
from the instruction's boundary index to the inserted copy.
Ideally, SplitKit should be smarter about this, perhaps by combining useIntv()
and leaveIntvAfter() into one method that guarantees continuity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123858 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/RegAllocGreedy.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp index fa3b5871fc..2083c4bdc4 100644 --- a/lib/CodeGen/RegAllocGreedy.cpp +++ b/lib/CodeGen/RegAllocGreedy.cpp @@ -757,7 +757,7 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg, } if (!BI.LiveThrough) { DEBUG(dbgs() << ", killed in block.\n"); - SE.useIntv(Start, BI.Kill); + SE.useIntv(Start, BI.Kill.getBoundaryIndex()); SE.leaveIntvAfter(BI.Kill); continue; } @@ -765,7 +765,7 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg, // Block is live-through, but exit bundle is on the stack. // Spill immediately after the last use. DEBUG(dbgs() << ", uses, stack-out.\n"); - SE.useIntv(Start, BI.LastUse); + SE.useIntv(Start, BI.LastUse.getBoundaryIndex()); SE.leaveIntvAfter(BI.LastUse); continue; } @@ -789,6 +789,7 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg, SlotIndex Use = std::lower_bound(SA->UseSlots.begin(), SA->UseSlots.end(), IP.second)[-1]; DEBUG(dbgs() << ", free use at " << Use << ".\n"); + Use = Use.getBoundaryIndex(); assert(Use >= BI.FirstUse && Use < IP.first); SE.useIntv(Start, Use); SE.leaveIntvAfter(Use); |