From: Jakob Stoklund Olesen Date: Wed, 8 Dec 2010 23:51:35 +0000 (+0000) Subject: Properly deal with empty intervals when checking for interference. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9b0c4f8af3e303c85ddb5ff0ee2c8e27a4d77203;p=oota-llvm.git Properly deal with empty intervals when checking for interference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121319 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/LiveIntervalUnion.cpp b/lib/CodeGen/LiveIntervalUnion.cpp index bedf22b5bad..4b9a2d302c0 100644 --- a/lib/CodeGen/LiveIntervalUnion.cpp +++ b/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/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp index c88d474315e..f69979bf2aa 100644 --- a/lib/CodeGen/RegAllocGreedy.cpp +++ b/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();