X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FLiveInterval.cpp;h=dccd847d070c8bbc74bdca81f2438d355fd1ec25;hb=46abfcf4187432da728cbe452c32143da077e07f;hp=54f0da008b7e0990112e7e18bbfe18dcaa4e798f;hpb=d983d4c6ed5ef69ca2d2e07350cc346245f35b87;p=oota-llvm.git diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index 54f0da008b7..dccd847d070 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -464,10 +464,12 @@ void LiveInterval::join(LiveInterval &Other, ranges.erase(OutIt, end()); } - // Remember assignements because val# ids are changing. - SmallVector OtherAssignments; + // Rewrite Other values before changing the VNInfo ids. + // This can leave Other in an invalid state because we're not coalescing + // touching segments that now have identical values. That's OK since Other is + // not supposed to be valid after calling join(); for (iterator I = Other.begin(), E = Other.end(); I != E; ++I) - OtherAssignments.push_back(RHSValNoAssignments[I->valno->id]); + I->valno = NewVNInfo[RHSValNoAssignments[I->valno->id]]; // Update val# info. Renumber them and make sure they all belong to this // LiveInterval now. Also remove dead val#'s. @@ -487,13 +489,8 @@ void LiveInterval::join(LiveInterval &Other, // Okay, now insert the RHS live ranges into the LHS. LiveRangeUpdater Updater(this); - unsigned RangeNo = 0; - for (iterator I = Other.begin(), E = Other.end(); I != E; ++I, ++RangeNo) { - // Map the valno in the other live range to the current live range. - VNInfo *VNI = NewVNInfo[OtherAssignments[RangeNo]]; - assert(VNI && "Adding a dead range?"); - Updater.add(I->start, I->end, VNI); - } + for (iterator I = Other.begin(), E = Other.end(); I != E; ++I) + Updater.add(*I); } /// MergeRangesInAsValue - Merge all of the intervals in RHS into this live