summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-11 21:18:34 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-08-11 21:18:34 +0000
commit9942ba9c0ed45c77298cdeb7a9326f04745d5709 (patch)
tree90c15cbb229741af822e7bdf3b114bcc2d77c195
parent7b8f46cf9e31d730acc25be771462e2a6a1a1dfb (diff)
downloadllvm-9942ba9c0ed45c77298cdeb7a9326f04745d5709.tar.gz
llvm-9942ba9c0ed45c77298cdeb7a9326f04745d5709.tar.bz2
llvm-9942ba9c0ed45c77298cdeb7a9326f04745d5709.tar.xz
Remove more dead code.
collectInterferingVRegs will be the primary function for interference checks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137354 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/LiveIntervalUnion.cpp28
-rw-r--r--lib/CodeGen/LiveIntervalUnion.h12
2 files changed, 3 insertions, 37 deletions
diff --git a/lib/CodeGen/LiveIntervalUnion.cpp b/lib/CodeGen/LiveIntervalUnion.cpp
index b30e169ee0..cf5fb6a09f 100644
--- a/lib/CodeGen/LiveIntervalUnion.cpp
+++ b/lib/CodeGen/LiveIntervalUnion.cpp
@@ -181,32 +181,6 @@ LiveIntervalUnion::Query::firstInterference() {
return FirstInterference;
}
-// Treat the result as an iterator and advance to the next interfering pair
-// of segments. This is a plain iterator with no filter.
-bool LiveIntervalUnion::Query::nextInterference(InterferenceResult &IR) const {
- assert(isInterference(IR) && "iteration past end of interferences");
-
- // Advance either the VirtReg or LiveUnion segment to ensure that we visit all
- // unique overlapping pairs.
- if (IR.VirtRegI->end < IR.LiveUnionI.stop()) {
- if (++IR.VirtRegI == VirtReg->end())
- return false;
- }
- else {
- if (!(++IR.LiveUnionI).valid()) {
- IR.VirtRegI = VirtReg->end();
- return false;
- }
- }
- // Short-circuit findIntersection() if possible.
- if (overlap(*IR.VirtRegI, IR.LiveUnionI))
- return true;
-
- // Find the next intersection.
- findIntersection(IR);
- return isInterference(IR);
-}
-
// Scan the vector of interfering virtual registers in this union. Assume it's
// quite small.
bool LiveIntervalUnion::Query::isSeenInterference(LiveInterval *VirtReg) const {
@@ -226,6 +200,8 @@ bool LiveIntervalUnion::Query::isSeenInterference(LiveInterval *VirtReg) const {
// For comments on how to speed it up, see Query::findIntersection().
unsigned LiveIntervalUnion::Query::
collectInterferingVRegs(unsigned MaxInterferingRegs) {
+ if (InterferingVRegs.size() >= MaxInterferingRegs)
+ return InterferingVRegs.size();
InterferenceResult IR = firstInterference();
LiveInterval::iterator VirtRegEnd = VirtReg->end();
LiveInterval *RecentInterferingVReg = NULL;
diff --git a/lib/CodeGen/LiveIntervalUnion.h b/lib/CodeGen/LiveIntervalUnion.h
index 7f494474f9..570ad94b77 100644
--- a/lib/CodeGen/LiveIntervalUnion.h
+++ b/lib/CodeGen/LiveIntervalUnion.h
@@ -188,7 +188,7 @@ public:
}
// Does this live virtual register interfere with the union?
- bool checkInterference() { return isInterference(firstInterference()); }
+ bool checkInterference() { return collectInterferingVRegs(1); }
// Count the virtual registers in this union that interfere with this
// query's live virtual register, up to maxInterferingRegs.
@@ -218,17 +218,7 @@ public:
// 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;
- }
};
};