diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/LiveIntervalUnion.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/LiveIntervalUnion.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/LiveIntervalUnion.cpp b/contrib/llvm-project/llvm/lib/CodeGen/LiveIntervalUnion.cpp index 50b31e1eb247..11a4ecf0bef9 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/LiveIntervalUnion.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/LiveIntervalUnion.cpp @@ -26,7 +26,8 @@ using namespace llvm; #define DEBUG_TYPE "regalloc" // Merge a LiveInterval's segments. Guarantee no overlaps. -void LiveIntervalUnion::unify(LiveInterval &VirtReg, const LiveRange &Range) { +void LiveIntervalUnion::unify(const LiveInterval &VirtReg, + const LiveRange &Range) { if (Range.empty()) return; ++Tag; @@ -53,7 +54,8 @@ void LiveIntervalUnion::unify(LiveInterval &VirtReg, const LiveRange &Range) { } // Remove a live virtual register's segments from this union. -void LiveIntervalUnion::extract(LiveInterval &VirtReg, const LiveRange &Range) { +void LiveIntervalUnion::extract(const LiveInterval &VirtReg, + const LiveRange &Range) { if (Range.empty()) return; ++Tag; @@ -99,7 +101,7 @@ void LiveIntervalUnion::verify(LiveVirtRegBitSet& VisitedVRegs) { } #endif //!NDEBUG -LiveInterval *LiveIntervalUnion::getOneVReg() const { +const LiveInterval *LiveIntervalUnion::getOneVReg() const { if (empty()) return nullptr; for (LiveSegments::const_iterator SI = Segments.begin(); SI.valid(); ++SI) { @@ -111,7 +113,8 @@ LiveInterval *LiveIntervalUnion::getOneVReg() const { // Scan the vector of interfering virtual registers in this union. Assume it's // quite small. -bool LiveIntervalUnion::Query::isSeenInterference(LiveInterval *VirtReg) const { +bool LiveIntervalUnion::Query::isSeenInterference( + const LiveInterval *VirtReg) const { return is_contained(InterferingVRegs, VirtReg); } @@ -147,14 +150,14 @@ LiveIntervalUnion::Query::collectInterferingVRegs(unsigned MaxInterferingRegs) { } LiveRange::const_iterator LREnd = LR->end(); - LiveInterval *RecentReg = nullptr; + const LiveInterval *RecentReg = nullptr; while (LiveUnionI.valid()) { assert(LRI != LREnd && "Reached end of LR"); // Check for overlapping interference. while (LRI->start < LiveUnionI.stop() && LRI->end > LiveUnionI.start()) { // This is an overlap, record the interfering register. - LiveInterval *VReg = LiveUnionI.value(); + const LiveInterval *VReg = LiveUnionI.value(); if (VReg != RecentReg && !isSeenInterference(VReg)) { RecentReg = VReg; InterferingVRegs.push_back(VReg); |