[llvm-commits] [llvm] r137350 - in /llvm/trunk/lib/CodeGen: LiveIntervalUnion.h RegAllocBasic.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Thu Aug 11 14:00:43 PDT 2011
Author: stoklund
Date: Thu Aug 11 16:00:42 2011
New Revision: 137350
URL: http://llvm.org/viewvc/llvm-project?rev=137350&view=rev
Log:
Privatize an unused part of the LiveIntervalUnion::Query interface.
No clients are iterating over interference overlaps.
Modified:
llvm/trunk/lib/CodeGen/LiveIntervalUnion.h
llvm/trunk/lib/CodeGen/RegAllocBasic.cpp
Modified: llvm/trunk/lib/CodeGen/LiveIntervalUnion.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalUnion.h?rev=137350&r1=137349&r2=137350&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalUnion.h (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalUnion.h Thu Aug 11 16:00:42 2011
@@ -187,27 +187,9 @@
return *VirtReg;
}
- bool isInterference(const InterferenceResult &IR) const {
- if (IR.VirtRegI != VirtReg->end()) {
- assert(overlap(*IR.VirtRegI, IR.LiveUnionI) &&
- "invalid segment iterators");
- return true;
- }
- return false;
- }
-
// Does this live virtual register interfere with the union?
bool checkInterference() { return isInterference(firstInterference()); }
- // Get the first pair of interfering segments, or a noninterfering result.
- // This initializes the firstInterference_ cache.
- const InterferenceResult &firstInterference();
-
- // Treat the result as an iterator and advance to the next interfering pair
- // of segments. Visiting each unique interfering pairs means that the same
- // VirtReg or LiveUnion segment may be visited multiple times.
- bool nextInterference(InterferenceResult &IR) const;
-
// Count the virtual registers in this union that interfere with this
// query's live virtual register, up to maxInterferingRegs.
unsigned collectInterferingVRegs(unsigned MaxInterferingRegs = UINT_MAX);
@@ -235,7 +217,18 @@
void operator=(const Query&); // DO NOT IMPLEMENT
// Private interface for queries
+ const InterferenceResult &firstInterference();
+ bool nextInterference(InterferenceResult &IR) const;
void findIntersection(InterferenceResult &IR) const;
+
+ bool isInterference(const InterferenceResult &IR) const {
+ if (IR.VirtRegI != VirtReg->end()) {
+ assert(overlap(*IR.VirtRegI, IR.LiveUnionI) &&
+ "invalid segment iterators");
+ return true;
+ }
+ return false;
+ }
};
};
Modified: llvm/trunk/lib/CodeGen/RegAllocBasic.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBasic.cpp?rev=137350&r1=137349&r2=137350&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocBasic.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocBasic.cpp Thu Aug 11 16:00:42 2011
@@ -498,8 +498,9 @@
// Found an available register.
return PhysReg;
}
+ Queries[interfReg].collectInterferingVRegs(1);
LiveInterval *interferingVirtReg =
- Queries[interfReg].firstInterference().liveUnionPos().value();
+ Queries[interfReg].interferingVRegs().front();
// The current VirtReg must either be spillable, or one of its interferences
// must have less spill weight.
More information about the llvm-commits
mailing list