diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-08 23:51:35 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-08 23:51:35 +0000 |
commit | 8c5f0c3115d3066bf35b5e0c2456356d8dbb6c07 (patch) | |
tree | be466577f2f4002baa52a3c853d966599d47c1ba /llvm/lib | |
parent | bbedd062c9050a5ddd92398b10d3f9e73adfb1c1 (diff) | |
download | bcm5719-llvm-8c5f0c3115d3066bf35b5e0c2456356d8dbb6c07.tar.gz bcm5719-llvm-8c5f0c3115d3066bf35b5e0c2456356d8dbb6c07.zip |
Properly deal with empty intervals when checking for interference.
llvm-svn: 121319
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalUnion.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/RegAllocGreedy.cpp | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalUnion.cpp b/llvm/lib/CodeGen/LiveIntervalUnion.cpp index bedf22b5bad..4b9a2d302c0 100644 --- a/llvm/lib/CodeGen/LiveIntervalUnion.cpp +++ b/llvm/lib/CodeGen/LiveIntervalUnion.cpp @@ -111,9 +111,10 @@ void LiveIntervalUnion::verify(LiveVirtRegBitSet& VisitedVRegs) { // Assumes that segments are sorted by start position in both // LiveInterval and LiveSegments. void LiveIntervalUnion::Query::findIntersection(InterferenceResult &IR) const { - // Search until reaching the end of the LiveUnion segments. LiveInterval::iterator VirtRegEnd = VirtReg->end(); + if (IR.VirtRegI == VirtRegEnd) + return; while (IR.LiveUnionI.valid()) { // Slowly advance the live virtual reg iterator until we surpass the next // segment in LiveUnion. diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index c88d474315e..f69979bf2aa 100644 --- a/llvm/lib/CodeGen/RegAllocGreedy.cpp +++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp @@ -173,6 +173,7 @@ unsigned RAGreedy::selectOrSplit(LiveInterval &VirtReg, // Found an available register. return PhysReg; } + assert(!VirtReg.empty() && "Empty VirtReg has interference"); LiveInterval *interferingVirtReg = Queries[interfReg].firstInterference().liveUnionPos().value(); |