aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/IntervalMap.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-17 04:09:47 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-17 04:09:47 +0000
commitff2e9b4225ab55ee049b33158a9cce1ef138c2f7 (patch)
tree7013c10c1d0330b20f3255dceea1b20212921b6c /include/llvm/ADT/IntervalMap.h
parent5d2477cecf53bef911f57423a5cecb743d4286fa (diff)
downloadexternal_llvm-ff2e9b4225ab55ee049b33158a9cce1ef138c2f7.tar.gz
external_llvm-ff2e9b4225ab55ee049b33158a9cce1ef138c2f7.tar.bz2
external_llvm-ff2e9b4225ab55ee049b33158a9cce1ef138c2f7.zip
Provide LiveIntervalUnion::Query::checkLoopInterference.
This is a three-way interval list intersection between a virtual register, a live interval union, and a loop. It will be used to identify interference-free loops for live range splitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/IntervalMap.h')
-rw-r--r--include/llvm/ADT/IntervalMap.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/llvm/ADT/IntervalMap.h b/include/llvm/ADT/IntervalMap.h
index 86652f5673..3f7a4c7d89 100644
--- a/include/llvm/ADT/IntervalMap.h
+++ b/include/llvm/ADT/IntervalMap.h
@@ -940,6 +940,8 @@ class IntervalMap {
public:
typedef typename Sizer::Allocator Allocator;
+ typedef KeyT KeyType;
+ typedef ValT ValueType;
typedef Traits KeyTraits;
private:
@@ -2025,6 +2027,7 @@ iterator::overflow(unsigned Level) {
///
template <typename MapA, typename MapB>
class IntervalMapOverlaps {
+ typedef typename MapA::KeyType KeyType;
typedef typename MapA::KeyTraits Traits;
typename MapA::const_iterator posA;
typename MapB::const_iterator posB;
@@ -2065,6 +2068,20 @@ public:
/// b - access the right hand side in the overlap.
const typename MapB::const_iterator &b() const { return posB; }
+ /// start - Beginning of the overlapping interval.
+ KeyType start() const {
+ KeyType ak = a().start();
+ KeyType bk = b().start();
+ return Traits::startLess(ak, bk) ? bk : ak;
+ }
+
+ /// stop - End of the overlaping interval.
+ KeyType stop() const {
+ KeyType ak = a().stop();
+ KeyType bk = b().stop();
+ return Traits::startLess(ak, bk) ? ak : bk;
+ }
+
/// skipA - Move to the next overlap that doesn't involve a().
void skipA() {
++posA;
@@ -2094,8 +2111,15 @@ public:
skipA();
return *this;
}
-};
+ /// advanceTo - Move to the first overlapping interval with
+ /// stopLess(x, stop()).
+ void advanceTo(KeyType x) {
+ posA.advanceTo(x);
+ posB.advanceTo(x);
+ advance();
+ }
+};
} // namespace llvm