summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-11 21:00:42 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-11 21:00:42 +0000
commit98985f959c57f2b8c0b6e4b5ee519252e71e9cd9 (patch)
treeffaab03edb03aa9c24b210c065993fc637d02343
parent508e1d3db536b736063385eb1f885b446a1385ca (diff)
downloadllvm-98985f959c57f2b8c0b6e4b5ee519252e71e9cd9.tar.gz
llvm-98985f959c57f2b8c0b6e4b5ee519252e71e9cd9.tar.bz2
llvm-98985f959c57f2b8c0b6e4b5ee519252e71e9cd9.tar.xz
Privatize an unused part of the LiveIntervalUnion::Query interface.
No clients are iterating over interference overlaps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137350 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/LiveIntervalUnion.h29
-rw-r--r--lib/CodeGen/RegAllocBasic.cpp3
2 files changed, 13 insertions, 19 deletions
diff --git a/lib/CodeGen/LiveIntervalUnion.h b/lib/CodeGen/LiveIntervalUnion.h
index a024bde581..7f494474f9 100644
--- a/lib/CodeGen/LiveIntervalUnion.h
+++ b/lib/CodeGen/LiveIntervalUnion.h
@@ -187,27 +187,9 @@ public:
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 @@ public:
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;
+ }
};
};
diff --git a/lib/CodeGen/RegAllocBasic.cpp b/lib/CodeGen/RegAllocBasic.cpp
index a97b9b6b40..5496d69fd3 100644
--- a/lib/CodeGen/RegAllocBasic.cpp
+++ b/lib/CodeGen/RegAllocBasic.cpp
@@ -498,8 +498,9 @@ unsigned RABasic::selectOrSplit(LiveInterval &VirtReg,
// 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.