Deleted Added
full compact
LiveIntervalUnion.cpp (221345) LiveIntervalUnion.cpp (224145)
1//===-- LiveIntervalUnion.cpp - Live interval union data structure --------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 230 unchanged lines hidden (view full) ---

239//
240// The number of times that we either advance IR.VirtRegI or call
241// LiveUnion.upperBound() will be no more than the number of holes in
242// VirtReg. So each invocation of collectInterferingVRegs() takes
243// time proportional to |VirtReg Holes| * time(LiveUnion.upperBound()).
244//
245// For comments on how to speed it up, see Query::findIntersection().
246unsigned LiveIntervalUnion::Query::
1//===-- LiveIntervalUnion.cpp - Live interval union data structure --------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 230 unchanged lines hidden (view full) ---

239//
240// The number of times that we either advance IR.VirtRegI or call
241// LiveUnion.upperBound() will be no more than the number of holes in
242// VirtReg. So each invocation of collectInterferingVRegs() takes
243// time proportional to |VirtReg Holes| * time(LiveUnion.upperBound()).
244//
245// For comments on how to speed it up, see Query::findIntersection().
246unsigned LiveIntervalUnion::Query::
247collectInterferingVRegs(unsigned MaxInterferingRegs, float MaxWeight) {
247collectInterferingVRegs(unsigned MaxInterferingRegs) {
248 InterferenceResult IR = firstInterference();
249 LiveInterval::iterator VirtRegEnd = VirtReg->end();
250 LiveInterval *RecentInterferingVReg = NULL;
251 if (IR.VirtRegI != VirtRegEnd) while (IR.LiveUnionI.valid()) {
252 // Advance the union's iterator to reach an unseen interfering vreg.
253 do {
254 if (IR.LiveUnionI.value() == RecentInterferingVReg)
255 continue;

--- 26 unchanged lines hidden (view full) ---

282 return MaxInterferingRegs;
283
284 InterferingVRegs.push_back(IR.LiveUnionI.value());
285
286 // Cache the most recent interfering vreg to bypass isSeenInterference.
287 RecentInterferingVReg = IR.LiveUnionI.value();
288 ++IR.LiveUnionI;
289
248 InterferenceResult IR = firstInterference();
249 LiveInterval::iterator VirtRegEnd = VirtReg->end();
250 LiveInterval *RecentInterferingVReg = NULL;
251 if (IR.VirtRegI != VirtRegEnd) while (IR.LiveUnionI.valid()) {
252 // Advance the union's iterator to reach an unseen interfering vreg.
253 do {
254 if (IR.LiveUnionI.value() == RecentInterferingVReg)
255 continue;

--- 26 unchanged lines hidden (view full) ---

282 return MaxInterferingRegs;
283
284 InterferingVRegs.push_back(IR.LiveUnionI.value());
285
286 // Cache the most recent interfering vreg to bypass isSeenInterference.
287 RecentInterferingVReg = IR.LiveUnionI.value();
288 ++IR.LiveUnionI;
289
290 // Stop collecting when the max weight is exceeded.
291 if (RecentInterferingVReg->weight >= MaxWeight)
292 return InterferingVRegs.size();
293
294 continue;
295 }
296 // VirtRegI may have advanced far beyond LiveUnionI,
297 // do a fast intersection test to "catch up"
298 IR.LiveUnionI.advanceTo(IR.VirtRegI->start);
299 }
300 SeenAllInterferences = true;
301 return InterferingVRegs.size();

--- 28 unchanged lines hidden ---
290 continue;
291 }
292 // VirtRegI may have advanced far beyond LiveUnionI,
293 // do a fast intersection test to "catch up"
294 IR.LiveUnionI.advanceTo(IR.VirtRegI->start);
295 }
296 SeenAllInterferences = true;
297 return InterferingVRegs.size();

--- 28 unchanged lines hidden ---