diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-08-11 21:00:42 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-08-11 21:00:42 +0000 |
| commit | 751933675263382de42f7be95c1058589f0ea41e (patch) | |
| tree | 9e36ee0dd6d034e2c5ec8b4c6a23b3f7821df45d /llvm/lib/CodeGen | |
| parent | 9767347b11bfeac631f477d3965f5f1f3ef4ee72 (diff) | |
| download | bcm5719-llvm-751933675263382de42f7be95c1058589f0ea41e.tar.gz bcm5719-llvm-751933675263382de42f7be95c1058589f0ea41e.zip | |
Privatize an unused part of the LiveIntervalUnion::Query interface.
No clients are iterating over interference overlaps.
llvm-svn: 137350
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/LiveIntervalUnion.h | 29 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocBasic.cpp | 3 |
2 files changed, 13 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalUnion.h b/llvm/lib/CodeGen/LiveIntervalUnion.h index a024bde5815..7f494474f99 100644 --- a/llvm/lib/CodeGen/LiveIntervalUnion.h +++ b/llvm/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/llvm/lib/CodeGen/RegAllocBasic.cpp b/llvm/lib/CodeGen/RegAllocBasic.cpp index a97b9b6b40c..5496d69fd3d 100644 --- a/llvm/lib/CodeGen/RegAllocBasic.cpp +++ b/llvm/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. |

