Kill info update bugs.
authorEvan Cheng <evan.cheng@apple.com>
Tue, 14 Aug 2007 01:56:58 +0000 (01:56 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 14 Aug 2007 01:56:58 +0000 (01:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41064 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveInterval.cpp
lib/CodeGen/SimpleRegisterCoalescing.cpp

index d60c3b1b63fdf9ffbf5105eb913d55bc6c42a7d5..9697d43bb4d763e671056f57185f46fd2eace488 100644 (file)
@@ -109,6 +109,7 @@ bool LiveInterval::overlapsFrom(const LiveInterval& other,
 void LiveInterval::extendIntervalEndTo(Ranges::iterator I, unsigned NewEnd) {
   assert(I != ranges.end() && "Not a valid interval!");
   unsigned ValId = I->ValId;
+  unsigned OldEnd = I->end;
 
   // Search for the first interval that we can't merge with.
   Ranges::iterator MergeTo = next(I);
@@ -123,7 +124,7 @@ void LiveInterval::extendIntervalEndTo(Ranges::iterator I, unsigned NewEnd) {
   ranges.erase(next(I), MergeTo);
 
   // Update kill info.
-  removeKillForValNum(ValId, I->start, I->end-1);
+  removeKillForValNum(ValId, OldEnd, I->end-1);
 
   // If the newly formed range now touches the range after it and if they have
   // the same value number, merge the two ranges into one range.
index fef2fde32aed9a7040eaf1ff614e1874082aa182..fc88ffed5010852a476a5cad2fa8b08bb6344f31 100644 (file)
@@ -559,8 +559,8 @@ bool SimpleRegisterCoalescing::SimpleJoin(LiveInterval &LHS, LiveInterval &RHS)
   
   // Okay, the final step is to loop over the RHS live intervals, adding them to
   // the LHS.
-  LHS.MergeRangesInAsValue(RHS, LHSValNo);
   LHS.addKillsForValNum(LHSValNo, VNI.kills);
+  LHS.MergeRangesInAsValue(RHS, LHSValNo);
   LHS.weight += RHS.weight;
   if (RHS.preference && !LHS.preference)
     LHS.preference = RHS.preference;