Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/ADT/IntervalMap.h
Line
Count
Source (jump to first uncovered line)
1
//===- llvm/ADT/IntervalMap.h - A sorted interval map -----------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file implements a coalescing interval map for small objects.
10
//
11
// KeyT objects are mapped to ValT objects. Intervals of keys that map to the
12
// same value are represented in a compressed form.
13
//
14
// Iterators provide ordered access to the compressed intervals rather than the
15
// individual keys, and insert and erase operations use key intervals as well.
16
//
17
// Like SmallVector, IntervalMap will store the first N intervals in the map
18
// object itself without any allocations. When space is exhausted it switches to
19
// a B+-tree representation with very small overhead for small key and value
20
// objects.
21
//
22
// A Traits class specifies how keys are compared. It also allows IntervalMap to
23
// work with both closed and half-open intervals.
24
//
25
// Keys and values are not stored next to each other in a std::pair, so we don't
26
// provide such a value_type. Dereferencing iterators only returns the mapped
27
// value. The interval bounds are accessible through the start() and stop()
28
// iterator methods.
29
//
30
// IntervalMap is optimized for small key and value objects, 4 or 8 bytes each
31
// is the optimal size. For large objects use std::map instead.
32
//
33
//===----------------------------------------------------------------------===//
34
//
35
// Synopsis:
36
//
37
// template <typename KeyT, typename ValT, unsigned N, typename Traits>
38
// class IntervalMap {
39
// public:
40
//   typedef KeyT key_type;
41
//   typedef ValT mapped_type;
42
//   typedef RecyclingAllocator<...> Allocator;
43
//   class iterator;
44
//   class const_iterator;
45
//
46
//   explicit IntervalMap(Allocator&);
47
//   ~IntervalMap():
48
//
49
//   bool empty() const;
50
//   KeyT start() const;
51
//   KeyT stop() const;
52
//   ValT lookup(KeyT x, Value NotFound = Value()) const;
53
//
54
//   const_iterator begin() const;
55
//   const_iterator end() const;
56
//   iterator begin();
57
//   iterator end();
58
//   const_iterator find(KeyT x) const;
59
//   iterator find(KeyT x);
60
//
61
//   void insert(KeyT a, KeyT b, ValT y);
62
//   void clear();
63
// };
64
//
65
// template <typename KeyT, typename ValT, unsigned N, typename Traits>
66
// class IntervalMap::const_iterator :
67
//   public std::iterator<std::bidirectional_iterator_tag, ValT> {
68
// public:
69
//   bool operator==(const const_iterator &) const;
70
//   bool operator!=(const const_iterator &) const;
71
//   bool valid() const;
72
//
73
//   const KeyT &start() const;
74
//   const KeyT &stop() const;
75
//   const ValT &value() const;
76
//   const ValT &operator*() const;
77
//   const ValT *operator->() const;
78
//
79
//   const_iterator &operator++();
80
//   const_iterator &operator++(int);
81
//   const_iterator &operator--();
82
//   const_iterator &operator--(int);
83
//   void goToBegin();
84
//   void goToEnd();
85
//   void find(KeyT x);
86
//   void advanceTo(KeyT x);
87
// };
88
//
89
// template <typename KeyT, typename ValT, unsigned N, typename Traits>
90
// class IntervalMap::iterator : public const_iterator {
91
// public:
92
//   void insert(KeyT a, KeyT b, Value y);
93
//   void erase();
94
// };
95
//
96
//===----------------------------------------------------------------------===//
97
98
#ifndef LLVM_ADT_INTERVALMAP_H
99
#define LLVM_ADT_INTERVALMAP_H
100
101
#include "llvm/ADT/PointerIntPair.h"
102
#include "llvm/ADT/SmallVector.h"
103
#include "llvm/ADT/bit.h"
104
#include "llvm/Support/AlignOf.h"
105
#include "llvm/Support/Allocator.h"
106
#include "llvm/Support/RecyclingAllocator.h"
107
#include <algorithm>
108
#include <cassert>
109
#include <cstdint>
110
#include <iterator>
111
#include <new>
112
#include <utility>
113
114
namespace llvm {
115
116
//===----------------------------------------------------------------------===//
117
//---                              Key traits                              ---//
118
//===----------------------------------------------------------------------===//
119
//
120
// The IntervalMap works with closed or half-open intervals.
121
// Adjacent intervals that map to the same value are coalesced.
122
//
123
// The IntervalMapInfo traits class is used to determine if a key is contained
124
// in an interval, and if two intervals are adjacent so they can be coalesced.
125
// The provided implementation works for closed integer intervals, other keys
126
// probably need a specialized version.
127
//
128
// The point x is contained in [a;b] when !startLess(x, a) && !stopLess(b, x).
129
//
130
// It is assumed that (a;b] half-open intervals are not used, only [a;b) is
131
// allowed. This is so that stopLess(a, b) can be used to determine if two
132
// intervals overlap.
133
//
134
//===----------------------------------------------------------------------===//
135
136
template <typename T>
137
struct IntervalMapInfo {
138
  /// startLess - Return true if x is not in [a;b].
139
  /// This is x < a both for closed intervals and for [a;b) half-open intervals.
140
  static inline bool startLess(const T &x, const T &a) {
141
    return x < a;
142
  }
143
144
  /// stopLess - Return true if x is not in [a;b].
145
  /// This is b < x for a closed interval, b <= x for [a;b) half-open intervals.
146
  static inline bool stopLess(const T &b, const T &x) {
147
    return b < x;
148
  }
149
150
  /// adjacent - Return true when the intervals [x;a] and [b;y] can coalesce.
151
  /// This is a+1 == b for closed intervals, a == b for half-open intervals.
152
  static inline bool adjacent(const T &a, const T &b) {
153
    return a+1 == b;
154
  }
155
156
  /// nonEmpty - Return true if [a;b] is non-empty.
157
  /// This is a <= b for a closed interval, a < b for [a;b) half-open intervals.
158
  static inline bool nonEmpty(const T &a, const T &b) {
159
    return a <= b;
160
  }
161
};
162
163
template <typename T>
164
struct IntervalMapHalfOpenInfo {
165
  /// startLess - Return true if x is not in [a;b).
166
3.33M
  static inline bool startLess(const T &x, const T &a) {
167
3.33M
    return x < a;
168
3.33M
  }
llvm::IntervalMapHalfOpenInfo<llvm::SlotIndex>::startLess(llvm::SlotIndex const&, llvm::SlotIndex const&)
Line
Count
Source
166
3.32M
  static inline bool startLess(const T &x, const T &a) {
167
3.32M
    return x < a;
168
3.32M
  }
llvm::IntervalMapHalfOpenInfo<long long>::startLess(long long const&, long long const&)
Line
Count
Source
166
1.16k
  static inline bool startLess(const T &x, const T &a) {
167
1.16k
    return x < a;
168
1.16k
  }
169
170
  /// stopLess - Return true if x is not in [a;b).
171
506M
  static inline bool stopLess(const T &b, const T &x) {
172
506M
    return b <= x;
173
506M
  }
llvm::IntervalMapHalfOpenInfo<llvm::SlotIndex>::stopLess(llvm::SlotIndex const&, llvm::SlotIndex const&)
Line
Count
Source
171
506M
  static inline bool stopLess(const T &b, const T &x) {
172
506M
    return b <= x;
173
506M
  }
llvm::IntervalMapHalfOpenInfo<long long>::stopLess(long long const&, long long const&)
Line
Count
Source
171
475k
  static inline bool stopLess(const T &b, const T &x) {
172
475k
    return b <= x;
173
475k
  }
174
175
  /// adjacent - Return true when the intervals [x;a) and [b;y) can coalesce.
176
13.4M
  static inline bool adjacent(const T &a, const T &b) {
177
13.4M
    return a == b;
178
13.4M
  }
llvm::IntervalMapHalfOpenInfo<llvm::SlotIndex>::adjacent(llvm::SlotIndex const&, llvm::SlotIndex const&)
Line
Count
Source
176
13.2M
  static inline bool adjacent(const T &a, const T &b) {
177
13.2M
    return a == b;
178
13.2M
  }
llvm::IntervalMapHalfOpenInfo<long long>::adjacent(long long const&, long long const&)
Line
Count
Source
176
220k
  static inline bool adjacent(const T &a, const T &b) {
177
220k
    return a == b;
178
220k
  }
179
180
  /// nonEmpty - Return true if [a;b) is non-empty.
181
  static inline bool nonEmpty(const T &a, const T &b) {
182
    return a < b;
183
  }
184
};
185
186
/// IntervalMapImpl - Namespace used for IntervalMap implementation details.
187
/// It should be considered private to the implementation.
188
namespace IntervalMapImpl {
189
190
using IdxPair = std::pair<unsigned,unsigned>;
191
192
//===----------------------------------------------------------------------===//
193
//---                    IntervalMapImpl::NodeBase                         ---//
194
//===----------------------------------------------------------------------===//
195
//
196
// Both leaf and branch nodes store vectors of pairs.
197
// Leaves store ((KeyT, KeyT), ValT) pairs, branches use (NodeRef, KeyT).
198
//
199
// Keys and values are stored in separate arrays to avoid padding caused by
200
// different object alignments. This also helps improve locality of reference
201
// when searching the keys.
202
//
203
// The nodes don't know how many elements they contain - that information is
204
// stored elsewhere. Omitting the size field prevents padding and allows a node
205
// to fill the allocated cache lines completely.
206
//
207
// These are typical key and value sizes, the node branching factor (N), and
208
// wasted space when nodes are sized to fit in three cache lines (192 bytes):
209
//
210
//   T1  T2   N Waste  Used by
211
//    4   4  24   0    Branch<4> (32-bit pointers)
212
//    8   4  16   0    Leaf<4,4>, Branch<4>
213
//    8   8  12   0    Leaf<4,8>, Branch<8>
214
//   16   4   9  12    Leaf<8,4>
215
//   16   8   8   0    Leaf<8,8>
216
//
217
//===----------------------------------------------------------------------===//
218
219
template <typename T1, typename T2, unsigned N>
220
class NodeBase {
221
public:
222
  enum { Capacity = N };
223
224
  T1 first[N];
225
  T2 second[N];
226
227
  /// copy - Copy elements from another node.
228
  /// @param Other Node elements are copied from.
229
  /// @param i     Beginning of the source range in other.
230
  /// @param j     Beginning of the destination range in this.
231
  /// @param Count Number of elements to copy.
232
  template <unsigned M>
233
  void copy(const NodeBase<T1, T2, M> &Other, unsigned i,
234
5.66M
            unsigned j, unsigned Count) {
235
5.66M
    assert(i + Count <= M && "Invalid source range");
236
5.66M
    assert(j + Count <= N && "Invalid dest range");
237
21.0M
    for (unsigned e = i + Count; i != e; 
++i, ++j15.3M
) {
238
15.3M
      first[j]  = Other.first[i];
239
15.3M
      second[j] = Other.second[i];
240
15.3M
    }
241
5.66M
  }
Unexecuted instantiation: void llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 4u>::copy<4u>(llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 4u> const&, unsigned int, unsigned int, unsigned int)
void llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>::copy<12u>(llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u> const&, unsigned int, unsigned int, unsigned int)
Line
Count
Source
234
64.6k
            unsigned j, unsigned Count) {
235
64.6k
    assert(i + Count <= M && "Invalid source range");
236
64.6k
    assert(j + Count <= N && "Invalid dest range");
237
393k
    for (unsigned e = i + Count; i != e; 
++i, ++j328k
) {
238
328k
      first[j]  = Other.first[i];
239
328k
      second[j] = Other.second[i];
240
328k
    }
241
64.6k
  }
void llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>::copy<9u>(llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u> const&, unsigned int, unsigned int, unsigned int)
Line
Count
Source
234
3
            unsigned j, unsigned Count) {
235
3
    assert(i + Count <= M && "Invalid source range");
236
3
    assert(j + Count <= N && "Invalid dest range");
237
6
    for (unsigned e = i + Count; i != e; 
++i, ++j3
) {
238
3
      first[j]  = Other.first[i];
239
3
      second[j] = Other.second[i];
240
3
    }
241
3
  }
Unexecuted instantiation: void llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>::copy<4u>(llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 4u> const&, unsigned int, unsigned int, unsigned int)
void llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 4u>::copy<4u>(llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 4u> const&, unsigned int, unsigned int, unsigned int)
Line
Count
Source
234
12
            unsigned j, unsigned Count) {
235
12
    assert(i + Count <= M && "Invalid source range");
236
12
    assert(j + Count <= N && "Invalid dest range");
237
21
    for (unsigned e = i + Count; i != e; 
++i, ++j9
) {
238
9
      first[j]  = Other.first[i];
239
9
      second[j] = Other.second[i];
240
9
    }
241
12
  }
void llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>::copy<4u>(llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 4u> const&, unsigned int, unsigned int, unsigned int)
Line
Count
Source
234
5
            unsigned j, unsigned Count) {
235
5
    assert(i + Count <= M && "Invalid source range");
236
5
    assert(j + Count <= N && "Invalid dest range");
237
25
    for (unsigned e = i + Count; i != e; 
++i, ++j20
) {
238
20
      first[j]  = Other.first[i];
239
20
      second[j] = Other.second[i];
240
20
    }
241
5
  }
void llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 11u>::copy<11u>(llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 11u> const&, unsigned int, unsigned int, unsigned int)
Line
Count
Source
234
35.9k
            unsigned j, unsigned Count) {
235
35.9k
    assert(i + Count <= M && "Invalid source range");
236
35.9k
    assert(j + Count <= N && "Invalid dest range");
237
78.3k
    for (unsigned e = i + Count; i != e; 
++i, ++j42.3k
) {
238
42.3k
      first[j]  = Other.first[i];
239
42.3k
      second[j] = Other.second[i];
240
42.3k
    }
241
35.9k
  }
void llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>::copy<8u>(llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u> const&, unsigned int, unsigned int, unsigned int)
Line
Count
Source
234
5.12M
            unsigned j, unsigned Count) {
235
5.12M
    assert(i + Count <= M && "Invalid source range");
236
5.12M
    assert(j + Count <= N && "Invalid dest range");
237
19.0M
    for (unsigned e = i + Count; i != e; 
++i, ++j13.9M
) {
238
13.9M
      first[j]  = Other.first[i];
239
13.9M
      second[j] = Other.second[i];
240
13.9M
    }
241
5.12M
  }
void llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>::copy<11u>(llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 11u> const&, unsigned int, unsigned int, unsigned int)
Line
Count
Source
234
7.20k
            unsigned j, unsigned Count) {
235
7.20k
    assert(i + Count <= M && "Invalid source range");
236
7.20k
    assert(j + Count <= N && "Invalid dest range");
237
86.4k
    for (unsigned e = i + Count; i != e; 
++i, ++j79.2k
) {
238
79.2k
      first[j]  = Other.first[i];
239
79.2k
      second[j] = Other.second[i];
240
79.2k
    }
241
7.20k
  }
void llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>::copy<9u>(llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u> const&, unsigned int, unsigned int, unsigned int)
Line
Count
Source
234
438k
            unsigned j, unsigned Count) {
235
438k
    assert(i + Count <= M && "Invalid source range");
236
438k
    assert(j + Count <= N && "Invalid dest range");
237
1.44M
    for (unsigned e = i + Count; i != e; 
++i, ++j1.00M
) {
238
1.00M
      first[j]  = Other.first[i];
239
1.00M
      second[j] = Other.second[i];
240
1.00M
    }
241
438k
  }
Unexecuted instantiation: void llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 8u>::copy<8u>(llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 8u> const&, unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: void llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>::copy<12u>(llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u> const&, unsigned int, unsigned int, unsigned int)
DAGCombiner.cpp:void llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>::copy<11u>(llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u> const&, unsigned int, unsigned int, unsigned int)
Line
Count
Source
234
280
            unsigned j, unsigned Count) {
235
280
    assert(i + Count <= M && "Invalid source range");
236
280
    assert(j + Count <= N && "Invalid dest range");
237
1.33k
    for (unsigned e = i + Count; i != e; 
++i, ++j1.05k
) {
238
1.05k
      first[j]  = Other.first[i];
239
1.05k
      second[j] = Other.second[i];
240
1.05k
    }
241
280
  }
Unexecuted instantiation: void llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>::copy<8u>(llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 8u> const&, unsigned int, unsigned int, unsigned int)
DAGCombiner.cpp:void llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>::copy<8u>(llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 8u> const&, unsigned int, unsigned int, unsigned int)
Line
Count
Source
234
90
            unsigned j, unsigned Count) {
235
90
    assert(i + Count <= M && "Invalid source range");
236
90
    assert(j + Count <= N && "Invalid dest range");
237
810
    for (unsigned e = i + Count; i != e; 
++i, ++j720
) {
238
720
      first[j]  = Other.first[i];
239
720
      second[j] = Other.second[i];
240
720
    }
241
90
  }
Unexecuted instantiation: DAGCombiner.cpp:void llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 8u>::copy<8u>(llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 8u> const&, unsigned int, unsigned int, unsigned int)
242
243
  /// moveLeft - Move elements to the left.
244
  /// @param i     Beginning of the source range.
245
  /// @param j     Beginning of the destination range.
246
  /// @param Count Number of elements to copy.
247
3.17M
  void moveLeft(unsigned i, unsigned j, unsigned Count) {
248
3.17M
    assert(j <= i && "Use moveRight shift elements right");
249
3.17M
    copy(*this, i, j, Count);
250
3.17M
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 4u>::moveLeft(unsigned int, unsigned int, unsigned int)
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>::moveLeft(unsigned int, unsigned int, unsigned int)
Line
Count
Source
247
28.1k
  void moveLeft(unsigned i, unsigned j, unsigned Count) {
248
28.1k
    assert(j <= i && "Use moveRight shift elements right");
249
28.1k
    copy(*this, i, j, Count);
250
28.1k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>::moveLeft(unsigned int, unsigned int, unsigned int)
Line
Count
Source
247
3
  void moveLeft(unsigned i, unsigned j, unsigned Count) {
248
3
    assert(j <= i && "Use moveRight shift elements right");
249
3
    copy(*this, i, j, Count);
250
3
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 4u>::moveLeft(unsigned int, unsigned int, unsigned int)
Line
Count
Source
247
12
  void moveLeft(unsigned i, unsigned j, unsigned Count) {
248
12
    assert(j <= i && "Use moveRight shift elements right");
249
12
    copy(*this, i, j, Count);
250
12
  }
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 11u>::moveLeft(unsigned int, unsigned int, unsigned int)
Line
Count
Source
247
35.9k
  void moveLeft(unsigned i, unsigned j, unsigned Count) {
248
35.9k
    assert(j <= i && "Use moveRight shift elements right");
249
35.9k
    copy(*this, i, j, Count);
250
35.9k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>::moveLeft(unsigned int, unsigned int, unsigned int)
Line
Count
Source
247
2.75M
  void moveLeft(unsigned i, unsigned j, unsigned Count) {
248
2.75M
    assert(j <= i && "Use moveRight shift elements right");
249
2.75M
    copy(*this, i, j, Count);
250
2.75M
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>::moveLeft(unsigned int, unsigned int, unsigned int)
Line
Count
Source
247
361k
  void moveLeft(unsigned i, unsigned j, unsigned Count) {
248
361k
    assert(j <= i && "Use moveRight shift elements right");
249
361k
    copy(*this, i, j, Count);
250
361k
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 8u>::moveLeft(unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>::moveLeft(unsigned int, unsigned int, unsigned int)
DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>::moveLeft(unsigned int, unsigned int, unsigned int)
Line
Count
Source
247
44
  void moveLeft(unsigned i, unsigned j, unsigned Count) {
248
44
    assert(j <= i && "Use moveRight shift elements right");
249
44
    copy(*this, i, j, Count);
250
44
  }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 8u>::moveLeft(unsigned int, unsigned int, unsigned int)
251
252
  /// moveRight - Move elements to the right.
253
  /// @param i     Beginning of the source range.
254
  /// @param j     Beginning of the destination range.
255
  /// @param Count Number of elements to copy.
256
8.95M
  void moveRight(unsigned i, unsigned j, unsigned Count) {
257
8.95M
    assert(i <= j && "Use moveLeft shift elements left");
258
8.95M
    assert(j + Count <= N && "Invalid range");
259
28.9M
    while (Count--) {
260
20.0M
      first[j + Count]  = first[i + Count];
261
20.0M
      second[j + Count] = second[i + Count];
262
20.0M
    }
263
8.95M
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>::moveRight(unsigned int, unsigned int, unsigned int)
Line
Count
Source
256
4
  void moveRight(unsigned i, unsigned j, unsigned Count) {
257
4
    assert(i <= j && "Use moveLeft shift elements left");
258
4
    assert(j + Count <= N && "Invalid range");
259
10
    while (Count--) {
260
6
      first[j + Count]  = first[i + Count];
261
6
      second[j + Count] = second[i + Count];
262
6
    }
263
4
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 4u>::moveRight(unsigned int, unsigned int, unsigned int)
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>::moveRight(unsigned int, unsigned int, unsigned int)
Line
Count
Source
256
118k
  void moveRight(unsigned i, unsigned j, unsigned Count) {
257
118k
    assert(i <= j && "Use moveLeft shift elements left");
258
118k
    assert(j + Count <= N && "Invalid range");
259
474k
    while (Count--) {
260
356k
      first[j + Count]  = first[i + Count];
261
356k
      second[j + Count] = second[i + Count];
262
356k
    }
263
118k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 4u>::moveRight(unsigned int, unsigned int, unsigned int)
Line
Count
Source
256
9
  void moveRight(unsigned i, unsigned j, unsigned Count) {
257
9
    assert(i <= j && "Use moveLeft shift elements left");
258
9
    assert(j + Count <= N && "Invalid range");
259
22
    while (Count--) {
260
13
      first[j + Count]  = first[i + Count];
261
13
      second[j + Count] = second[i + Count];
262
13
    }
263
9
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>::moveRight(unsigned int, unsigned int, unsigned int)
Line
Count
Source
256
8.02M
  void moveRight(unsigned i, unsigned j, unsigned Count) {
257
8.02M
    assert(i <= j && "Use moveLeft shift elements left");
258
8.02M
    assert(j + Count <= N && "Invalid range");
259
26.0M
    while (Count--) {
260
18.0M
      first[j + Count]  = first[i + Count];
261
18.0M
      second[j + Count] = second[i + Count];
262
18.0M
    }
263
8.02M
  }
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 11u>::moveRight(unsigned int, unsigned int, unsigned int)
Line
Count
Source
256
314k
  void moveRight(unsigned i, unsigned j, unsigned Count) {
257
314k
    assert(i <= j && "Use moveLeft shift elements left");
258
314k
    assert(j + Count <= N && "Invalid range");
259
743k
    while (Count--) {
260
428k
      first[j + Count]  = first[i + Count];
261
428k
      second[j + Count] = second[i + Count];
262
428k
    }
263
314k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>::moveRight(unsigned int, unsigned int, unsigned int)
Line
Count
Source
256
476k
  void moveRight(unsigned i, unsigned j, unsigned Count) {
257
476k
    assert(i <= j && "Use moveLeft shift elements left");
258
476k
    assert(j + Count <= N && "Invalid range");
259
1.66M
    while (Count--) {
260
1.18M
      first[j + Count]  = first[i + Count];
261
1.18M
      second[j + Count] = second[i + Count];
262
1.18M
    }
263
476k
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>::moveRight(unsigned int, unsigned int, unsigned int)
Line
Count
Source
256
888
  void moveRight(unsigned i, unsigned j, unsigned Count) {
257
888
    assert(i <= j && "Use moveLeft shift elements left");
258
888
    assert(j + Count <= N && "Invalid range");
259
8.01k
    while (Count--) {
260
7.12k
      first[j + Count]  = first[i + Count];
261
7.12k
      second[j + Count] = second[i + Count];
262
7.12k
    }
263
888
  }
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 8u>::moveRight(unsigned int, unsigned int, unsigned int)
Line
Count
Source
256
80
  void moveRight(unsigned i, unsigned j, unsigned Count) {
257
80
    assert(i <= j && "Use moveLeft shift elements left");
258
80
    assert(j + Count <= N && "Invalid range");
259
198
    while (Count--) {
260
118
      first[j + Count]  = first[i + Count];
261
118
      second[j + Count] = second[i + Count];
262
118
    }
263
80
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>::moveRight(unsigned int, unsigned int, unsigned int)
DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 8u>::moveRight(unsigned int, unsigned int, unsigned int)
Line
Count
Source
256
24.1k
  void moveRight(unsigned i, unsigned j, unsigned Count) {
257
24.1k
    assert(i <= j && "Use moveLeft shift elements left");
258
24.1k
    assert(j + Count <= N && "Invalid range");
259
58.4k
    while (Count--) {
260
34.3k
      first[j + Count]  = first[i + Count];
261
34.3k
      second[j + Count] = second[i + Count];
262
34.3k
    }
263
24.1k
  }
264
265
  /// erase - Erase elements [i;j).
266
  /// @param i    Beginning of the range to erase.
267
  /// @param j    End of the range. (Exclusive).
268
  /// @param Size Number of elements in node.
269
3.17M
  void erase(unsigned i, unsigned j, unsigned Size) {
270
3.17M
    moveLeft(j, i, Size - j);
271
3.17M
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 4u>::erase(unsigned int, unsigned int, unsigned int)
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>::erase(unsigned int, unsigned int, unsigned int)
Line
Count
Source
269
28.1k
  void erase(unsigned i, unsigned j, unsigned Size) {
270
28.1k
    moveLeft(j, i, Size - j);
271
28.1k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>::erase(unsigned int, unsigned int, unsigned int)
Line
Count
Source
269
3
  void erase(unsigned i, unsigned j, unsigned Size) {
270
3
    moveLeft(j, i, Size - j);
271
3
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 4u>::erase(unsigned int, unsigned int, unsigned int)
Line
Count
Source
269
12
  void erase(unsigned i, unsigned j, unsigned Size) {
270
12
    moveLeft(j, i, Size - j);
271
12
  }
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 11u>::erase(unsigned int, unsigned int, unsigned int)
Line
Count
Source
269
35.9k
  void erase(unsigned i, unsigned j, unsigned Size) {
270
35.9k
    moveLeft(j, i, Size - j);
271
35.9k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>::erase(unsigned int, unsigned int, unsigned int)
Line
Count
Source
269
2.75M
  void erase(unsigned i, unsigned j, unsigned Size) {
270
2.75M
    moveLeft(j, i, Size - j);
271
2.75M
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>::erase(unsigned int, unsigned int, unsigned int)
Line
Count
Source
269
361k
  void erase(unsigned i, unsigned j, unsigned Size) {
270
361k
    moveLeft(j, i, Size - j);
271
361k
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 8u>::erase(unsigned int, unsigned int, unsigned int)
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>::erase(unsigned int, unsigned int, unsigned int)
DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>::erase(unsigned int, unsigned int, unsigned int)
Line
Count
Source
269
44
  void erase(unsigned i, unsigned j, unsigned Size) {
270
44
    moveLeft(j, i, Size - j);
271
44
  }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 8u>::erase(unsigned int, unsigned int, unsigned int)
272
273
  /// erase - Erase element at i.
274
  /// @param i    Index of element to erase.
275
  /// @param Size Number of elements in node.
276
2.17M
  void erase(unsigned i, unsigned Size) {
277
2.17M
    erase(i, i+1, Size);
278
2.17M
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 4u>::erase(unsigned int, unsigned int)
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>::erase(unsigned int, unsigned int)
Line
Count
Source
276
8.57k
  void erase(unsigned i, unsigned Size) {
277
8.57k
    erase(i, i+1, Size);
278
8.57k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>::erase(unsigned int, unsigned int)
Line
Count
Source
276
3
  void erase(unsigned i, unsigned Size) {
277
3
    erase(i, i+1, Size);
278
3
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 4u>::erase(unsigned int, unsigned int)
Line
Count
Source
276
12
  void erase(unsigned i, unsigned Size) {
277
12
    erase(i, i+1, Size);
278
12
  }
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 11u>::erase(unsigned int, unsigned int)
Line
Count
Source
276
35.9k
  void erase(unsigned i, unsigned Size) {
277
35.9k
    erase(i, i+1, Size);
278
35.9k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>::erase(unsigned int, unsigned int)
Line
Count
Source
276
1.80M
  void erase(unsigned i, unsigned Size) {
277
1.80M
    erase(i, i+1, Size);
278
1.80M
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>::erase(unsigned int, unsigned int)
Line
Count
Source
276
329k
  void erase(unsigned i, unsigned Size) {
277
329k
    erase(i, i+1, Size);
278
329k
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 8u>::erase(unsigned int, unsigned int)
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>::erase(unsigned int, unsigned int)
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>::erase(unsigned int, unsigned int)
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 8u>::erase(unsigned int, unsigned int)
279
280
  /// shift - Shift elements [i;size) 1 position to the right.
281
  /// @param i    Beginning of the range to move.
282
  /// @param Size Number of elements in node.
283
8.09M
  void shift(unsigned i, unsigned Size) {
284
8.09M
    moveRight(i, i + 1, Size - i);
285
8.09M
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>::shift(unsigned int, unsigned int)
Line
Count
Source
283
4
  void shift(unsigned i, unsigned Size) {
284
4
    moveRight(i, i + 1, Size - i);
285
4
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 4u>::shift(unsigned int, unsigned int)
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>::shift(unsigned int, unsigned int)
Line
Count
Source
283
101k
  void shift(unsigned i, unsigned Size) {
284
101k
    moveRight(i, i + 1, Size - i);
285
101k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 4u>::shift(unsigned int, unsigned int)
Line
Count
Source
283
9
  void shift(unsigned i, unsigned Size) {
284
9
    moveRight(i, i + 1, Size - i);
285
9
  }
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 11u>::shift(unsigned int, unsigned int)
Line
Count
Source
283
314k
  void shift(unsigned i, unsigned Size) {
284
314k
    moveRight(i, i + 1, Size - i);
285
314k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>::shift(unsigned int, unsigned int)
Line
Count
Source
283
7.19M
  void shift(unsigned i, unsigned Size) {
284
7.19M
    moveRight(i, i + 1, Size - i);
285
7.19M
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>::shift(unsigned int, unsigned int)
Line
Count
Source
283
455k
  void shift(unsigned i, unsigned Size) {
284
455k
    moveRight(i, i + 1, Size - i);
285
455k
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>::shift(unsigned int, unsigned int)
Line
Count
Source
283
696
  void shift(unsigned i, unsigned Size) {
284
696
    moveRight(i, i + 1, Size - i);
285
696
  }
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 8u>::shift(unsigned int, unsigned int)
Line
Count
Source
283
80
  void shift(unsigned i, unsigned Size) {
284
80
    moveRight(i, i + 1, Size - i);
285
80
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>::shift(unsigned int, unsigned int)
DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 8u>::shift(unsigned int, unsigned int)
Line
Count
Source
283
24.1k
  void shift(unsigned i, unsigned Size) {
284
24.1k
    moveRight(i, i + 1, Size - i);
285
24.1k
  }
286
287
  /// transferToLeftSib - Transfer elements to a left sibling node.
288
  /// @param Size  Number of elements in this.
289
  /// @param Sib   Left sibling node.
290
  /// @param SSize Number of elements in sib.
291
  /// @param Count Number of elements to transfer.
292
  void transferToLeftSib(unsigned Size, NodeBase &Sib, unsigned SSize,
293
999k
                         unsigned Count) {
294
999k
    Sib.copy(*this, 0, SSize, Count);
295
999k
    erase(0, Count, Size);
296
999k
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>::transferToLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>&, unsigned int, unsigned int)
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>::transferToLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>&, unsigned int, unsigned int)
Line
Count
Source
293
19.6k
                         unsigned Count) {
294
19.6k
    Sib.copy(*this, 0, SSize, Count);
295
19.6k
    erase(0, Count, Size);
296
19.6k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>::transferToLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>&, unsigned int, unsigned int)
Line
Count
Source
293
947k
                         unsigned Count) {
294
947k
    Sib.copy(*this, 0, SSize, Count);
295
947k
    erase(0, Count, Size);
296
947k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>::transferToLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>&, unsigned int, unsigned int)
Line
Count
Source
293
32.2k
                         unsigned Count) {
294
32.2k
    Sib.copy(*this, 0, SSize, Count);
295
32.2k
    erase(0, Count, Size);
296
32.2k
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>::transferToLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>&, unsigned int, unsigned int)
Line
Count
Source
293
44
                         unsigned Count) {
294
44
    Sib.copy(*this, 0, SSize, Count);
295
44
    erase(0, Count, Size);
296
44
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>::transferToLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>&, unsigned int, unsigned int)
297
298
  /// transferToRightSib - Transfer elements to a right sibling node.
299
  /// @param Size  Number of elements in this.
300
  /// @param Sib   Right sibling node.
301
  /// @param SSize Number of elements in sib.
302
  /// @param Count Number of elements to transfer.
303
  void transferToRightSib(unsigned Size, NodeBase &Sib, unsigned SSize,
304
864k
                          unsigned Count) {
305
864k
    Sib.moveRight(0, Count, SSize);
306
864k
    Sib.copy(*this, Size-Count, 0, Count);
307
864k
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>::transferToRightSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>&, unsigned int, unsigned int)
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>::transferToRightSib(unsigned int, llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>&, unsigned int, unsigned int)
Line
Count
Source
304
16.8k
                          unsigned Count) {
305
16.8k
    Sib.moveRight(0, Count, SSize);
306
16.8k
    Sib.copy(*this, Size-Count, 0, Count);
307
16.8k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>::transferToRightSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>&, unsigned int, unsigned int)
Line
Count
Source
304
826k
                          unsigned Count) {
305
826k
    Sib.moveRight(0, Count, SSize);
306
826k
    Sib.copy(*this, Size-Count, 0, Count);
307
826k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>::transferToRightSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>&, unsigned int, unsigned int)
Line
Count
Source
304
20.5k
                          unsigned Count) {
305
20.5k
    Sib.moveRight(0, Count, SSize);
306
20.5k
    Sib.copy(*this, Size-Count, 0, Count);
307
20.5k
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>::transferToRightSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>&, unsigned int, unsigned int)
Line
Count
Source
304
192
                          unsigned Count) {
305
192
    Sib.moveRight(0, Count, SSize);
306
192
    Sib.copy(*this, Size-Count, 0, Count);
307
192
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>::transferToRightSib(unsigned int, llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>&, unsigned int, unsigned int)
308
309
  /// adjustFromLeftSib - Adjust the number if elements in this node by moving
310
  /// elements to or from a left sibling node.
311
  /// @param Size  Number of elements in this.
312
  /// @param Sib   Right sibling node.
313
  /// @param SSize Number of elements in sib.
314
  /// @param Add   The number of elements to add to this node, possibly < 0.
315
  /// @return      Number of elements added to this node, possibly negative.
316
1.86M
  int adjustFromLeftSib(unsigned Size, NodeBase &Sib, unsigned SSize, int Add) {
317
1.86M
    if (Add > 0) {
318
864k
      // We want to grow, copy from sib.
319
864k
      unsigned Count = std::min(std::min(unsigned(Add), SSize), N - Size);
320
864k
      Sib.transferToRightSib(SSize, *this, Size, Count);
321
864k
      return Count;
322
999k
    } else {
323
999k
      // We want to shrink, copy to sib.
324
999k
      unsigned Count = std::min(std::min(unsigned(-Add), Size), N - SSize);
325
999k
      transferToLeftSib(Size, Sib, SSize, Count);
326
999k
      return -Count;
327
999k
    }
328
1.86M
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>::adjustFromLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, DbgValueLocation, 9u>&, unsigned int, int)
llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>::adjustFromLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex, 12u>&, unsigned int, int)
Line
Count
Source
316
36.4k
  int adjustFromLeftSib(unsigned Size, NodeBase &Sib, unsigned SSize, int Add) {
317
36.4k
    if (Add > 0) {
318
16.8k
      // We want to grow, copy from sib.
319
16.8k
      unsigned Count = std::min(std::min(unsigned(Add), SSize), N - Size);
320
16.8k
      Sib.transferToRightSib(SSize, *this, Size, Count);
321
16.8k
      return Count;
322
19.6k
    } else {
323
19.6k
      // We want to shrink, copy to sib.
324
19.6k
      unsigned Count = std::min(std::min(unsigned(-Add), Size), N - SSize);
325
19.6k
      transferToLeftSib(Size, Sib, SSize, Count);
326
19.6k
      return -Count;
327
19.6k
    }
328
36.4k
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>::adjustFromLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, llvm::LiveInterval*, 8u>&, unsigned int, int)
Line
Count
Source
316
1.77M
  int adjustFromLeftSib(unsigned Size, NodeBase &Sib, unsigned SSize, int Add) {
317
1.77M
    if (Add > 0) {
318
826k
      // We want to grow, copy from sib.
319
826k
      unsigned Count = std::min(std::min(unsigned(Add), SSize), N - Size);
320
826k
      Sib.transferToRightSib(SSize, *this, Size, Count);
321
826k
      return Count;
322
947k
    } else {
323
947k
      // We want to shrink, copy to sib.
324
947k
      unsigned Count = std::min(std::min(unsigned(-Add), Size), N - SSize);
325
947k
      transferToLeftSib(Size, Sib, SSize, Count);
326
947k
      return -Count;
327
947k
    }
328
1.77M
  }
llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>::adjustFromLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<llvm::SlotIndex, llvm::SlotIndex>, unsigned int, 9u>&, unsigned int, int)
Line
Count
Source
316
52.7k
  int adjustFromLeftSib(unsigned Size, NodeBase &Sib, unsigned SSize, int Add) {
317
52.7k
    if (Add > 0) {
318
20.5k
      // We want to grow, copy from sib.
319
20.5k
      unsigned Count = std::min(std::min(unsigned(Add), SSize), N - Size);
320
20.5k
      Sib.transferToRightSib(SSize, *this, Size, Count);
321
20.5k
      return Count;
322
32.2k
    } else {
323
32.2k
      // We want to shrink, copy to sib.
324
32.2k
      unsigned Count = std::min(std::min(unsigned(-Add), Size), N - SSize);
325
32.2k
      transferToLeftSib(Size, Sib, SSize, Count);
326
32.2k
      return -Count;
327
32.2k
    }
328
52.7k
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>::adjustFromLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<std::__1::pair<long long, long long>, (anonymous namespace)::UnitT, 11u>&, unsigned int, int)
Line
Count
Source
316
236
  int adjustFromLeftSib(unsigned Size, NodeBase &Sib, unsigned SSize, int Add) {
317
236
    if (Add > 0) {
318
192
      // We want to grow, copy from sib.
319
192
      unsigned Count = std::min(std::min(unsigned(Add), SSize), N - Size);
320
192
      Sib.transferToRightSib(SSize, *this, Size, Count);
321
192
      return Count;
322
192
    } else {
323
44
      // We want to shrink, copy to sib.
324
44
      unsigned Count = std::min(std::min(unsigned(-Add), Size), N - SSize);
325
44
      transferToLeftSib(Size, Sib, SSize, Count);
326
44
      return -Count;
327
44
    }
328
236
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>::adjustFromLeftSib(unsigned int, llvm::IntervalMapImpl::NodeBase<llvm::IntervalMapImpl::NodeRef, long long, 12u>&, unsigned int, int)
329
};
330
331
/// IntervalMapImpl::adjustSiblingSizes - Move elements between sibling nodes.
332
/// @param Node  Array of pointers to sibling nodes.
333
/// @param Nodes Number of nodes.
334
/// @param CurSize Array of current node sizes, will be overwritten.
335
/// @param NewSize Array of desired node sizes.
336
template <typename NodeT>
337
void adjustSiblingSizes(NodeT *Node[], unsigned Nodes,
338
1.24M
                        unsigned CurSize[], const unsigned NewSize[]) {
339
1.24M
  // Move elements right.
340
3.27M
  for (int n = Nodes - 1; n; 
--n2.03M
) {
341
2.03M
    if (CurSize[n] == NewSize[n])
342
191k
      continue;
343
1.84M
    for (int m = n - 1; m != -1; 
--m0
) {
344
1.84M
      int d = Node[n]->adjustFromLeftSib(CurSize[n], *Node[m], CurSize[m],
345
1.84M
                                         NewSize[n] - CurSize[n]);
346
1.84M
      CurSize[m] -= d;
347
1.84M
      CurSize[n] += d;
348
1.84M
      // Keep going if the current node was exhausted.
349
1.84M
      if (CurSize[n] >= NewSize[n])
350
1.84M
          break;
351
1.84M
    }
352
1.84M
  }
353
1.24M
354
1.24M
  if (Nodes == 0)
355
0
    return;
356
1.24M
357
1.24M
  // Move elements left.
358
3.27M
  
for (unsigned n = 0; 1.24M
n != Nodes - 1;
++n2.03M
) {
359
2.03M
    if (CurSize[n] == NewSize[n])
360
2.01M
      continue;
361
20.1k
    for (unsigned m = n + 1; m != Nodes; 
++m0
) {
362
20.1k
      int d = Node[m]->adjustFromLeftSib(CurSize[m], *Node[n], CurSize[n],
363
20.1k
                                        CurSize[n] -  NewSize[n]);
364
20.1k
      CurSize[m] += d;
365
20.1k
      CurSize[n] -= d;
366
20.1k
      // Keep going if the current node was exhausted.
367
20.1k
      if (CurSize[n] >= NewSize[n])
368
20.1k
          break;
369
20.1k
    }
370
20.1k
  }
371
1.24M
372
#ifndef NDEBUG
373
  for (unsigned n = 0; n != Nodes; n++)
374
    assert(CurSize[n] == NewSize[n] && "Insufficient element shuffle");
375
#endif
376
}
Unexecuted instantiation: void llvm::IntervalMapImpl::adjustSiblingSizes<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >**, unsigned int, unsigned int*, unsigned int const*)
Unexecuted instantiation: void llvm::IntervalMapImpl::adjustSiblingSizes<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >**, unsigned int, unsigned int*, unsigned int const*)
void llvm::IntervalMapImpl::adjustSiblingSizes<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >**, unsigned int, unsigned int*, unsigned int const*)
Line
Count
Source
338
1.17M
                        unsigned CurSize[], const unsigned NewSize[]) {
339
1.17M
  // Move elements right.
340
3.11M
  for (int n = Nodes - 1; n; 
--n1.94M
) {
341
1.94M
    if (CurSize[n] == NewSize[n])
342
184k
      continue;
343
1.75M
    for (int m = n - 1; m != -1; 
--m0
) {
344
1.75M
      int d = Node[n]->adjustFromLeftSib(CurSize[n], *Node[m], CurSize[m],
345
1.75M
                                         NewSize[n] - CurSize[n]);
346
1.75M
      CurSize[m] -= d;
347
1.75M
      CurSize[n] += d;
348
1.75M
      // Keep going if the current node was exhausted.
349
1.75M
      if (CurSize[n] >= NewSize[n])
350
1.75M
          break;
351
1.75M
    }
352
1.75M
  }
353
1.17M
354
1.17M
  if (Nodes == 0)
355
0
    return;
356
1.17M
357
1.17M
  // Move elements left.
358
3.11M
  
for (unsigned n = 0; 1.17M
n != Nodes - 1;
++n1.94M
) {
359
1.94M
    if (CurSize[n] == NewSize[n])
360
1.92M
      continue;
361
18.0k
    for (unsigned m = n + 1; m != Nodes; 
++m0
) {
362
18.0k
      int d = Node[m]->adjustFromLeftSib(CurSize[m], *Node[n], CurSize[n],
363
18.0k
                                        CurSize[n] -  NewSize[n]);
364
18.0k
      CurSize[m] += d;
365
18.0k
      CurSize[n] -= d;
366
18.0k
      // Keep going if the current node was exhausted.
367
18.0k
      if (CurSize[n] >= NewSize[n])
368
18.0k
          break;
369
18.0k
    }
370
18.0k
  }
371
1.17M
372
#ifndef NDEBUG
373
  for (unsigned n = 0; n != Nodes; n++)
374
    assert(CurSize[n] == NewSize[n] && "Insufficient element shuffle");
375
#endif
376
}
void llvm::IntervalMapImpl::adjustSiblingSizes<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >**, unsigned int, unsigned int*, unsigned int const*)
Line
Count
Source
338
26.7k
                        unsigned CurSize[], const unsigned NewSize[]) {
339
26.7k
  // Move elements right.
340
63.6k
  for (int n = Nodes - 1; n; 
--n36.9k
) {
341
36.9k
    if (CurSize[n] == NewSize[n])
342
1.63k
      continue;
343
35.3k
    for (int m = n - 1; m != -1; 
--m0
) {
344
35.3k
      int d = Node[n]->adjustFromLeftSib(CurSize[n], *Node[m], CurSize[m],
345
35.3k
                                         NewSize[n] - CurSize[n]);
346
35.3k
      CurSize[m] -= d;
347
35.3k
      CurSize[n] += d;
348
35.3k
      // Keep going if the current node was exhausted.
349
35.3k
      if (CurSize[n] >= NewSize[n])
350
35.3k
          break;
351
35.3k
    }
352
35.3k
  }
353
26.7k
354
26.7k
  if (Nodes == 0)
355
0
    return;
356
26.7k
357
26.7k
  // Move elements left.
358
63.6k
  
for (unsigned n = 0; 26.7k
n != Nodes - 1;
++n36.9k
) {
359
36.9k
    if (CurSize[n] == NewSize[n])
360
36.4k
      continue;
361
528
    for (unsigned m = n + 1; m != Nodes; 
++m0
) {
362
528
      int d = Node[m]->adjustFromLeftSib(CurSize[m], *Node[n], CurSize[n],
363
528
                                        CurSize[n] -  NewSize[n]);
364
528
      CurSize[m] += d;
365
528
      CurSize[n] -= d;
366
528
      // Keep going if the current node was exhausted.
367
528
      if (CurSize[n] >= NewSize[n])
368
528
          break;
369
528
    }
370
528
  }
371
26.7k
372
#ifndef NDEBUG
373
  for (unsigned n = 0; n != Nodes; n++)
374
    assert(CurSize[n] == NewSize[n] && "Insufficient element shuffle");
375
#endif
376
}
void llvm::IntervalMapImpl::adjustSiblingSizes<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >**, unsigned int, unsigned int*, unsigned int const*)
Line
Count
Source
338
37.1k
                        unsigned CurSize[], const unsigned NewSize[]) {
339
37.1k
  // Move elements right.
340
93.5k
  for (int n = Nodes - 1; n; 
--n56.3k
) {
341
56.3k
    if (CurSize[n] == NewSize[n])
342
5.22k
      continue;
343
51.1k
    for (int m = n - 1; m != -1; 
--m0
) {
344
51.1k
      int d = Node[n]->adjustFromLeftSib(CurSize[n], *Node[m], CurSize[m],
345
51.1k
                                         NewSize[n] - CurSize[n]);
346
51.1k
      CurSize[m] -= d;
347
51.1k
      CurSize[n] += d;
348
51.1k
      // Keep going if the current node was exhausted.
349
51.1k
      if (CurSize[n] >= NewSize[n])
350
51.1k
          break;
351
51.1k
    }
352
51.1k
  }
353
37.1k
354
37.1k
  if (Nodes == 0)
355
0
    return;
356
37.1k
357
37.1k
  // Move elements left.
358
93.5k
  
for (unsigned n = 0; 37.1k
n != Nodes - 1;
++n56.3k
) {
359
56.3k
    if (CurSize[n] == NewSize[n])
360
54.7k
      continue;
361
1.63k
    for (unsigned m = n + 1; m != Nodes; 
++m0
) {
362
1.63k
      int d = Node[m]->adjustFromLeftSib(CurSize[m], *Node[n], CurSize[n],
363
1.63k
                                        CurSize[n] -  NewSize[n]);
364
1.63k
      CurSize[m] += d;
365
1.63k
      CurSize[n] -= d;
366
1.63k
      // Keep going if the current node was exhausted.
367
1.63k
      if (CurSize[n] >= NewSize[n])
368
1.63k
          break;
369
1.63k
    }
370
1.63k
  }
371
37.1k
372
#ifndef NDEBUG
373
  for (unsigned n = 0; n != Nodes; n++)
374
    assert(CurSize[n] == NewSize[n] && "Insufficient element shuffle");
375
#endif
376
}
void llvm::IntervalMapImpl::adjustSiblingSizes<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >**, unsigned int, unsigned int*, unsigned int const*)
Line
Count
Source
338
456
                        unsigned CurSize[], const unsigned NewSize[]) {
339
456
  // Move elements right.
340
1.07k
  for (int n = Nodes - 1; n; 
--n614
) {
341
614
    if (CurSize[n] == NewSize[n])
342
21
      continue;
343
593
    for (int m = n - 1; m != -1; 
--m0
) {
344
593
      int d = Node[n]->adjustFromLeftSib(CurSize[n], *Node[m], CurSize[m],
345
593
                                         NewSize[n] - CurSize[n]);
346
593
      CurSize[m] -= d;
347
593
      CurSize[n] += d;
348
593
      // Keep going if the current node was exhausted.
349
593
      if (CurSize[n] >= NewSize[n])
350
593
          break;
351
593
    }
352
593
  }
353
456
354
456
  if (Nodes == 0)
355
0
    return;
356
456
357
456
  // Move elements left.
358
1.07k
  
for (unsigned n = 0; 456
n != Nodes - 1;
++n614
) {
359
614
    if (CurSize[n] == NewSize[n])
360
600
      continue;
361
14
    for (unsigned m = n + 1; m != Nodes; 
++m0
) {
362
14
      int d = Node[m]->adjustFromLeftSib(CurSize[m], *Node[n], CurSize[n],
363
14
                                        CurSize[n] -  NewSize[n]);
364
14
      CurSize[m] += d;
365
14
      CurSize[n] -= d;
366
14
      // Keep going if the current node was exhausted.
367
14
      if (CurSize[n] >= NewSize[n])
368
14
          break;
369
14
    }
370
14
  }
371
456
372
#ifndef NDEBUG
373
  for (unsigned n = 0; n != Nodes; n++)
374
    assert(CurSize[n] == NewSize[n] && "Insufficient element shuffle");
375
#endif
376
}
DAGCombiner.cpp:void llvm::IntervalMapImpl::adjustSiblingSizes<llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> > >(llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >**, unsigned int, unsigned int*, unsigned int const*)
Line
Count
Source
338
192
                        unsigned CurSize[], const unsigned NewSize[]) {
339
192
  // Move elements right.
340
428
  for (int n = Nodes - 1; n; 
--n236
) {
341
236
    if (CurSize[n] == NewSize[n])
342
0
      continue;
343
236
    for (int m = n - 1; m != -1; 
--m0
) {
344
236
      int d = Node[n]->adjustFromLeftSib(CurSize[n], *Node[m], CurSize[m],
345
236
                                         NewSize[n] - CurSize[n]);
346
236
      CurSize[m] -= d;
347
236
      CurSize[n] += d;
348
236
      // Keep going if the current node was exhausted.
349
236
      if (CurSize[n] >= NewSize[n])
350
236
          break;
351
236
    }
352
236
  }
353
192
354
192
  if (Nodes == 0)
355
0
    return;
356
192
357
192
  // Move elements left.
358
428
  
for (unsigned n = 0; 192
n != Nodes - 1;
++n236
) {
359
236
    if (CurSize[n] == NewSize[n])
360
236
      continue;
361
0
    for (unsigned m = n + 1; m != Nodes; ++m) {
362
0
      int d = Node[m]->adjustFromLeftSib(CurSize[m], *Node[n], CurSize[n],
363
0
                                        CurSize[n] -  NewSize[n]);
364
0
      CurSize[m] += d;
365
0
      CurSize[n] -= d;
366
0
      // Keep going if the current node was exhausted.
367
0
      if (CurSize[n] >= NewSize[n])
368
0
          break;
369
0
    }
370
0
  }
371
192
372
#ifndef NDEBUG
373
  for (unsigned n = 0; n != Nodes; n++)
374
    assert(CurSize[n] == NewSize[n] && "Insufficient element shuffle");
375
#endif
376
}
Unexecuted instantiation: DAGCombiner.cpp:void llvm::IntervalMapImpl::adjustSiblingSizes<llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> > >(llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> >**, unsigned int, unsigned int*, unsigned int const*)
377
378
/// IntervalMapImpl::distribute - Compute a new distribution of node elements
379
/// after an overflow or underflow. Reserve space for a new element at Position,
380
/// and compute the node that will hold Position after redistributing node
381
/// elements.
382
///
383
/// It is required that
384
///
385
///   Elements == sum(CurSize), and
386
///   Elements + Grow <= Nodes * Capacity.
387
///
388
/// NewSize[] will be filled in such that:
389
///
390
///   sum(NewSize) == Elements, and
391
///   NewSize[i] <= Capacity.
392
///
393
/// The returned index is the node where Position will go, so:
394
///
395
///   sum(NewSize[0..idx-1]) <= Position
396
///   sum(NewSize[0..idx])   >= Position
397
///
398
/// The last equality, sum(NewSize[0..idx]) == Position, can only happen when
399
/// Grow is set and NewSize[idx] == Capacity-1. The index points to the node
400
/// before the one holding the Position'th element where there is room for an
401
/// insertion.
402
///
403
/// @param Nodes    The number of nodes.
404
/// @param Elements Total elements in all nodes.
405
/// @param Capacity The capacity of each node.
406
/// @param CurSize  Array[Nodes] of current node sizes, or NULL.
407
/// @param NewSize  Array[Nodes] to receive the new node sizes.
408
/// @param Position Insert position.
409
/// @param Grow     Reserve space for a new element at Position.
410
/// @return         (node, offset) for Position.
411
IdxPair distribute(unsigned Nodes, unsigned Elements, unsigned Capacity,
412
                   const unsigned *CurSize, unsigned NewSize[],
413
                   unsigned Position, bool Grow);
414
415
//===----------------------------------------------------------------------===//
416
//---                   IntervalMapImpl::NodeSizer                         ---//
417
//===----------------------------------------------------------------------===//
418
//
419
// Compute node sizes from key and value types.
420
//
421
// The branching factors are chosen to make nodes fit in three cache lines.
422
// This may not be possible if keys or values are very large. Such large objects
423
// are handled correctly, but a std::map would probably give better performance.
424
//
425
//===----------------------------------------------------------------------===//
426
427
enum {
428
  // Cache line size. Most architectures have 32 or 64 byte cache lines.
429
  // We use 64 bytes here because it provides good branching factors.
430
  Log2CacheLine = 6,
431
  CacheLineBytes = 1 << Log2CacheLine,
432
  DesiredNodeBytes = 3 * CacheLineBytes
433
};
434
435
template <typename KeyT, typename ValT>
436
struct NodeSizer {
437
  enum {
438
    // Compute the leaf node branching factor that makes a node fit in three
439
    // cache lines. The branching factor must be at least 3, or some B+-tree
440
    // balancing algorithms won't work.
441
    // LeafSize can't be larger than CacheLineBytes. This is required by the
442
    // PointerIntPair used by NodeRef.
443
    DesiredLeafSize = DesiredNodeBytes /
444
      static_cast<unsigned>(2*sizeof(KeyT)+sizeof(ValT)),
445
    MinLeafSize = 3,
446
    LeafSize = DesiredLeafSize > MinLeafSize ? DesiredLeafSize : MinLeafSize
447
  };
448
449
  using LeafBase = NodeBase<std::pair<KeyT, KeyT>, ValT, LeafSize>;
450
451
  enum {
452
    // Now that we have the leaf branching factor, compute the actual allocation
453
    // unit size by rounding up to a whole number of cache lines.
454
    AllocBytes = (sizeof(LeafBase) + CacheLineBytes-1) & ~(CacheLineBytes-1),
455
456
    // Determine the branching factor for branch nodes.
457
    BranchSize = AllocBytes /
458
      static_cast<unsigned>(sizeof(KeyT) + sizeof(void*))
459
  };
460
461
  /// Allocator - The recycling allocator used for both branch and leaf nodes.
462
  /// This typedef is very likely to be identical for all IntervalMaps with
463
  /// reasonably sized entries, so the same allocator can be shared among
464
  /// different kinds of maps.
465
  using Allocator =
466
      RecyclingAllocator<BumpPtrAllocator, char, AllocBytes, CacheLineBytes>;
467
};
468
469
//===----------------------------------------------------------------------===//
470
//---                     IntervalMapImpl::NodeRef                         ---//
471
//===----------------------------------------------------------------------===//
472
//
473
// B+-tree nodes can be leaves or branches, so we need a polymorphic node
474
// pointer that can point to both kinds.
475
//
476
// All nodes are cache line aligned and the low 6 bits of a node pointer are
477
// always 0. These bits are used to store the number of elements in the
478
// referenced node. Besides saving space, placing node sizes in the parents
479
// allow tree balancing algorithms to run without faulting cache lines for nodes
480
// that may not need to be modified.
481
//
482
// A NodeRef doesn't know whether it references a leaf node or a branch node.
483
// It is the responsibility of the caller to use the correct types.
484
//
485
// Nodes are never supposed to be empty, and it is invalid to store a node size
486
// of 0 in a NodeRef. The valid range of sizes is 1-64.
487
//
488
//===----------------------------------------------------------------------===//
489
490
class NodeRef {
491
  struct CacheAlignedPointerTraits {
492
1.04M
    static inline void *getAsVoidPointer(void *P) { return P; }
493
92.5M
    static inline void *getFromVoidPointer(void *P) { return P; }
494
    enum { NumLowBitsAvailable = Log2CacheLine };
495
  };
496
  PointerIntPair<void*, Log2CacheLine, unsigned, CacheAlignedPointerTraits> pip;
497
498
public:
499
  /// NodeRef - Create a null ref.
500
5.23M
  NodeRef() = default;
501
502
  /// operator bool - Detect a null ref.
503
4.12M
  explicit operator bool() const { return pip.getOpaqueValue(); }
504
505
  /// NodeRef - Create a reference to the node p with n elements.
506
  template <typename NodeT>
507
1.04M
  NodeRef(NodeT *p, unsigned n) : pip(p, n - 1) {
508
1.04M
    assert(n <= NodeT::Capacity && "Size too big for node");
509
1.04M
  }
Unexecuted instantiation: llvm::IntervalMapImpl::NodeRef::NodeRef<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >*, unsigned int)
llvm::IntervalMapImpl::NodeRef::NodeRef<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >*, unsigned int)
Line
Count
Source
507
5
  NodeRef(NodeT *p, unsigned n) : pip(p, n - 1) {
508
5
    assert(n <= NodeT::Capacity && "Size too big for node");
509
5
  }
llvm::IntervalMapImpl::NodeRef::NodeRef<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >*, unsigned int)
Line
Count
Source
507
18.4k
  NodeRef(NodeT *p, unsigned n) : pip(p, n - 1) {
508
18.4k
    assert(n <= NodeT::Capacity && "Size too big for node");
509
18.4k
  }
llvm::IntervalMapImpl::NodeRef::NodeRef<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >*, unsigned int)
Line
Count
Source
507
992k
  NodeRef(NodeT *p, unsigned n) : pip(p, n - 1) {
508
992k
    assert(n <= NodeT::Capacity && "Size too big for node");
509
992k
  }
llvm::IntervalMapImpl::NodeRef::NodeRef<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >*, unsigned int)
Line
Count
Source
507
337
  NodeRef(NodeT *p, unsigned n) : pip(p, n - 1) {
508
337
    assert(n <= NodeT::Capacity && "Size too big for node");
509
337
  }
llvm::IntervalMapImpl::NodeRef::NodeRef<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >*, unsigned int)
Line
Count
Source
507
33.2k
  NodeRef(NodeT *p, unsigned n) : pip(p, n - 1) {
508
33.2k
    assert(n <= NodeT::Capacity && "Size too big for node");
509
33.2k
  }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::NodeRef::NodeRef<llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> > >(llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> >*, unsigned int)
DAGCombiner.cpp:llvm::IntervalMapImpl::NodeRef::NodeRef<llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> > >(llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >*, unsigned int)
Line
Count
Source
507
170
  NodeRef(NodeT *p, unsigned n) : pip(p, n - 1) {
508
170
    assert(n <= NodeT::Capacity && "Size too big for node");
509
170
  }
510
511
  /// size - Return the number of elements in the referenced node.
512
53.2M
  unsigned size() const { return pip.getInt() + 1; }
513
514
  /// setSize - Update the node size.
515
8.89M
  void setSize(unsigned n) { pip.setInt(n - 1); }
516
517
  /// subtree - Access the i'th subtree reference in a branch node.
518
  /// This depends on branch nodes storing the NodeRef array as their first
519
  /// member.
520
51.8M
  NodeRef &subtree(unsigned i) const {
521
51.8M
    return reinterpret_cast<NodeRef*>(pip.getPointer())[i];
522
51.8M
  }
523
524
  /// get - Dereference as a NodeT reference.
525
  template <typename NodeT>
526
40.7M
  NodeT &get() const {
527
40.7M
    return *reinterpret_cast<NodeT*>(pip.getPointer());
528
40.7M
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::NodeRef::get<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
526
3.59M
  NodeT &get() const {
527
3.59M
    return *reinterpret_cast<NodeT*>(pip.getPointer());
528
3.59M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::NodeRef::get<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
526
35.9M
  NodeT &get() const {
527
35.9M
    return *reinterpret_cast<NodeT*>(pip.getPointer());
528
35.9M
  }
Unexecuted instantiation: llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::NodeRef::get<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::NodeRef::get<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
526
79
  NodeT &get() const {
527
79
    return *reinterpret_cast<NodeT*>(pip.getPointer());
528
79
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::NodeRef::get<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
526
86.5k
  NodeT &get() const {
527
86.5k
    return *reinterpret_cast<NodeT*>(pip.getPointer());
528
86.5k
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::NodeRef::get<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
526
1.10M
  NodeT &get() const {
527
1.10M
    return *reinterpret_cast<NodeT*>(pip.getPointer());
528
1.10M
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >& llvm::IntervalMapImpl::NodeRef::get<llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> > >() const
Line
Count
Source
526
2.65k
  NodeT &get() const {
527
2.65k
    return *reinterpret_cast<NodeT*>(pip.getPointer());
528
2.65k
  }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> >& llvm::IntervalMapImpl::NodeRef::get<llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> > >() const
529
530
0
  bool operator==(const NodeRef &RHS) const {
531
0
    if (pip == RHS.pip)
532
0
      return true;
533
0
    assert(pip.getPointer() != RHS.pip.getPointer() && "Inconsistent NodeRefs");
534
0
    return false;
535
0
  }
536
537
0
  bool operator!=(const NodeRef &RHS) const {
538
0
    return !operator==(RHS);
539
0
  }
540
};
541
542
//===----------------------------------------------------------------------===//
543
//---                      IntervalMapImpl::LeafNode                       ---//
544
//===----------------------------------------------------------------------===//
545
//
546
// Leaf nodes store up to N disjoint intervals with corresponding values.
547
//
548
// The intervals are kept sorted and fully coalesced so there are no adjacent
549
// intervals mapping to the same value.
550
//
551
// These constraints are always satisfied:
552
//
553
// - Traits::stopLess(start(i), stop(i))    - Non-empty, sane intervals.
554
//
555
// - Traits::stopLess(stop(i), start(i + 1) - Sorted.
556
//
557
// - value(i) != value(i + 1) || !Traits::adjacent(stop(i), start(i + 1))
558
//                                          - Fully coalesced.
559
//
560
//===----------------------------------------------------------------------===//
561
562
template <typename KeyT, typename ValT, unsigned N, typename Traits>
563
class LeafNode : public NodeBase<std::pair<KeyT, KeyT>, ValT, N> {
564
public:
565
2.62M
  const KeyT &start(unsigned i) const { return this->first[i].first; }
Unexecuted instantiation: llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::start(unsigned int) const
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::start(unsigned int) const
Line
Count
Source
565
2.62M
  const KeyT &start(unsigned i) const { return this->first[i].first; }
566
387M
  const KeyT &stop(unsigned i) const { return this->first[i].second; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int) const
Line
Count
Source
566
374M
  const KeyT &stop(unsigned i) const { return this->first[i].second; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int) const
Line
Count
Source
566
251
  const KeyT &stop(unsigned i) const { return this->first[i].second; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int) const
Line
Count
Source
566
14.9k
  const KeyT &stop(unsigned i) const { return this->first[i].second; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int) const
Line
Count
Source
566
12.4M
  const KeyT &stop(unsigned i) const { return this->first[i].second; }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::stop(unsigned int) const
Line
Count
Source
566
471k
  const KeyT &stop(unsigned i) const { return this->first[i].second; }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >::stop(unsigned int) const
Line
Count
Source
566
2.14k
  const KeyT &stop(unsigned i) const { return this->first[i].second; }
567
1.14M
  const ValT &value(unsigned i) const { return this->second[i]; }
568
569
371M
  KeyT &start(unsigned i) { return this->first[i].first; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::start(unsigned int)
Line
Count
Source
569
362M
  KeyT &start(unsigned i) { return this->first[i].first; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::start(unsigned int)
Line
Count
Source
569
210
  KeyT &start(unsigned i) { return this->first[i].first; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::start(unsigned int)
Line
Count
Source
569
29.7k
  KeyT &start(unsigned i) { return this->first[i].first; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::start(unsigned int)
Line
Count
Source
569
4.67M
  KeyT &start(unsigned i) { return this->first[i].first; }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >::start(unsigned int)
Line
Count
Source
569
4.84k
  KeyT &start(unsigned i) { return this->first[i].first; }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::start(unsigned int)
Line
Count
Source
569
3.82M
  KeyT &start(unsigned i) { return this->first[i].first; }
570
317M
  KeyT &stop(unsigned i) { return this->first[i].second; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int)
Line
Count
Source
570
308M
  KeyT &stop(unsigned i) { return this->first[i].second; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int)
Line
Count
Source
570
156
  KeyT &stop(unsigned i) { return this->first[i].second; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int)
Line
Count
Source
570
24.1k
  KeyT &stop(unsigned i) { return this->first[i].second; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int)
Line
Count
Source
570
5.87M
  KeyT &stop(unsigned i) { return this->first[i].second; }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >::stop(unsigned int)
Line
Count
Source
570
1.21k
  KeyT &stop(unsigned i) { return this->first[i].second; }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::stop(unsigned int)
Line
Count
Source
570
3.20M
  KeyT &stop(unsigned i) { return this->first[i].second; }
571
222M
  ValT &value(unsigned i) { return this->second[i]; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::value(unsigned int)
Line
Count
Source
571
289
  ValT &value(unsigned i) { return this->second[i]; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::value(unsigned int)
Line
Count
Source
571
39.6k
  ValT &value(unsigned i) { return this->second[i]; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::value(unsigned int)
Line
Count
Source
571
212M
  ValT &value(unsigned i) { return this->second[i]; }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::value(unsigned int)
Line
Count
Source
571
5.69M
  ValT &value(unsigned i) { return this->second[i]; }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >::value(unsigned int)
Line
Count
Source
571
2.05k
  ValT &value(unsigned i) { return this->second[i]; }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::value(unsigned int)
Line
Count
Source
571
3.40M
  ValT &value(unsigned i) { return this->second[i]; }
572
573
  /// findFrom - Find the first interval after i that may contain x.
574
  /// @param i    Starting index for the search.
575
  /// @param Size Number of elements in node.
576
  /// @param x    Key to search for.
577
  /// @return     First index with !stopLess(key[i].stop, x), or size.
578
  ///             This is the first interval that can possibly contain x.
579
141M
  unsigned findFrom(unsigned i, unsigned Size, KeyT x) const {
580
141M
    assert(i <= Size && Size <= N && "Bad indices");
581
141M
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
582
141M
           "Index is past the needed point");
583
236M
    while (i != Size && 
Traits::stopLess(stop(i), x)219M
)
++i95.5M
;
584
141M
    return i;
585
141M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::findFrom(unsigned int, unsigned int, llvm::SlotIndex) const
Line
Count
Source
579
135M
  unsigned findFrom(unsigned i, unsigned Size, KeyT x) const {
580
135M
    assert(i <= Size && Size <= N && "Bad indices");
581
135M
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
582
135M
           "Index is past the needed point");
583
227M
    while (i != Size && 
Traits::stopLess(stop(i), x)213M
)
++i91.4M
;
584
135M
    return i;
585
135M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::findFrom(unsigned int, unsigned int, llvm::SlotIndex) const
Line
Count
Source
579
18.9k
  unsigned findFrom(unsigned i, unsigned Size, KeyT x) const {
580
18.9k
    assert(i <= Size && Size <= N && "Bad indices");
581
18.9k
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
582
18.9k
           "Index is past the needed point");
583
24.5k
    while (i != Size && 
Traits::stopLess(stop(i), x)14.9k
)
++i5.62k
;
584
18.9k
    return i;
585
18.9k
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::findFrom(unsigned int, unsigned int, llvm::SlotIndex) const
Line
Count
Source
579
2.15M
  unsigned findFrom(unsigned i, unsigned Size, KeyT x) const {
580
2.15M
    assert(i <= Size && Size <= N && "Bad indices");
581
2.15M
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
582
2.15M
           "Index is past the needed point");
583
6.23M
    while (i != Size && 
Traits::stopLess(stop(i), x)5.71M
)
++i4.07M
;
584
2.15M
    return i;
585
2.15M
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::findFrom(unsigned int, unsigned int, long long) const
Line
Count
Source
579
3.62M
  unsigned findFrom(unsigned i, unsigned Size, KeyT x) const {
580
3.62M
    assert(i <= Size && Size <= N && "Bad indices");
581
3.62M
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
582
3.62M
           "Index is past the needed point");
583
3.64M
    while (i != Size && 
Traits::stopLess(stop(i), x)471k
)
++i27.2k
;
584
3.62M
    return i;
585
3.62M
  }
586
587
  /// safeFind - Find an interval that is known to exist. This is the same as
588
  /// findFrom except is it assumed that x is at least within range of the last
589
  /// interval.
590
  /// @param i Starting index for the search.
591
  /// @param x Key to search for.
592
  /// @return  First index with !stopLess(key[i].stop, x), never size.
593
  ///          This is the first interval that can possibly contain x.
594
44.1M
  unsigned safeFind(unsigned i, KeyT x) const {
595
44.1M
    assert(i < N && "Bad index");
596
44.1M
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
597
44.1M
           "Index is past the needed point");
598
166M
    while (Traits::stopLess(stop(i), x)) 
++i122M
;
599
44.1M
    assert(i < N && "Unsafe intervals");
600
44.1M
    return i;
601
44.1M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::safeFind(unsigned int, llvm::SlotIndex) const
Line
Count
Source
594
42.0M
  unsigned safeFind(unsigned i, KeyT x) const {
595
42.0M
    assert(i < N && "Bad index");
596
42.0M
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
597
42.0M
           "Index is past the needed point");
598
161M
    while (Traits::stopLess(stop(i), x)) 
++i119M
;
599
42.0M
    assert(i < N && "Unsafe intervals");
600
42.0M
    return i;
601
42.0M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::safeFind(unsigned int, llvm::SlotIndex) const
Line
Count
Source
594
68
  unsigned safeFind(unsigned i, KeyT x) const {
595
68
    assert(i < N && "Bad index");
596
68
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
597
68
           "Index is past the needed point");
598
251
    while (Traits::stopLess(stop(i), x)) 
++i183
;
599
68
    assert(i < N && "Unsafe intervals");
600
68
    return i;
601
68
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::safeFind(unsigned int, llvm::SlotIndex) const
Line
Count
Source
594
2.07M
  unsigned safeFind(unsigned i, KeyT x) const {
595
2.07M
    assert(i < N && "Bad index");
596
2.07M
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
597
2.07M
           "Index is past the needed point");
598
5.58M
    while (Traits::stopLess(stop(i), x)) 
++i3.50M
;
599
2.07M
    assert(i < N && "Unsafe intervals");
600
2.07M
    return i;
601
2.07M
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >::safeFind(unsigned int, long long) const
Line
Count
Source
594
2.14k
  unsigned safeFind(unsigned i, KeyT x) const {
595
2.14k
    assert(i < N && "Bad index");
596
2.14k
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
597
2.14k
           "Index is past the needed point");
598
2.14k
    while (Traits::stopLess(stop(i), x)) 
++i0
;
599
2.14k
    assert(i < N && "Unsafe intervals");
600
2.14k
    return i;
601
2.14k
  }
602
603
  /// safeLookup - Lookup mapped value for a safe key.
604
  /// It is assumed that x is within range of the last entry.
605
  /// @param x        Key to search for.
606
  /// @param NotFound Value to return if x is not in any interval.
607
  /// @return         The mapped value at x or NotFound.
608
1.33M
  ValT safeLookup(KeyT x, ValT NotFound) const {
609
1.33M
    unsigned i = safeFind(0, x);
610
1.33M
    return Traits::startLess(x, start(i)) ? 
NotFound188k
:
value(i)1.14M
;
611
1.33M
  }
612
613
  unsigned insertFrom(unsigned &Pos, unsigned Size, KeyT a, KeyT b, ValT y);
614
};
615
616
/// insertFrom - Add mapping of [a;b] to y if possible, coalescing as much as
617
/// possible. This may cause the node to grow by 1, or it may cause the node
618
/// to shrink because of coalescing.
619
/// @param Pos  Starting index = insertFrom(0, size, a)
620
/// @param Size Number of elements in node.
621
/// @param a    Interval start.
622
/// @param b    Interval stop.
623
/// @param y    Value be mapped.
624
/// @return     (insert position, new size), or (i, Capacity+1) on overflow.
625
template <typename KeyT, typename ValT, unsigned N, typename Traits>
626
unsigned LeafNode<KeyT, ValT, N, Traits>::
627
23.3M
insertFrom(unsigned &Pos, unsigned Size, KeyT a, KeyT b, ValT y) {
628
23.3M
  unsigned i = Pos;
629
23.3M
  assert(i <= Size && Size <= N && "Invalid index");
630
23.3M
  assert(!Traits::stopLess(b, a) && "Invalid interval");
631
23.3M
632
23.3M
  // Verify the findFrom invariant.
633
23.3M
  assert((i == 0 || Traits::stopLess(stop(i - 1), a)));
634
23.3M
  assert((i == Size || !Traits::stopLess(stop(i), a)));
635
23.3M
  assert((i == Size || Traits::stopLess(b, start(i))) && "Overlapping insert");
636
23.3M
637
23.3M
  // Coalesce with previous interval.
638
23.3M
  if (i && 
value(i - 1) == y13.9M
&&
Traits::adjacent(stop(i - 1), a)6.76M
) {
639
2.78M
    Pos = i - 1;
640
2.78M
    // Also coalesce with next interval?
641
2.78M
    if (i != Size && 
value(i) == y2.70M
&&
Traits::adjacent(b, start(i))1.89M
) {
642
554k
      stop(i - 1) = stop(i);
643
554k
      this->erase(i, Size);
644
554k
      return Size - 1;
645
554k
    }
646
2.23M
    stop(i - 1) = b;
647
2.23M
    return Size;
648
2.23M
  }
649
20.5M
650
20.5M
  // Detect overflow.
651
20.5M
  if (i == N)
652
346k
    return N + 1;
653
20.2M
654
20.2M
  // Add new interval at end.
655
20.2M
  if (i == Size) {
656
10.4M
    start(i) = a;
657
10.4M
    stop(i) = b;
658
10.4M
    value(i) = y;
659
10.4M
    return Size + 1;
660
10.4M
  }
661
9.75M
662
9.75M
  // Try to coalesce with following interval.
663
9.75M
  if (value(i) == y && 
Traits::adjacent(b, start(i))4.66M
) {
664
899k
    start(i) = a;
665
899k
    return Size;
666
899k
  }
667
8.85M
668
8.85M
  // We must insert before i. Detect overflow.
669
8.85M
  if (Size == N)
670
1.17M
    return N + 1;
671
7.67M
672
7.67M
  // Insert before i.
673
7.67M
  this->shift(i, Size);
674
7.67M
  start(i) = a;
675
7.67M
  stop(i) = b;
676
7.67M
  value(i) = y;
677
7.67M
  return Size + 1;
678
7.67M
}
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insertFrom(unsigned int&, unsigned int, llvm::SlotIndex, llvm::SlotIndex, DbgValueLocation)
Line
Count
Source
627
43
insertFrom(unsigned &Pos, unsigned Size, KeyT a, KeyT b, ValT y) {
628
43
  unsigned i = Pos;
629
43
  assert(i <= Size && Size <= N && "Invalid index");
630
43
  assert(!Traits::stopLess(b, a) && "Invalid interval");
631
43
632
43
  // Verify the findFrom invariant.
633
43
  assert((i == 0 || Traits::stopLess(stop(i - 1), a)));
634
43
  assert((i == Size || !Traits::stopLess(stop(i), a)));
635
43
  assert((i == Size || Traits::stopLess(b, start(i))) && "Overlapping insert");
636
43
637
43
  // Coalesce with previous interval.
638
43
  if (i && value(i - 1) == y && 
Traits::adjacent(stop(i - 1), a)34
) {
639
29
    Pos = i - 1;
640
29
    // Also coalesce with next interval?
641
29
    if (i != Size && 
value(i) == y23
&&
Traits::adjacent(b, start(i))13
) {
642
3
      stop(i - 1) = stop(i);
643
3
      this->erase(i, Size);
644
3
      return Size - 1;
645
3
    }
646
26
    stop(i - 1) = b;
647
26
    return Size;
648
26
  }
649
14
650
14
  // Detect overflow.
651
14
  if (i == N)
652
0
    return N + 1;
653
14
654
14
  // Add new interval at end.
655
14
  if (i == Size) {
656
10
    start(i) = a;
657
10
    stop(i) = b;
658
10
    value(i) = y;
659
10
    return Size + 1;
660
10
  }
661
4
662
4
  // Try to coalesce with following interval.
663
4
  if (value(i) == y && 
Traits::adjacent(b, start(i))2
) {
664
0
    start(i) = a;
665
0
    return Size;
666
0
  }
667
4
668
4
  // We must insert before i. Detect overflow.
669
4
  if (Size == N)
670
0
    return N + 1;
671
4
672
4
  // Insert before i.
673
4
  this->shift(i, Size);
674
4
  start(i) = a;
675
4
  stop(i) = b;
676
4
  value(i) = y;
677
4
  return Size + 1;
678
4
}
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insertFrom(unsigned int&, unsigned int, llvm::SlotIndex, llvm::SlotIndex, DbgValueLocation)
Line
Count
Source
627
9.63k
insertFrom(unsigned &Pos, unsigned Size, KeyT a, KeyT b, ValT y) {
628
9.63k
  unsigned i = Pos;
629
9.63k
  assert(i <= Size && Size <= N && "Invalid index");
630
9.63k
  assert(!Traits::stopLess(b, a) && "Invalid interval");
631
9.63k
632
9.63k
  // Verify the findFrom invariant.
633
9.63k
  assert((i == 0 || Traits::stopLess(stop(i - 1), a)));
634
9.63k
  assert((i == Size || !Traits::stopLess(stop(i), a)));
635
9.63k
  assert((i == Size || Traits::stopLess(b, start(i))) && "Overlapping insert");
636
9.63k
637
9.63k
  // Coalesce with previous interval.
638
9.63k
  if (i && 
value(i - 1) == y4.94k
&&
Traits::adjacent(stop(i - 1), a)4.68k
) {
639
4.63k
    Pos = i - 1;
640
4.63k
    // Also coalesce with next interval?
641
4.63k
    if (i != Size && 
value(i) == y99
&&
Traits::adjacent(b, start(i))29
) {
642
9
      stop(i - 1) = stop(i);
643
9
      this->erase(i, Size);
644
9
      return Size - 1;
645
9
    }
646
4.62k
    stop(i - 1) = b;
647
4.62k
    return Size;
648
4.62k
  }
649
5.00k
650
5.00k
  // Detect overflow.
651
5.00k
  if (i == N)
652
5
    return N + 1;
653
4.99k
654
4.99k
  // Add new interval at end.
655
4.99k
  if (i == Size) {
656
4.98k
    start(i) = a;
657
4.98k
    stop(i) = b;
658
4.98k
    value(i) = y;
659
4.98k
    return Size + 1;
660
4.98k
  }
661
9
662
9
  // Try to coalesce with following interval.
663
9
  if (value(i) == y && 
Traits::adjacent(b, start(i))0
) {
664
0
    start(i) = a;
665
0
    return Size;
666
0
  }
667
9
668
9
  // We must insert before i. Detect overflow.
669
9
  if (Size == N)
670
0
    return N + 1;
671
9
672
9
  // Insert before i.
673
9
  this->shift(i, Size);
674
9
  start(i) = a;
675
9
  stop(i) = b;
676
9
  value(i) = y;
677
9
  return Size + 1;
678
9
}
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insertFrom(unsigned int&, unsigned int, llvm::SlotIndex, llvm::SlotIndex, llvm::LiveInterval*)
Line
Count
Source
627
17.5M
insertFrom(unsigned &Pos, unsigned Size, KeyT a, KeyT b, ValT y) {
628
17.5M
  unsigned i = Pos;
629
17.5M
  assert(i <= Size && Size <= N && "Invalid index");
630
17.5M
  assert(!Traits::stopLess(b, a) && "Invalid interval");
631
17.5M
632
17.5M
  // Verify the findFrom invariant.
633
17.5M
  assert((i == 0 || Traits::stopLess(stop(i - 1), a)));
634
17.5M
  assert((i == Size || !Traits::stopLess(stop(i), a)));
635
17.5M
  assert((i == Size || Traits::stopLess(b, start(i))) && "Overlapping insert");
636
17.5M
637
17.5M
  // Coalesce with previous interval.
638
17.5M
  if (i && 
value(i - 1) == y11.7M
&&
Traits::adjacent(stop(i - 1), a)4.69M
) {
639
1.64M
    Pos = i - 1;
640
1.64M
    // Also coalesce with next interval?
641
1.64M
    if (i != Size && value(i) == y && 
Traits::adjacent(b, start(i))868k
) {
642
241k
      stop(i - 1) = stop(i);
643
241k
      this->erase(i, Size);
644
241k
      return Size - 1;
645
241k
    }
646
1.40M
    stop(i - 1) = b;
647
1.40M
    return Size;
648
1.40M
  }
649
15.9M
650
15.9M
  // Detect overflow.
651
15.9M
  if (i == N)
652
333k
    return N + 1;
653
15.5M
654
15.5M
  // Add new interval at end.
655
15.5M
  if (i == Size) {
656
6.81M
    start(i) = a;
657
6.81M
    stop(i) = b;
658
6.81M
    value(i) = y;
659
6.81M
    return Size + 1;
660
6.81M
  }
661
8.77M
662
8.77M
  // Try to coalesce with following interval.
663
8.77M
  if (value(i) == y && 
Traits::adjacent(b, start(i))3.72M
) {
664
442k
    start(i) = a;
665
442k
    return Size;
666
442k
  }
667
8.33M
668
8.33M
  // We must insert before i. Detect overflow.
669
8.33M
  if (Size == N)
670
1.14M
    return N + 1;
671
7.19M
672
7.19M
  // Insert before i.
673
7.19M
  this->shift(i, Size);
674
7.19M
  start(i) = a;
675
7.19M
  stop(i) = b;
676
7.19M
  value(i) = y;
677
7.19M
  return Size + 1;
678
7.19M
}
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insertFrom(unsigned int&, unsigned int, llvm::SlotIndex, llvm::SlotIndex, unsigned int)
Line
Count
Source
627
2.38M
insertFrom(unsigned &Pos, unsigned Size, KeyT a, KeyT b, ValT y) {
628
2.38M
  unsigned i = Pos;
629
2.38M
  assert(i <= Size && Size <= N && "Invalid index");
630
2.38M
  assert(!Traits::stopLess(b, a) && "Invalid interval");
631
2.38M
632
2.38M
  // Verify the findFrom invariant.
633
2.38M
  assert((i == 0 || Traits::stopLess(stop(i - 1), a)));
634
2.38M
  assert((i == Size || !Traits::stopLess(stop(i), a)));
635
2.38M
  assert((i == Size || Traits::stopLess(b, start(i))) && "Overlapping insert");
636
2.38M
637
2.38M
  // Coalesce with previous interval.
638
2.38M
  if (i && 
value(i - 1) == y2.13M
&&
Traits::adjacent(stop(i - 1), a)2.06M
) {
639
1.13M
    Pos = i - 1;
640
1.13M
    // Also coalesce with next interval?
641
1.13M
    if (i != Size && 
value(i) == y1.05M
&&
Traits::adjacent(b, start(i))1.02M
) {
642
313k
      stop(i - 1) = stop(i);
643
313k
      this->erase(i, Size);
644
313k
      return Size - 1;
645
313k
    }
646
817k
    stop(i - 1) = b;
647
817k
    return Size;
648
817k
  }
649
1.25M
650
1.25M
  // Detect overflow.
651
1.25M
  if (i == N)
652
13.0k
    return N + 1;
653
1.23M
654
1.23M
  // Add new interval at end.
655
1.23M
  if (i == Size) {
656
485k
    start(i) = a;
657
485k
    stop(i) = b;
658
485k
    value(i) = y;
659
485k
    return Size + 1;
660
485k
  }
661
752k
662
752k
  // Try to coalesce with following interval.
663
752k
  if (value(i) == y && 
Traits::adjacent(b, start(i))716k
) {
664
261k
    start(i) = a;
665
261k
    return Size;
666
261k
  }
667
491k
668
491k
  // We must insert before i. Detect overflow.
669
491k
  if (Size == N)
670
36.0k
    return N + 1;
671
455k
672
455k
  // Insert before i.
673
455k
  this->shift(i, Size);
674
455k
  start(i) = a;
675
455k
  stop(i) = b;
676
455k
  value(i) = y;
677
455k
  return Size + 1;
678
455k
}
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >::insertFrom(unsigned int&, unsigned int, long long, long long, (anonymous namespace)::UnitT)
Line
Count
Source
627
1.35k
insertFrom(unsigned &Pos, unsigned Size, KeyT a, KeyT b, ValT y) {
628
1.35k
  unsigned i = Pos;
629
1.35k
  assert(i <= Size && Size <= N && "Invalid index");
630
1.35k
  assert(!Traits::stopLess(b, a) && "Invalid interval");
631
1.35k
632
1.35k
  // Verify the findFrom invariant.
633
1.35k
  assert((i == 0 || Traits::stopLess(stop(i - 1), a)));
634
1.35k
  assert((i == Size || !Traits::stopLess(stop(i), a)));
635
1.35k
  assert((i == Size || Traits::stopLess(b, start(i))) && "Overlapping insert");
636
1.35k
637
1.35k
  // Coalesce with previous interval.
638
1.35k
  if (i && 
value(i - 1) == y0
&&
Traits::adjacent(stop(i - 1), a)0
) {
639
0
    Pos = i - 1;
640
0
    // Also coalesce with next interval?
641
0
    if (i != Size && value(i) == y && Traits::adjacent(b, start(i))) {
642
0
      stop(i - 1) = stop(i);
643
0
      this->erase(i, Size);
644
0
      return Size - 1;
645
0
    }
646
0
    stop(i - 1) = b;
647
0
    return Size;
648
0
  }
649
1.35k
650
1.35k
  // Detect overflow.
651
1.35k
  if (i == N)
652
0
    return N + 1;
653
1.35k
654
1.35k
  // Add new interval at end.
655
1.35k
  if (i == Size) {
656
0
    start(i) = a;
657
0
    stop(i) = b;
658
0
    value(i) = y;
659
0
    return Size + 1;
660
0
  }
661
1.35k
662
1.35k
  // Try to coalesce with following interval.
663
1.35k
  if (value(i) == y && Traits::adjacent(b, start(i))) {
664
468
    start(i) = a;
665
468
    return Size;
666
468
  }
667
888
668
888
  // We must insert before i. Detect overflow.
669
888
  if (Size == N)
670
192
    return N + 1;
671
696
672
696
  // Insert before i.
673
696
  this->shift(i, Size);
674
696
  start(i) = a;
675
696
  stop(i) = b;
676
696
  value(i) = y;
677
696
  return Size + 1;
678
696
}
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::insertFrom(unsigned int&, unsigned int, long long, long long, (anonymous namespace)::UnitT)
Line
Count
Source
627
3.37M
insertFrom(unsigned &Pos, unsigned Size, KeyT a, KeyT b, ValT y) {
628
3.37M
  unsigned i = Pos;
629
3.37M
  assert(i <= Size && Size <= N && "Invalid index");
630
3.37M
  assert(!Traits::stopLess(b, a) && "Invalid interval");
631
3.37M
632
3.37M
  // Verify the findFrom invariant.
633
3.37M
  assert((i == 0 || Traits::stopLess(stop(i - 1), a)));
634
3.37M
  assert((i == Size || !Traits::stopLess(stop(i), a)));
635
3.37M
  assert((i == Size || Traits::stopLess(b, start(i))) && "Overlapping insert");
636
3.37M
637
3.37M
  // Coalesce with previous interval.
638
3.37M
  if (i && 
value(i - 1) == y0
&&
Traits::adjacent(stop(i - 1), a)0
) {
639
0
    Pos = i - 1;
640
0
    // Also coalesce with next interval?
641
0
    if (i != Size && value(i) == y && Traits::adjacent(b, start(i))) {
642
0
      stop(i - 1) = stop(i);
643
0
      this->erase(i, Size);
644
0
      return Size - 1;
645
0
    }
646
0
    stop(i - 1) = b;
647
0
    return Size;
648
0
  }
649
3.37M
650
3.37M
  // Detect overflow.
651
3.37M
  if (i == N)
652
0
    return N + 1;
653
3.37M
654
3.37M
  // Add new interval at end.
655
3.37M
  if (i == Size) {
656
3.15M
    start(i) = a;
657
3.15M
    stop(i) = b;
658
3.15M
    value(i) = y;
659
3.15M
    return Size + 1;
660
3.15M
  }
661
219k
662
219k
  // Try to coalesce with following interval.
663
219k
  if (value(i) == y && Traits::adjacent(b, start(i))) {
664
194k
    start(i) = a;
665
194k
    return Size;
666
194k
  }
667
24.2k
668
24.2k
  // We must insert before i. Detect overflow.
669
24.2k
  if (Size == N)
670
90
    return N + 1;
671
24.1k
672
24.1k
  // Insert before i.
673
24.1k
  this->shift(i, Size);
674
24.1k
  start(i) = a;
675
24.1k
  stop(i) = b;
676
24.1k
  value(i) = y;
677
24.1k
  return Size + 1;
678
24.1k
}
679
680
//===----------------------------------------------------------------------===//
681
//---                   IntervalMapImpl::BranchNode                        ---//
682
//===----------------------------------------------------------------------===//
683
//
684
// A branch node stores references to 1--N subtrees all of the same height.
685
//
686
// The key array in a branch node holds the rightmost stop key of each subtree.
687
// It is redundant to store the last stop key since it can be found in the
688
// parent node, but doing so makes tree balancing a lot simpler.
689
//
690
// It is unusual for a branch node to only have one subtree, but it can happen
691
// in the root node if it is smaller than the normal nodes.
692
//
693
// When all of the leaf nodes from all the subtrees are concatenated, they must
694
// satisfy the same constraints as a single leaf node. They must be sorted,
695
// sane, and fully coalesced.
696
//
697
//===----------------------------------------------------------------------===//
698
699
template <typename KeyT, typename ValT, unsigned N, typename Traits>
700
class BranchNode : public NodeBase<NodeRef, KeyT, N> {
701
public:
702
105M
  const KeyT &stop(unsigned i) const { return this->second[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int) const
Line
Count
Source
702
81.3M
  const KeyT &stop(unsigned i) const { return this->second[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int) const
Line
Count
Source
702
21.1M
  const KeyT &stop(unsigned i) const { return this->second[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int) const
Line
Count
Source
702
73
  const KeyT &stop(unsigned i) const { return this->second[i]; }
Unexecuted instantiation: llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int) const
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int) const
Line
Count
Source
702
2.49M
  const KeyT &stop(unsigned i) const { return this->second[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int) const
Line
Count
Source
702
461k
  const KeyT &stop(unsigned i) const { return this->second[i]; }
DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::stop(unsigned int) const
Line
Count
Source
702
2.15k
  const KeyT &stop(unsigned i) const { return this->second[i]; }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> >::stop(unsigned int) const
703
344k
  const NodeRef &subtree(unsigned i) const { return this->first[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::subtree(unsigned int) const
Line
Count
Source
703
303k
  const NodeRef &subtree(unsigned i) const { return this->first[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::subtree(unsigned int) const
Line
Count
Source
703
40.5k
  const NodeRef &subtree(unsigned i) const { return this->first[i]; }
704
705
6.43M
  KeyT &stop(unsigned i) { return this->second[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int)
Line
Count
Source
705
1.24M
  KeyT &stop(unsigned i) { return this->second[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int)
Line
Count
Source
705
4.97M
  KeyT &stop(unsigned i) { return this->second[i]; }
Unexecuted instantiation: llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int)
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int)
Line
Count
Source
705
21
  KeyT &stop(unsigned i) { return this->second[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int)
Line
Count
Source
705
27.9k
  KeyT &stop(unsigned i) { return this->second[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::stop(unsigned int)
Line
Count
Source
705
190k
  KeyT &stop(unsigned i) { return this->second[i]; }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> >::stop(unsigned int)
DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::stop(unsigned int)
Line
Count
Source
705
518
  KeyT &stop(unsigned i) { return this->second[i]; }
706
1.87M
  NodeRef &subtree(unsigned i) { return this->first[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::subtree(unsigned int)
Line
Count
Source
706
1.70M
  NodeRef &subtree(unsigned i) { return this->first[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::subtree(unsigned int)
Line
Count
Source
706
10
  NodeRef &subtree(unsigned i) { return this->first[i]; }
Unexecuted instantiation: llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::subtree(unsigned int)
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::subtree(unsigned int)
Line
Count
Source
706
99.8k
  NodeRef &subtree(unsigned i) { return this->first[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::subtree(unsigned int)
Line
Count
Source
706
61.2k
  NodeRef &subtree(unsigned i) { return this->first[i]; }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::subtree(unsigned int)
Line
Count
Source
706
1.77k
  NodeRef &subtree(unsigned i) { return this->first[i]; }
DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::subtree(unsigned int)
Line
Count
Source
706
340
  NodeRef &subtree(unsigned i) { return this->first[i]; }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> >::subtree(unsigned int)
707
708
  /// findFrom - Find the first subtree after i that may contain x.
709
  /// @param i    Starting index for the search.
710
  /// @param Size Number of elements in node.
711
  /// @param x    Key to search for.
712
  /// @return     First index with !stopLess(key[i], x), or size.
713
  ///             This is the first subtree that can possibly contain x.
714
34.7M
  unsigned findFrom(unsigned i, unsigned Size, KeyT x) const {
715
34.7M
    assert(i <= Size && Size <= N && "Bad indices");
716
34.7M
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
717
34.7M
           "Index to findFrom is past the needed point");
718
85.4M
    while (i != Size && 
Traits::stopLess(stop(i), x)82.9M
)
++i50.6M
;
719
34.7M
    return i;
720
34.7M
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::findFrom(unsigned int, unsigned int, llvm::SlotIndex) const
Line
Count
Source
714
34.1M
  unsigned findFrom(unsigned i, unsigned Size, KeyT x) const {
715
34.1M
    assert(i <= Size && Size <= N && "Bad indices");
716
34.1M
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
717
34.1M
           "Index to findFrom is past the needed point");
718
83.8M
    while (i != Size && 
Traits::stopLess(stop(i), x)81.3M
)
++i49.6M
;
719
34.1M
    return i;
720
34.1M
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::findFrom(unsigned int, unsigned int, llvm::SlotIndex) const
Line
Count
Source
714
73
  unsigned findFrom(unsigned i, unsigned Size, KeyT x) const {
715
73
    assert(i <= Size && Size <= N && "Bad indices");
716
73
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
717
73
           "Index to findFrom is past the needed point");
718
82
    while (i != Size && 
Traits::stopLess(stop(i), x)73
)
++i9
;
719
73
    return i;
720
73
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::findFrom(unsigned int, unsigned int, llvm::SlotIndex) const
Line
Count
Source
714
666k
  unsigned findFrom(unsigned i, unsigned Size, KeyT x) const {
715
666k
    assert(i <= Size && Size <= N && "Bad indices");
716
666k
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
717
666k
           "Index to findFrom is past the needed point");
718
1.59M
    while (i != Size && 
Traits::stopLess(stop(i), x)1.55M
)
++i932k
;
719
666k
    return i;
720
666k
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::findFrom(unsigned int, unsigned int, long long) const
Line
Count
Source
714
2.15k
  unsigned findFrom(unsigned i, unsigned Size, KeyT x) const {
715
2.15k
    assert(i <= Size && Size <= N && "Bad indices");
716
2.15k
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
717
2.15k
           "Index to findFrom is past the needed point");
718
2.15k
    while (i != Size && 
Traits::stopLess(stop(i), x)2.15k
)
++i8
;
719
2.15k
    return i;
720
2.15k
  }
721
722
  /// safeFind - Find a subtree that is known to exist. This is the same as
723
  /// findFrom except is it assumed that x is in range.
724
  /// @param i Starting index for the search.
725
  /// @param x Key to search for.
726
  /// @return  First index with !stopLess(key[i], x), never size.
727
  ///          This is the first subtree that can possibly contain x.
728
4.55M
  unsigned safeFind(unsigned i, KeyT x) const {
729
4.55M
    assert(i < N && "Bad index");
730
4.55M
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
731
4.55M
           "Index is past the needed point");
732
22.2M
    while (Traits::stopLess(stop(i), x)) 
++i17.7M
;
733
4.55M
    assert(i < N && "Unsafe intervals");
734
4.55M
    return i;
735
4.55M
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::safeFind(unsigned int, llvm::SlotIndex) const
Line
Count
Source
728
4.16M
  unsigned safeFind(unsigned i, KeyT x) const {
729
4.16M
    assert(i < N && "Bad index");
730
4.16M
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
731
4.16M
           "Index is past the needed point");
732
21.1M
    while (Traits::stopLess(stop(i), x)) 
++i16.9M
;
733
4.16M
    assert(i < N && "Unsafe intervals");
734
4.16M
    return i;
735
4.16M
  }
Unexecuted instantiation: llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::safeFind(unsigned int, llvm::SlotIndex) const
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::safeFind(unsigned int, llvm::SlotIndex) const
Line
Count
Source
728
86.7k
  unsigned safeFind(unsigned i, KeyT x) const {
729
86.7k
    assert(i < N && "Bad index");
730
86.7k
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
731
86.7k
           "Index is past the needed point");
732
461k
    while (Traits::stopLess(stop(i), x)) 
++i374k
;
733
86.7k
    assert(i < N && "Unsafe intervals");
734
86.7k
    return i;
735
86.7k
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::safeFind(unsigned int, llvm::SlotIndex) const
Line
Count
Source
728
303k
  unsigned safeFind(unsigned i, KeyT x) const {
729
303k
    assert(i < N && "Bad index");
730
303k
    assert((i == 0 || Traits::stopLess(stop(i - 1), x)) &&
731
303k
           "Index is past the needed point");
732
637k
    while (Traits::stopLess(stop(i), x)) 
++i333k
;
733
303k
    assert(i < N && "Unsafe intervals");
734
303k
    return i;
735
303k
  }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> >::safeFind(unsigned int, long long) const
736
737
  /// safeLookup - Get the subtree containing x, Assuming that x is in range.
738
  /// @param x Key to search for.
739
  /// @return  Subtree containing x
740
344k
  NodeRef safeLookup(KeyT x) const {
741
344k
    return subtree(safeFind(0, x));
742
344k
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::safeLookup(llvm::SlotIndex) const
Line
Count
Source
740
303k
  NodeRef safeLookup(KeyT x) const {
741
303k
    return subtree(safeFind(0, x));
742
303k
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::safeLookup(llvm::SlotIndex) const
Line
Count
Source
740
40.5k
  NodeRef safeLookup(KeyT x) const {
741
40.5k
    return subtree(safeFind(0, x));
742
40.5k
  }
743
744
  /// insert - Insert a new (subtree, stop) pair.
745
  /// @param i    Insert position, following entries will be shifted.
746
  /// @param Size Number of elements in node.
747
  /// @param Node Subtree to insert.
748
  /// @param Stop Last key in subtree.
749
416k
  void insert(unsigned i, unsigned Size, NodeRef Node, KeyT Stop) {
750
416k
    assert(Size < N && "branch node overflow");
751
416k
    assert(i <= Size && "Bad insert position");
752
416k
    this->shift(i, Size);
753
416k
    subtree(i) = Node;
754
416k
    stop(i) = Stop;
755
416k
  }
Unexecuted instantiation: llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insert(unsigned int, unsigned int, llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex)
Unexecuted instantiation: llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insert(unsigned int, unsigned int, llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex)
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insert(unsigned int, unsigned int, llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex)
Line
Count
Source
749
306k
  void insert(unsigned i, unsigned Size, NodeRef Node, KeyT Stop) {
750
306k
    assert(Size < N && "branch node overflow");
751
306k
    assert(i <= Size && "Bad insert position");
752
306k
    this->shift(i, Size);
753
306k
    subtree(i) = Node;
754
306k
    stop(i) = Stop;
755
306k
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insert(unsigned int, unsigned int, llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex)
Line
Count
Source
749
99.8k
  void insert(unsigned i, unsigned Size, NodeRef Node, KeyT Stop) {
750
99.8k
    assert(Size < N && "branch node overflow");
751
99.8k
    assert(i <= Size && "Bad insert position");
752
99.8k
    this->shift(i, Size);
753
99.8k
    subtree(i) = Node;
754
99.8k
    stop(i) = Stop;
755
99.8k
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insert(unsigned int, unsigned int, llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex)
Line
Count
Source
749
7.90k
  void insert(unsigned i, unsigned Size, NodeRef Node, KeyT Stop) {
750
7.90k
    assert(Size < N && "branch node overflow");
751
7.90k
    assert(i <= Size && "Bad insert position");
752
7.90k
    this->shift(i, Size);
753
7.90k
    subtree(i) = Node;
754
7.90k
    stop(i) = Stop;
755
7.90k
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insert(unsigned int, unsigned int, llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex)
Line
Count
Source
749
1.77k
  void insert(unsigned i, unsigned Size, NodeRef Node, KeyT Stop) {
750
1.77k
    assert(Size < N && "branch node overflow");
751
1.77k
    assert(i <= Size && "Bad insert position");
752
1.77k
    this->shift(i, Size);
753
1.77k
    subtree(i) = Node;
754
1.77k
    stop(i) = Stop;
755
1.77k
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::insert(unsigned int, unsigned int, llvm::IntervalMapImpl::NodeRef, long long)
Line
Count
Source
749
80
  void insert(unsigned i, unsigned Size, NodeRef Node, KeyT Stop) {
750
80
    assert(Size < N && "branch node overflow");
751
80
    assert(i <= Size && "Bad insert position");
752
80
    this->shift(i, Size);
753
80
    subtree(i) = Node;
754
80
    stop(i) = Stop;
755
80
  }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> >::insert(unsigned int, unsigned int, llvm::IntervalMapImpl::NodeRef, long long)
756
};
757
758
//===----------------------------------------------------------------------===//
759
//---                         IntervalMapImpl::Path                        ---//
760
//===----------------------------------------------------------------------===//
761
//
762
// A Path is used by iterators to represent a position in a B+-tree, and the
763
// path to get there from the root.
764
//
765
// The Path class also contains the tree navigation code that doesn't have to
766
// be templatized.
767
//
768
//===----------------------------------------------------------------------===//
769
770
class Path {
771
  /// Entry - Each step in the path is a node pointer and an offset into that
772
  /// node.
773
  struct Entry {
774
    void *node;
775
    unsigned size;
776
    unsigned offset;
777
778
    Entry(void *Node, unsigned Size, unsigned Offset)
779
163M
      : node(Node), size(Size), offset(Offset) {}
780
781
    Entry(NodeRef Node, unsigned Offset)
782
47.5M
      : node(&Node.subtree(0)), size(Node.size()), offset(Offset) {}
783
784
54.1M
    NodeRef &subtree(unsigned i) const {
785
54.1M
      return reinterpret_cast<NodeRef*>(node)[i];
786
54.1M
    }
787
  };
788
789
  /// path - The path entries, path[0] is the root node, path.back() is a leaf.
790
  SmallVector<Entry, 4> path;
791
792
public:
793
  // Node accessors.
794
6.54M
  template <typename NodeT> NodeT &node(unsigned Level) const {
795
6.54M
    return *reinterpret_cast<NodeT*>(path[Level].node);
796
6.54M
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(unsigned int) const
Line
Count
Source
794
1.82M
  template <typename NodeT> NodeT &node(unsigned Level) const {
795
1.82M
    return *reinterpret_cast<NodeT*>(path[Level].node);
796
1.82M
  }
Unexecuted instantiation: llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(unsigned int) const
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(unsigned int) const
Line
Count
Source
794
16
  template <typename NodeT> NodeT &node(unsigned Level) const {
795
16
    return *reinterpret_cast<NodeT*>(path[Level].node);
796
16
  }
Unexecuted instantiation: llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(unsigned int) const
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(unsigned int) const
Line
Count
Source
794
3.31M
  template <typename NodeT> NodeT &node(unsigned Level) const {
795
3.31M
    return *reinterpret_cast<NodeT*>(path[Level].node);
796
3.31M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(unsigned int) const
Line
Count
Source
794
1.17M
  template <typename NodeT> NodeT &node(unsigned Level) const {
795
1.17M
    return *reinterpret_cast<NodeT*>(path[Level].node);
796
1.17M
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(unsigned int) const
Line
Count
Source
794
28.3k
  template <typename NodeT> NodeT &node(unsigned Level) const {
795
28.3k
    return *reinterpret_cast<NodeT*>(path[Level].node);
796
28.3k
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 11u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(unsigned int) const
Line
Count
Source
794
157k
  template <typename NodeT> NodeT &node(unsigned Level) const {
795
157k
    return *reinterpret_cast<NodeT*>(path[Level].node);
796
157k
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(unsigned int) const
Line
Count
Source
794
37.1k
  template <typename NodeT> NodeT &node(unsigned Level) const {
795
37.1k
    return *reinterpret_cast<NodeT*>(path[Level].node);
796
37.1k
  }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> > >(unsigned int) const
DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> > >(unsigned int) const
Line
Count
Source
794
348
  template <typename NodeT> NodeT &node(unsigned Level) const {
795
348
    return *reinterpret_cast<NodeT*>(path[Level].node);
796
348
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >& llvm::IntervalMapImpl::Path::node<llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> > >(unsigned int) const
Line
Count
Source
794
192
  template <typename NodeT> NodeT &node(unsigned Level) const {
795
192
    return *reinterpret_cast<NodeT*>(path[Level].node);
796
192
  }
797
1.57M
  unsigned size(unsigned Level) const { return path[Level].size; }
798
0
  unsigned offset(unsigned Level) const { return path[Level].offset; }
799
12.4M
  unsigned &offset(unsigned Level) { return path[Level].offset; }
800
801
  // Leaf accessors.
802
825M
  template <typename NodeT> NodeT &leaf() const {
803
825M
    return *reinterpret_cast<NodeT*>(path.back().node);
804
825M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::leaf<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
802
819M
  template <typename NodeT> NodeT &leaf() const {
803
819M
    return *reinterpret_cast<NodeT*>(path.back().node);
804
819M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::leaf<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
802
499
  template <typename NodeT> NodeT &leaf() const {
803
499
    return *reinterpret_cast<NodeT*>(path.back().node);
804
499
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::leaf<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
802
64.1k
  template <typename NodeT> NodeT &leaf() const {
803
64.1k
    return *reinterpret_cast<NodeT*>(path.back().node);
804
64.1k
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMapImpl::Path::leaf<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
802
4.36M
  template <typename NodeT> NodeT &leaf() const {
803
4.36M
    return *reinterpret_cast<NodeT*>(path.back().node);
804
4.36M
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >& llvm::IntervalMapImpl::Path::leaf<llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> > >() const
Line
Count
Source
802
444k
  template <typename NodeT> NodeT &leaf() const {
803
444k
    return *reinterpret_cast<NodeT*>(path.back().node);
804
444k
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >& llvm::IntervalMapImpl::Path::leaf<llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> > >() const
Line
Count
Source
802
247k
  template <typename NodeT> NodeT &leaf() const {
803
247k
    return *reinterpret_cast<NodeT*>(path.back().node);
804
247k
  }
805
78.8M
  unsigned leafSize() const { return path.back().size; }
806
794M
  unsigned leafOffset() const { return path.back().offset; }
807
137M
  unsigned &leafOffset() { return path.back().offset; }
808
809
  /// valid - Return true if path is at a valid node, not at end().
810
430M
  bool valid() const {
811
430M
    return !path.empty() && 
path.front().offset < path.front().size430M
;
812
430M
  }
813
814
  /// height - Return the height of the tree corresponding to this path.
815
  /// This matches map->height in a full path.
816
79.1M
  unsigned height() const { return path.size() - 1; }
817
818
  /// subtree - Get the subtree referenced from Level. When the path is
819
  /// consistent, node(Level + 1) == subtree(Level).
820
  /// @param Level 0..height-1. The leaves have no subtrees.
821
52.2M
  NodeRef &subtree(unsigned Level) const {
822
52.2M
    return path[Level].subtree(path[Level].offset);
823
52.2M
  }
824
825
  /// reset - Reset cached information about node(Level) from subtree(Level -1).
826
  /// @param Level 1..height. THe node to update after parent node changed.
827
448k
  void reset(unsigned Level) {
828
448k
    path[Level] = Entry(subtree(Level - 1), offset(Level));
829
448k
  }
830
831
  /// push - Add entry to path.
832
  /// @param Node Node to add, should be subtree(path.size()-1).
833
  /// @param Offset Offset into Node.
834
36.5M
  void push(NodeRef Node, unsigned Offset) {
835
36.5M
    path.push_back(Entry(Node, Offset));
836
36.5M
  }
837
838
  /// pop - Remove the last path entry.
839
3.07M
  void pop() {
840
3.07M
    path.pop_back();
841
3.07M
  }
842
843
  /// setSize - Set the size of a node both in the path and in the tree.
844
  /// @param Level 0..height. Note that setting the root size won't change
845
  ///              map->rootSize.
846
  /// @param Size New node size.
847
21.6M
  void setSize(unsigned Level, unsigned Size) {
848
21.6M
    path[Level].size = Size;
849
21.6M
    if (Level)
850
8.89M
      subtree(Level - 1).setSize(Size);
851
21.6M
  }
852
853
  /// setRoot - Clear the path and set a new root node.
854
  /// @param Node New root node.
855
  /// @param Size New root size.
856
  /// @param Offset Offset into root node.
857
161M
  void setRoot(void *Node, unsigned Size, unsigned Offset) {
858
161M
    path.clear();
859
161M
    path.push_back(Entry(Node, Size, Offset));
860
161M
  }
861
862
  /// replaceRoot - Replace the current root node with two new entries after the
863
  /// tree height has increased.
864
  /// @param Root The new root node.
865
  /// @param Size Number of entries in the new root.
866
  /// @param Offsets Offsets into the root and first branch nodes.
867
  void replaceRoot(void *Root, unsigned Size, IdxPair Offsets);
868
869
  /// getLeftSibling - Get the left sibling node at Level, or a null NodeRef.
870
  /// @param Level Get the sibling to node(Level).
871
  /// @return Left sibling, or NodeRef().
872
  NodeRef getLeftSibling(unsigned Level) const;
873
874
  /// moveLeft - Move path to the left sibling at Level. Leave nodes below Level
875
  /// unaltered.
876
  /// @param Level Move node(Level).
877
  void moveLeft(unsigned Level);
878
879
  /// fillLeft - Grow path to Height by taking leftmost branches.
880
  /// @param Height The target height.
881
13.0k
  void fillLeft(unsigned Height) {
882
26.1k
    while (height() < Height)
883
13.1k
      push(subtree(height()), 0);
884
13.0k
  }
885
886
  /// getLeftSibling - Get the left sibling node at Level, or a null NodeRef.
887
  /// @param Level Get the sinbling to node(Level).
888
  /// @return Left sibling, or NodeRef().
889
  NodeRef getRightSibling(unsigned Level) const;
890
891
  /// moveRight - Move path to the left sibling at Level. Leave nodes below
892
  /// Level unaltered.
893
  /// @param Level Move node(Level).
894
  void moveRight(unsigned Level);
895
896
  /// atBegin - Return true if path is at begin().
897
462k
  bool atBegin() const {
898
974k
    for (unsigned i = 0, e = path.size(); i != e; 
++i512k
)
899
767k
      if (path[i].offset != 0)
900
255k
        return false;
901
462k
    
return true207k
;
902
462k
  }
903
904
  /// atLastEntry - Return true if the path is at the last entry of the node at
905
  /// Level.
906
  /// @param Level Node to examine.
907
6.25M
  bool atLastEntry(unsigned Level) const {
908
6.25M
    return path[Level].offset == path[Level].size - 1;
909
6.25M
  }
910
911
  /// legalizeForInsert - Prepare the path for an insertion at Level. When the
912
  /// path is at end(), node(Level) may not be a legal node. legalizeForInsert
913
  /// ensures that node(Level) is real by moving back to the last node at Level,
914
  /// and setting offset(Level) to size(Level) if required.
915
  /// @param Level The level where an insertion is about to take place.
916
1.05M
  void legalizeForInsert(unsigned Level) {
917
1.05M
    if (valid())
918
101k
      return;
919
949k
    moveLeft(Level);
920
949k
    ++path[Level].offset;
921
949k
  }
922
};
923
924
} // end namespace IntervalMapImpl
925
926
//===----------------------------------------------------------------------===//
927
//---                          IntervalMap                                ----//
928
//===----------------------------------------------------------------------===//
929
930
template <typename KeyT, typename ValT,
931
          unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize,
932
          typename Traits = IntervalMapInfo<KeyT>>
933
class IntervalMap {
934
  using Sizer = IntervalMapImpl::NodeSizer<KeyT, ValT>;
935
  using Leaf = IntervalMapImpl::LeafNode<KeyT, ValT, Sizer::LeafSize, Traits>;
936
  using Branch =
937
      IntervalMapImpl::BranchNode<KeyT, ValT, Sizer::BranchSize, Traits>;
938
  using RootLeaf = IntervalMapImpl::LeafNode<KeyT, ValT, N, Traits>;
939
  using IdxPair = IntervalMapImpl::IdxPair;
940
941
  // The RootLeaf capacity is given as a template parameter. We must compute the
942
  // corresponding RootBranch capacity.
943
  enum {
944
    DesiredRootBranchCap = (sizeof(RootLeaf) - sizeof(KeyT)) /
945
      (sizeof(KeyT) + sizeof(IntervalMapImpl::NodeRef)),
946
    RootBranchCap = DesiredRootBranchCap ? DesiredRootBranchCap : 1
947
  };
948
949
  using RootBranch =
950
      IntervalMapImpl::BranchNode<KeyT, ValT, RootBranchCap, Traits>;
951
952
  // When branched, we store a global start key as well as the branch node.
953
  struct RootBranchData {
954
    KeyT start;
955
    RootBranch node;
956
  };
957
958
public:
959
  using Allocator = typename Sizer::Allocator;
960
  using KeyType = KeyT;
961
  using ValueType = ValT;
962
  using KeyTraits = Traits;
963
964
private:
965
  // The root data is either a RootLeaf or a RootBranchData instance.
966
  LLVM_ALIGNAS(RootLeaf) LLVM_ALIGNAS(RootBranchData)
967
  AlignedCharArrayUnion<RootLeaf, RootBranchData> data;
968
969
  // Tree height.
970
  // 0: Leaves in root.
971
  // 1: Root points to leaf.
972
  // 2: root->branch->leaf ...
973
  unsigned height;
974
975
  // Number of entries in the root node.
976
  unsigned rootSize;
977
978
  // Allocator used for creating external nodes.
979
  Allocator &allocator;
980
981
  /// Represent data as a node type without breaking aliasing rules.
982
  template <typename T>
983
388M
  T &dataAs() const {
984
388M
    return *bit_cast<T *>(const_cast<char *>(data.buffer));
985
388M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::dataAs<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
983
290M
  T &dataAs() const {
984
290M
    return *bit_cast<T *>(const_cast<char *>(data.buffer));
985
290M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::RootBranchData& llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::dataAs<llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::RootBranchData>() const
Line
Count
Source
983
72.8M
  T &dataAs() const {
984
72.8M
    return *bit_cast<T *>(const_cast<char *>(data.buffer));
985
72.8M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::dataAs<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
983
66.4k
  T &dataAs() const {
984
66.4k
    return *bit_cast<T *>(const_cast<char *>(data.buffer));
985
66.4k
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::RootBranchData& llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::dataAs<llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::RootBranchData>() const
Line
Count
Source
983
200
  T &dataAs() const {
984
200
    return *bit_cast<T *>(const_cast<char *>(data.buffer));
985
200
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::RootBranchData& llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::dataAs<llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::RootBranchData>() const
Line
Count
Source
983
2.39M
  T &dataAs() const {
984
2.39M
    return *bit_cast<T *>(const_cast<char *>(data.buffer));
985
2.39M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >& llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::dataAs<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >() const
Line
Count
Source
983
8.62M
  T &dataAs() const {
984
8.62M
    return *bit_cast<T *>(const_cast<char *>(data.buffer));
985
8.62M
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >& llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::dataAs<llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> > >() const
Line
Count
Source
983
14.0M
  T &dataAs() const {
984
14.0M
    return *bit_cast<T *>(const_cast<char *>(data.buffer));
985
14.0M
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::RootBranchData& llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::dataAs<llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::RootBranchData>() const
Line
Count
Source
983
8.40k
  T &dataAs() const {
984
8.40k
    return *bit_cast<T *>(const_cast<char *>(data.buffer));
985
8.40k
  }
986
987
3.49M
  const RootLeaf &rootLeaf() const {
988
3.49M
    assert(!branched() && "Cannot acces leaf data in branched root");
989
3.49M
    return dataAs<RootLeaf>();
990
3.49M
  }
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootLeaf() const
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootLeaf() const
Line
Count
Source
987
3.49M
  const RootLeaf &rootLeaf() const {
988
3.49M
    assert(!branched() && "Cannot acces leaf data in branched root");
989
3.49M
    return dataAs<RootLeaf>();
990
3.49M
  }
991
310M
  RootLeaf &rootLeaf() {
992
310M
    assert(!branched() && "Cannot acces leaf data in branched root");
993
310M
    return dataAs<RootLeaf>();
994
310M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootLeaf()
Line
Count
Source
991
290M
  RootLeaf &rootLeaf() {
992
290M
    assert(!branched() && "Cannot acces leaf data in branched root");
993
290M
    return dataAs<RootLeaf>();
994
290M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootLeaf()
Line
Count
Source
991
66.4k
  RootLeaf &rootLeaf() {
992
66.4k
    assert(!branched() && "Cannot acces leaf data in branched root");
993
66.4k
    return dataAs<RootLeaf>();
994
66.4k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootLeaf()
Line
Count
Source
991
5.13M
  RootLeaf &rootLeaf() {
992
5.13M
    assert(!branched() && "Cannot acces leaf data in branched root");
993
5.13M
    return dataAs<RootLeaf>();
994
5.13M
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::rootLeaf()
Line
Count
Source
991
14.0M
  RootLeaf &rootLeaf() {
992
14.0M
    assert(!branched() && "Cannot acces leaf data in branched root");
993
14.0M
    return dataAs<RootLeaf>();
994
14.0M
  }
995
996
918k
  RootBranchData &rootBranchData() const {
997
918k
    assert(branched() && "Cannot access branch data in non-branched root");
998
918k
    return dataAs<RootBranchData>();
999
918k
  }
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranchData() const
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranchData() const
Line
Count
Source
996
918k
  RootBranchData &rootBranchData() const {
997
918k
    assert(branched() && "Cannot access branch data in non-branched root");
998
918k
    return dataAs<RootBranchData>();
999
918k
  }
1000
74.3M
  RootBranchData &rootBranchData() {
1001
74.3M
    assert(branched() && "Cannot access branch data in non-branched root");
1002
74.3M
    return dataAs<RootBranchData>();
1003
74.3M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranchData()
Line
Count
Source
1000
72.8M
  RootBranchData &rootBranchData() {
1001
72.8M
    assert(branched() && "Cannot access branch data in non-branched root");
1002
72.8M
    return dataAs<RootBranchData>();
1003
72.8M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranchData()
Line
Count
Source
1000
200
  RootBranchData &rootBranchData() {
1001
200
    assert(branched() && "Cannot access branch data in non-branched root");
1002
200
    return dataAs<RootBranchData>();
1003
200
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranchData()
Line
Count
Source
1000
1.48M
  RootBranchData &rootBranchData() {
1001
1.48M
    assert(branched() && "Cannot access branch data in non-branched root");
1002
1.48M
    return dataAs<RootBranchData>();
1003
1.48M
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::rootBranchData()
Line
Count
Source
1000
8.40k
  RootBranchData &rootBranchData() {
1001
8.40k
    assert(branched() && "Cannot access branch data in non-branched root");
1002
8.40k
    return dataAs<RootBranchData>();
1003
8.40k
  }
1004
1005
609k
  const RootBranch &rootBranch() const { return rootBranchData().node; }
1006
73.1M
  RootBranch &rootBranch()             { return rootBranchData().node; }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranch()
Line
Count
Source
1006
71.6M
  RootBranch &rootBranch()             { return rootBranchData().node; }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranch()
Line
Count
Source
1006
185
  RootBranch &rootBranch()             { return rootBranchData().node; }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranch()
Line
Count
Source
1006
1.44M
  RootBranch &rootBranch()             { return rootBranchData().node; }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::rootBranch()
Line
Count
Source
1006
6.97k
  RootBranch &rootBranch()             { return rootBranchData().node; }
1007
308k
  KeyT rootBranchStart() const { return rootBranchData().start; }
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranchStart() const
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranchStart() const
Line
Count
Source
1007
308k
  KeyT rootBranchStart() const { return rootBranchData().start; }
1008
615k
  KeyT &rootBranchStart()      { return rootBranchData().start; }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranchStart()
Line
Count
Source
1008
5
  KeyT &rootBranchStart()      { return rootBranchData().start; }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranchStart()
Line
Count
Source
1008
601k
  KeyT &rootBranchStart()      { return rootBranchData().start; }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::rootBranchStart()
Line
Count
Source
1008
12.6k
  KeyT &rootBranchStart()      { return rootBranchData().start; }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::rootBranchStart()
Line
Count
Source
1008
1.25k
  KeyT &rootBranchStart()      { return rootBranchData().start; }
1009
1010
1.04M
  template <typename NodeT> NodeT *newNode() {
1011
1.04M
    return new(allocator.template Allocate<NodeT>()) NodeT();
1012
1.04M
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >* llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::newNode<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >()
Line
Count
Source
1010
5
  template <typename NodeT> NodeT *newNode() {
1011
5
    return new(allocator.template Allocate<NodeT>()) NodeT();
1012
5
  }
Unexecuted instantiation: llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >* llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::newNode<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >()
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >* llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::newNode<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> > >()
Line
Count
Source
1010
992k
  template <typename NodeT> NodeT *newNode() {
1011
992k
    return new(allocator.template Allocate<NodeT>()) NodeT();
1012
992k
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >* llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::newNode<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >()
Line
Count
Source
1010
18.4k
  template <typename NodeT> NodeT *newNode() {
1011
18.4k
    return new(allocator.template Allocate<NodeT>()) NodeT();
1012
18.4k
  }
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >* llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::newNode<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >()
Line
Count
Source
1010
33.2k
  template <typename NodeT> NodeT *newNode() {
1011
33.2k
    return new(allocator.template Allocate<NodeT>()) NodeT();
1012
33.2k
  }
llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >* llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::newNode<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >()
Line
Count
Source
1010
337
  template <typename NodeT> NodeT *newNode() {
1011
337
    return new(allocator.template Allocate<NodeT>()) NodeT();
1012
337
  }
DAGCombiner.cpp:llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >* llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::newNode<llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> > >()
Line
Count
Source
1010
170
  template <typename NodeT> NodeT *newNode() {
1011
170
    return new(allocator.template Allocate<NodeT>()) NodeT();
1012
170
  }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> >* llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::newNode<llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> > >()
1013
1014
1.04M
  template <typename NodeT> void deleteNode(NodeT *P) {
1015
1.04M
    P->~NodeT();
1016
1.04M
    allocator.Deallocate(P);
1017
1.04M
  }
void llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::deleteNode<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, llvm::LiveInterval*, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >*)
Line
Count
Source
1014
18.4k
  template <typename NodeT> void deleteNode(NodeT *P) {
1015
18.4k
    P->~NodeT();
1016
18.4k
    allocator.Deallocate(P);
1017
18.4k
  }
void llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::deleteNode<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >*)
Line
Count
Source
1014
992k
  template <typename NodeT> void deleteNode(NodeT *P) {
1015
992k
    P->~NodeT();
1016
992k
    allocator.Deallocate(P);
1017
992k
  }
Unexecuted instantiation: void llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::deleteNode<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, DbgValueLocation, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >*)
void llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::deleteNode<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, DbgValueLocation, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >*)
Line
Count
Source
1014
5
  template <typename NodeT> void deleteNode(NodeT *P) {
1015
5
    P->~NodeT();
1016
5
    allocator.Deallocate(P);
1017
5
  }
void llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::deleteNode<llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::BranchNode<llvm::SlotIndex, unsigned int, 12u, llvm::IntervalMapInfo<llvm::SlotIndex> >*)
Line
Count
Source
1014
337
  template <typename NodeT> void deleteNode(NodeT *P) {
1015
337
    P->~NodeT();
1016
337
    allocator.Deallocate(P);
1017
337
  }
void llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::deleteNode<llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > >(llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >*)
Line
Count
Source
1014
33.2k
  template <typename NodeT> void deleteNode(NodeT *P) {
1015
33.2k
    P->~NodeT();
1016
33.2k
    allocator.Deallocate(P);
1017
33.2k
  }
DAGCombiner.cpp:void llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::deleteNode<llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> > >(llvm::IntervalMapImpl::LeafNode<long long, (anonymous namespace)::UnitT, 11u, llvm::IntervalMapHalfOpenInfo<long long> >*)
Line
Count
Source
1014
170
  template <typename NodeT> void deleteNode(NodeT *P) {
1015
170
    P->~NodeT();
1016
170
    allocator.Deallocate(P);
1017
170
  }
Unexecuted instantiation: DAGCombiner.cpp:void llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::deleteNode<llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> > >(llvm::IntervalMapImpl::BranchNode<long long, (anonymous namespace)::UnitT, 12u, llvm::IntervalMapHalfOpenInfo<long long> >*)
1018
1019
  IdxPair branchRoot(unsigned Position);
1020
  IdxPair splitRoot(unsigned Position);
1021
1022
310k
  void switchRootToBranch() {
1023
310k
    rootLeaf().~RootLeaf();
1024
310k
    height = 1;
1025
310k
    new (&rootBranchData()) RootBranchData();
1026
310k
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::switchRootToBranch()
Line
Count
Source
1022
5
  void switchRootToBranch() {
1023
5
    rootLeaf().~RootLeaf();
1024
5
    height = 1;
1025
5
    new (&rootBranchData()) RootBranchData();
1026
5
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::switchRootToBranch()
Line
Count
Source
1022
298k
  void switchRootToBranch() {
1023
298k
    rootLeaf().~RootLeaf();
1024
298k
    height = 1;
1025
298k
    new (&rootBranchData()) RootBranchData();
1026
298k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::switchRootToBranch()
Line
Count
Source
1022
11.8k
  void switchRootToBranch() {
1023
11.8k
    rootLeaf().~RootLeaf();
1024
11.8k
    height = 1;
1025
11.8k
    new (&rootBranchData()) RootBranchData();
1026
11.8k
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::switchRootToBranch()
Line
Count
Source
1022
90
  void switchRootToBranch() {
1023
90
    rootLeaf().~RootLeaf();
1024
90
    height = 1;
1025
90
    new (&rootBranchData()) RootBranchData();
1026
90
  }
1027
1028
310k
  void switchRootToLeaf() {
1029
310k
    rootBranchData().~RootBranchData();
1030
310k
    height = 0;
1031
310k
    new(&rootLeaf()) RootLeaf();
1032
310k
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::switchRootToLeaf()
Line
Count
Source
1028
298k
  void switchRootToLeaf() {
1029
298k
    rootBranchData().~RootBranchData();
1030
298k
    height = 0;
1031
298k
    new(&rootLeaf()) RootLeaf();
1032
298k
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::switchRootToLeaf()
Line
Count
Source
1028
5
  void switchRootToLeaf() {
1029
5
    rootBranchData().~RootBranchData();
1030
5
    height = 0;
1031
5
    new(&rootLeaf()) RootLeaf();
1032
5
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::switchRootToLeaf()
Line
Count
Source
1028
11.8k
  void switchRootToLeaf() {
1029
11.8k
    rootBranchData().~RootBranchData();
1030
11.8k
    height = 0;
1031
11.8k
    new(&rootLeaf()) RootLeaf();
1032
11.8k
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::switchRootToLeaf()
Line
Count
Source
1028
90
  void switchRootToLeaf() {
1029
90
    rootBranchData().~RootBranchData();
1030
90
    height = 0;
1031
90
    new(&rootLeaf()) RootLeaf();
1032
90
  }
1033
1034
1.29G
  bool branched() const { return height > 0; }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::branched() const
Line
Count
Source
1034
1.27G
  bool branched() const { return height > 0; }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::branched() const
Line
Count
Source
1034
163k
  bool branched() const { return height > 0; }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::branched() const
Line
Count
Source
1034
14.0M
  bool branched() const { return height > 0; }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::branched() const
Line
Count
Source
1034
8.02M
  bool branched() const { return height > 0; }
1035
1036
  ValT treeSafeLookup(KeyT x, ValT NotFound) const;
1037
  void visitNodes(void (IntervalMap::*f)(IntervalMapImpl::NodeRef,
1038
                  unsigned Level));
1039
  void deleteNode(IntervalMapImpl::NodeRef Node, unsigned Level);
1040
1041
public:
1042
11.3M
  explicit IntervalMap(Allocator &a) : height(0), rootSize(0), allocator(a) {
1043
11.3M
    assert((uintptr_t(data.buffer) & (alignof(RootLeaf) - 1)) == 0 &&
1044
11.3M
           "Insufficient alignment");
1045
11.3M
    new(&rootLeaf()) RootLeaf();
1046
11.3M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::IntervalMap(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, char, 192ul, 64ul>&)
Line
Count
Source
1042
4.68k
  explicit IntervalMap(Allocator &a) : height(0), rootSize(0), allocator(a) {
1043
4.68k
    assert((uintptr_t(data.buffer) & (alignof(RootLeaf) - 1)) == 0 &&
1044
4.68k
           "Insufficient alignment");
1045
4.68k
    new(&rootLeaf()) RootLeaf();
1046
4.68k
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::IntervalMap(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, char, 192ul, 64ul>&)
Line
Count
Source
1042
7.72M
  explicit IntervalMap(Allocator &a) : height(0), rootSize(0), allocator(a) {
1043
7.72M
    assert((uintptr_t(data.buffer) & (alignof(RootLeaf) - 1)) == 0 &&
1044
7.72M
           "Insufficient alignment");
1045
7.72M
    new(&rootLeaf()) RootLeaf();
1046
7.72M
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::IntervalMap(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, char, 192ul, 64ul>&)
Line
Count
Source
1042
484k
  explicit IntervalMap(Allocator &a) : height(0), rootSize(0), allocator(a) {
1043
484k
    assert((uintptr_t(data.buffer) & (alignof(RootLeaf) - 1)) == 0 &&
1044
484k
           "Insufficient alignment");
1045
484k
    new(&rootLeaf()) RootLeaf();
1046
484k
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::IntervalMap(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, char, 192ul, 64ul>&)
Line
Count
Source
1042
3.15M
  explicit IntervalMap(Allocator &a) : height(0), rootSize(0), allocator(a) {
1043
3.15M
    assert((uintptr_t(data.buffer) & (alignof(RootLeaf) - 1)) == 0 &&
1044
3.15M
           "Insufficient alignment");
1045
3.15M
    new(&rootLeaf()) RootLeaf();
1046
3.15M
  }
1047
1048
11.3M
  ~IntervalMap() {
1049
11.3M
    clear();
1050
11.3M
    rootLeaf().~RootLeaf();
1051
11.3M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::~IntervalMap()
Line
Count
Source
1048
4.68k
  ~IntervalMap() {
1049
4.68k
    clear();
1050
4.68k
    rootLeaf().~RootLeaf();
1051
4.68k
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::~IntervalMap()
Line
Count
Source
1048
7.71M
  ~IntervalMap() {
1049
7.71M
    clear();
1050
7.71M
    rootLeaf().~RootLeaf();
1051
7.71M
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::~IntervalMap()
Line
Count
Source
1048
484k
  ~IntervalMap() {
1049
484k
    clear();
1050
484k
    rootLeaf().~RootLeaf();
1051
484k
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::~IntervalMap()
Line
Count
Source
1048
3.15M
  ~IntervalMap() {
1049
3.15M
    clear();
1050
3.15M
    rootLeaf().~RootLeaf();
1051
3.15M
  }
1052
1053
  /// empty -  Return true when no intervals are mapped.
1054
141M
  bool empty() const {
1055
141M
    return rootSize == 0;
1056
141M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::empty() const
Line
Count
Source
1054
140M
  bool empty() const {
1055
140M
    return rootSize == 0;
1056
140M
  }
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::empty() const
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::empty() const
Line
Count
Source
1054
1.60M
  bool empty() const {
1055
1.60M
    return rootSize == 0;
1056
1.60M
  }
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::empty() const
1057
1058
  /// start - Return the smallest mapped key in a non-empty map.
1059
1.59M
  KeyT start() const {
1060
1.59M
    assert(!empty() && "Empty IntervalMap has no start");
1061
1.59M
    return !branched() ? 
rootLeaf().start(0)1.29M
:
rootBranchStart()308k
;
1062
1.59M
  }
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::start() const
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::start() const
Line
Count
Source
1059
1.59M
  KeyT start() const {
1060
1.59M
    assert(!empty() && "Empty IntervalMap has no start");
1061
1.59M
    return !branched() ? 
rootLeaf().start(0)1.29M
:
rootBranchStart()308k
;
1062
1.59M
  }
1063
1064
  /// stop - Return the largest mapped key in a non-empty map.
1065
1.48M
  KeyT stop() const {
1066
1.48M
    assert(!empty() && "Empty IntervalMap has no stop");
1067
1.48M
    return !branched() ? 
rootLeaf().stop(rootSize - 1)1.17M
:
1068
1.48M
                         
rootBranch().stop(rootSize - 1)306k
;
1069
1.48M
  }
1070
1071
  /// lookup - Return the mapped value at x or NotFound.
1072
1.59M
  ValT lookup(KeyT x, ValT NotFound = ValT()) const {
1073
1.59M
    if (empty() || Traits::startLess(x, start()) || 
Traits::stopLess(stop(), x)1.48M
)
1074
266k
      return NotFound;
1075
1.33M
    return branched() ? 
treeSafeLookup(x, NotFound)303k
:
1076
1.33M
                        
rootLeaf().safeLookup(x, NotFound)1.02M
;
1077
1.33M
  }
1078
1079
  /// insert - Add a mapping of [a;b] to y, coalesce with adjacent intervals.
1080
  /// It is assumed that no key in the interval is mapped to another value, but
1081
  /// overlapping intervals already mapped to y will be coalesced.
1082
5.73M
  void insert(KeyT a, KeyT b, ValT y) {
1083
5.73M
    if (branched() || 
rootSize == RootLeaf::Capacity5.09M
)
1084
695k
      return find(a).insert(a, b, y);
1085
5.04M
1086
5.04M
    // Easy insert into root leaf.
1087
5.04M
    unsigned p = rootLeaf().findFrom(0, rootSize, a);
1088
5.04M
    rootSize = rootLeaf().insertFrom(p, rootSize, a, b, y);
1089
5.04M
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::insert(llvm::SlotIndex, llvm::SlotIndex, unsigned int)
Line
Count
Source
1082
2.35M
  void insert(KeyT a, KeyT b, ValT y) {
1083
2.35M
    if (branched() || 
rootSize == RootLeaf::Capacity1.71M
)
1084
693k
      return find(a).insert(a, b, y);
1085
1.66M
1086
1.66M
    // Easy insert into root leaf.
1087
1.66M
    unsigned p = rootLeaf().findFrom(0, rootSize, a);
1088
1.66M
    rootSize = rootLeaf().insertFrom(p, rootSize, a, b, y);
1089
1.66M
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::insert(long long, long long, (anonymous namespace)::UnitT)
Line
Count
Source
1082
3.38M
  void insert(KeyT a, KeyT b, ValT y) {
1083
3.38M
    if (branched() || 
rootSize == RootLeaf::Capacity3.37M
)
1084
1.28k
      return find(a).insert(a, b, y);
1085
3.37M
1086
3.37M
    // Easy insert into root leaf.
1087
3.37M
    unsigned p = rootLeaf().findFrom(0, rootSize, a);
1088
3.37M
    rootSize = rootLeaf().insertFrom(p, rootSize, a, b, y);
1089
3.37M
  }
1090
1091
  /// clear - Remove all entries.
1092
  void clear();
1093
1094
  class const_iterator;
1095
  class iterator;
1096
  friend class const_iterator;
1097
  friend class iterator;
1098
1099
0
  const_iterator begin() const {
1100
0
    const_iterator I(*this);
1101
0
    I.goToBegin();
1102
0
    return I;
1103
0
  }
1104
1105
439k
  iterator begin() {
1106
439k
    iterator I(*this);
1107
439k
    I.goToBegin();
1108
439k
    return I;
1109
439k
  }
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::begin()
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::begin()
Line
Count
Source
1105
18.7k
  iterator begin() {
1106
18.7k
    iterator I(*this);
1107
18.7k
    I.goToBegin();
1108
18.7k
    return I;
1109
18.7k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::begin()
Line
Count
Source
1105
177k
  iterator begin() {
1106
177k
    iterator I(*this);
1107
177k
    I.goToBegin();
1108
177k
    return I;
1109
177k
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::begin()
Line
Count
Source
1105
242k
  iterator begin() {
1106
242k
    iterator I(*this);
1107
242k
    I.goToBegin();
1108
242k
    return I;
1109
242k
  }
1110
1111
0
  const_iterator end() const {
1112
0
    const_iterator I(*this);
1113
0
    I.goToEnd();
1114
0
    return I;
1115
0
  }
1116
1117
244k
  iterator end() {
1118
244k
    iterator I(*this);
1119
244k
    I.goToEnd();
1120
244k
    return I;
1121
244k
  }
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::end()
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::end()
Line
Count
Source
1117
244k
  iterator end() {
1118
244k
    iterator I(*this);
1119
244k
    I.goToEnd();
1120
244k
    return I;
1121
244k
  }
1122
1123
  /// find - Return an iterator pointing to the first interval ending at or
1124
  /// after x, or end().
1125
0
  const_iterator find(KeyT x) const {
1126
0
    const_iterator I(*this);
1127
0
    I.find(x);
1128
0
    return I;
1129
0
  }
1130
1131
12.4M
  iterator find(KeyT x) {
1132
12.4M
    iterator I(*this);
1133
12.4M
    I.find(x);
1134
12.4M
    return I;
1135
12.4M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::find(llvm::SlotIndex)
Line
Count
Source
1131
11.5M
  iterator find(KeyT x) {
1132
11.5M
    iterator I(*this);
1133
11.5M
    I.find(x);
1134
11.5M
    return I;
1135
11.5M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::find(llvm::SlotIndex)
Line
Count
Source
1131
9.76k
  iterator find(KeyT x) {
1132
9.76k
    iterator I(*this);
1133
9.76k
    I.find(x);
1134
9.76k
    return I;
1135
9.76k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::find(llvm::SlotIndex)
Line
Count
Source
1131
693k
  iterator find(KeyT x) {
1132
693k
    iterator I(*this);
1133
693k
    I.find(x);
1134
693k
    return I;
1135
693k
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::find(long long)
Line
Count
Source
1131
245k
  iterator find(KeyT x) {
1132
245k
    iterator I(*this);
1133
245k
    I.find(x);
1134
245k
    return I;
1135
245k
  }
1136
1137
  /// overlaps(a, b) - Return true if the intervals in this map overlap with the
1138
  /// interval [a;b].
1139
  bool overlaps(KeyT a, KeyT b) {
1140
    assert(Traits::nonEmpty(a, b));
1141
    const_iterator I = find(a);
1142
    if (!I.valid())
1143
      return false;
1144
    // [a;b] and [x;y] overlap iff x<=b and a<=y. The find() call guarantees the
1145
    // second part (y = find(a).stop()), so it is sufficient to check the first
1146
    // one.
1147
    return !Traits::stopLess(b, I.start());
1148
  }
1149
};
1150
1151
/// treeSafeLookup - Return the mapped value at x or NotFound, assuming a
1152
/// branched root.
1153
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1154
ValT IntervalMap<KeyT, ValT, N, Traits>::
1155
303k
treeSafeLookup(KeyT x, ValT NotFound) const {
1156
303k
  assert(branched() && "treeLookup assumes a branched root");
1157
303k
1158
303k
  IntervalMapImpl::NodeRef NR = rootBranch().safeLookup(x);
1159
344k
  for (unsigned h = height-1; h; 
--h40.5k
)
1160
40.5k
    NR = NR.get<Branch>().safeLookup(x);
1161
303k
  return NR.get<Leaf>().safeLookup(x, NotFound);
1162
303k
}
1163
1164
// branchRoot - Switch from a leaf root to a branched root.
1165
// Return the new (root offset, node offset) corresponding to Position.
1166
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1167
IntervalMapImpl::IdxPair IntervalMap<KeyT, ValT, N, Traits>::
1168
310k
branchRoot(unsigned Position) {
1169
310k
  using namespace IntervalMapImpl;
1170
310k
  // How many external leaf nodes to hold RootLeaf+1?
1171
310k
  const unsigned Nodes = RootLeaf::Capacity / Leaf::Capacity + 1;
1172
310k
1173
310k
  // Compute element distribution among new nodes.
1174
310k
  unsigned size[Nodes];
1175
310k
  IdxPair NewOffset(0, Position);
1176
310k
1177
310k
  // Is is very common for the root node to be smaller than external nodes.
1178
310k
  if (Nodes == 1)
1179
95
    size[0] = rootSize;
1180
310k
  else
1181
310k
    NewOffset = distribute(Nodes, rootSize, Leaf::Capacity,  nullptr, size,
1182
310k
                           Position, true);
1183
310k
1184
310k
  // Allocate new nodes.
1185
310k
  unsigned pos = 0;
1186
310k
  NodeRef node[Nodes];
1187
931k
  for (unsigned n = 0; n != Nodes; 
++n620k
) {
1188
620k
    Leaf *L = newNode<Leaf>();
1189
620k
    L->copy(rootLeaf(), pos, 0, size[n]);
1190
620k
    node[n] = NodeRef(L, size[n]);
1191
620k
    pos += size[n];
1192
620k
  }
1193
310k
1194
310k
  // Destroy the old leaf node, construct branch node instead.
1195
310k
  switchRootToBranch();
1196
931k
  for (unsigned n = 0; n != Nodes; 
++n620k
) {
1197
620k
    rootBranch().stop(n) = node[n].template get<Leaf>().stop(size[n]-1);
1198
620k
    rootBranch().subtree(n) = node[n];
1199
620k
  }
1200
310k
  rootBranchStart() = node[0].template get<Leaf>().start(0);
1201
310k
  rootSize = Nodes;
1202
310k
  return NewOffset;
1203
310k
}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::branchRoot(unsigned int)
Line
Count
Source
1168
5
branchRoot(unsigned Position) {
1169
5
  using namespace IntervalMapImpl;
1170
5
  // How many external leaf nodes to hold RootLeaf+1?
1171
5
  const unsigned Nodes = RootLeaf::Capacity / Leaf::Capacity + 1;
1172
5
1173
5
  // Compute element distribution among new nodes.
1174
5
  unsigned size[Nodes];
1175
5
  IdxPair NewOffset(0, Position);
1176
5
1177
5
  // Is is very common for the root node to be smaller than external nodes.
1178
5
  if (Nodes == 1)
1179
5
    size[0] = rootSize;
1180
0
  else
1181
0
    NewOffset = distribute(Nodes, rootSize, Leaf::Capacity,  nullptr, size,
1182
0
                           Position, true);
1183
5
1184
5
  // Allocate new nodes.
1185
5
  unsigned pos = 0;
1186
5
  NodeRef node[Nodes];
1187
10
  for (unsigned n = 0; n != Nodes; 
++n5
) {
1188
5
    Leaf *L = newNode<Leaf>();
1189
5
    L->copy(rootLeaf(), pos, 0, size[n]);
1190
5
    node[n] = NodeRef(L, size[n]);
1191
5
    pos += size[n];
1192
5
  }
1193
5
1194
5
  // Destroy the old leaf node, construct branch node instead.
1195
5
  switchRootToBranch();
1196
10
  for (unsigned n = 0; n != Nodes; 
++n5
) {
1197
5
    rootBranch().stop(n) = node[n].template get<Leaf>().stop(size[n]-1);
1198
5
    rootBranch().subtree(n) = node[n];
1199
5
  }
1200
5
  rootBranchStart() = node[0].template get<Leaf>().start(0);
1201
5
  rootSize = Nodes;
1202
5
  return NewOffset;
1203
5
}
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::branchRoot(unsigned int)
Line
Count
Source
1168
298k
branchRoot(unsigned Position) {
1169
298k
  using namespace IntervalMapImpl;
1170
298k
  // How many external leaf nodes to hold RootLeaf+1?
1171
298k
  const unsigned Nodes = RootLeaf::Capacity / Leaf::Capacity + 1;
1172
298k
1173
298k
  // Compute element distribution among new nodes.
1174
298k
  unsigned size[Nodes];
1175
298k
  IdxPair NewOffset(0, Position);
1176
298k
1177
298k
  // Is is very common for the root node to be smaller than external nodes.
1178
298k
  if (Nodes == 1)
1179
0
    size[0] = rootSize;
1180
298k
  else
1181
298k
    NewOffset = distribute(Nodes, rootSize, Leaf::Capacity,  nullptr, size,
1182
298k
                           Position, true);
1183
298k
1184
298k
  // Allocate new nodes.
1185
298k
  unsigned pos = 0;
1186
298k
  NodeRef node[Nodes];
1187
895k
  for (unsigned n = 0; n != Nodes; 
++n596k
) {
1188
596k
    Leaf *L = newNode<Leaf>();
1189
596k
    L->copy(rootLeaf(), pos, 0, size[n]);
1190
596k
    node[n] = NodeRef(L, size[n]);
1191
596k
    pos += size[n];
1192
596k
  }
1193
298k
1194
298k
  // Destroy the old leaf node, construct branch node instead.
1195
298k
  switchRootToBranch();
1196
895k
  for (unsigned n = 0; n != Nodes; 
++n596k
) {
1197
596k
    rootBranch().stop(n) = node[n].template get<Leaf>().stop(size[n]-1);
1198
596k
    rootBranch().subtree(n) = node[n];
1199
596k
  }
1200
298k
  rootBranchStart() = node[0].template get<Leaf>().start(0);
1201
298k
  rootSize = Nodes;
1202
298k
  return NewOffset;
1203
298k
}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::branchRoot(unsigned int)
Line
Count
Source
1168
11.8k
branchRoot(unsigned Position) {
1169
11.8k
  using namespace IntervalMapImpl;
1170
11.8k
  // How many external leaf nodes to hold RootLeaf+1?
1171
11.8k
  const unsigned Nodes = RootLeaf::Capacity / Leaf::Capacity + 1;
1172
11.8k
1173
11.8k
  // Compute element distribution among new nodes.
1174
11.8k
  unsigned size[Nodes];
1175
11.8k
  IdxPair NewOffset(0, Position);
1176
11.8k
1177
11.8k
  // Is is very common for the root node to be smaller than external nodes.
1178
11.8k
  if (Nodes == 1)
1179
0
    size[0] = rootSize;
1180
11.8k
  else
1181
11.8k
    NewOffset = distribute(Nodes, rootSize, Leaf::Capacity,  nullptr, size,
1182
11.8k
                           Position, true);
1183
11.8k
1184
11.8k
  // Allocate new nodes.
1185
11.8k
  unsigned pos = 0;
1186
11.8k
  NodeRef node[Nodes];
1187
35.6k
  for (unsigned n = 0; n != Nodes; 
++n23.7k
) {
1188
23.7k
    Leaf *L = newNode<Leaf>();
1189
23.7k
    L->copy(rootLeaf(), pos, 0, size[n]);
1190
23.7k
    node[n] = NodeRef(L, size[n]);
1191
23.7k
    pos += size[n];
1192
23.7k
  }
1193
11.8k
1194
11.8k
  // Destroy the old leaf node, construct branch node instead.
1195
11.8k
  switchRootToBranch();
1196
35.6k
  for (unsigned n = 0; n != Nodes; 
++n23.7k
) {
1197
23.7k
    rootBranch().stop(n) = node[n].template get<Leaf>().stop(size[n]-1);
1198
23.7k
    rootBranch().subtree(n) = node[n];
1199
23.7k
  }
1200
11.8k
  rootBranchStart() = node[0].template get<Leaf>().start(0);
1201
11.8k
  rootSize = Nodes;
1202
11.8k
  return NewOffset;
1203
11.8k
}
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::branchRoot(unsigned int)
Line
Count
Source
1168
90
branchRoot(unsigned Position) {
1169
90
  using namespace IntervalMapImpl;
1170
90
  // How many external leaf nodes to hold RootLeaf+1?
1171
90
  const unsigned Nodes = RootLeaf::Capacity / Leaf::Capacity + 1;
1172
90
1173
90
  // Compute element distribution among new nodes.
1174
90
  unsigned size[Nodes];
1175
90
  IdxPair NewOffset(0, Position);
1176
90
1177
90
  // Is is very common for the root node to be smaller than external nodes.
1178
90
  if (Nodes == 1)
1179
90
    size[0] = rootSize;
1180
0
  else
1181
0
    NewOffset = distribute(Nodes, rootSize, Leaf::Capacity,  nullptr, size,
1182
0
                           Position, true);
1183
90
1184
90
  // Allocate new nodes.
1185
90
  unsigned pos = 0;
1186
90
  NodeRef node[Nodes];
1187
180
  for (unsigned n = 0; n != Nodes; 
++n90
) {
1188
90
    Leaf *L = newNode<Leaf>();
1189
90
    L->copy(rootLeaf(), pos, 0, size[n]);
1190
90
    node[n] = NodeRef(L, size[n]);
1191
90
    pos += size[n];
1192
90
  }
1193
90
1194
90
  // Destroy the old leaf node, construct branch node instead.
1195
90
  switchRootToBranch();
1196
180
  for (unsigned n = 0; n != Nodes; 
++n90
) {
1197
90
    rootBranch().stop(n) = node[n].template get<Leaf>().stop(size[n]-1);
1198
90
    rootBranch().subtree(n) = node[n];
1199
90
  }
1200
90
  rootBranchStart() = node[0].template get<Leaf>().start(0);
1201
90
  rootSize = Nodes;
1202
90
  return NewOffset;
1203
90
}
1204
1205
// splitRoot - Split the current BranchRoot into multiple Branch nodes.
1206
// Return the new (root offset, node offset) corresponding to Position.
1207
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1208
IntervalMapImpl::IdxPair IntervalMap<KeyT, ValT, N, Traits>::
1209
7.20k
splitRoot(unsigned Position) {
1210
7.20k
  using namespace IntervalMapImpl;
1211
7.20k
  // How many external leaf nodes to hold RootBranch+1?
1212
7.20k
  const unsigned Nodes = RootBranch::Capacity / Branch::Capacity + 1;
1213
7.20k
1214
7.20k
  // Compute element distribution among new nodes.
1215
7.20k
  unsigned Size[Nodes];
1216
7.20k
  IdxPair NewOffset(0, Position);
1217
7.20k
1218
7.20k
  // Is is very common for the root node to be smaller than external nodes.
1219
7.20k
  if (Nodes == 1)
1220
7.20k
    Size[0] = rootSize;
1221
0
  else
1222
0
    NewOffset = distribute(Nodes, rootSize, Leaf::Capacity,  nullptr, Size,
1223
0
                           Position, true);
1224
7.20k
1225
7.20k
  // Allocate new nodes.
1226
7.20k
  unsigned Pos = 0;
1227
7.20k
  NodeRef Node[Nodes];
1228
14.4k
  for (unsigned n = 0; n != Nodes; 
++n7.20k
) {
1229
7.20k
    Branch *B = newNode<Branch>();
1230
7.20k
    B->copy(rootBranch(), Pos, 0, Size[n]);
1231
7.20k
    Node[n] = NodeRef(B, Size[n]);
1232
7.20k
    Pos += Size[n];
1233
7.20k
  }
1234
7.20k
1235
14.4k
  for (unsigned n = 0; n != Nodes; 
++n7.20k
) {
1236
7.20k
    rootBranch().stop(n) = Node[n].template get<Branch>().stop(Size[n]-1);
1237
7.20k
    rootBranch().subtree(n) = Node[n];
1238
7.20k
  }
1239
7.20k
  rootSize = Nodes;
1240
7.20k
  ++height;
1241
7.20k
  return NewOffset;
1242
7.20k
}
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::splitRoot(unsigned int)
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::splitRoot(unsigned int)
Line
Count
Source
1209
7.08k
splitRoot(unsigned Position) {
1210
7.08k
  using namespace IntervalMapImpl;
1211
7.08k
  // How many external leaf nodes to hold RootBranch+1?
1212
7.08k
  const unsigned Nodes = RootBranch::Capacity / Branch::Capacity + 1;
1213
7.08k
1214
7.08k
  // Compute element distribution among new nodes.
1215
7.08k
  unsigned Size[Nodes];
1216
7.08k
  IdxPair NewOffset(0, Position);
1217
7.08k
1218
7.08k
  // Is is very common for the root node to be smaller than external nodes.
1219
7.08k
  if (Nodes == 1)
1220
7.08k
    Size[0] = rootSize;
1221
0
  else
1222
0
    NewOffset = distribute(Nodes, rootSize, Leaf::Capacity,  nullptr, Size,
1223
0
                           Position, true);
1224
7.08k
1225
7.08k
  // Allocate new nodes.
1226
7.08k
  unsigned Pos = 0;
1227
7.08k
  NodeRef Node[Nodes];
1228
14.1k
  for (unsigned n = 0; n != Nodes; 
++n7.08k
) {
1229
7.08k
    Branch *B = newNode<Branch>();
1230
7.08k
    B->copy(rootBranch(), Pos, 0, Size[n]);
1231
7.08k
    Node[n] = NodeRef(B, Size[n]);
1232
7.08k
    Pos += Size[n];
1233
7.08k
  }
1234
7.08k
1235
14.1k
  for (unsigned n = 0; n != Nodes; 
++n7.08k
) {
1236
7.08k
    rootBranch().stop(n) = Node[n].template get<Branch>().stop(Size[n]-1);
1237
7.08k
    rootBranch().subtree(n) = Node[n];
1238
7.08k
  }
1239
7.08k
  rootSize = Nodes;
1240
7.08k
  ++height;
1241
7.08k
  return NewOffset;
1242
7.08k
}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::splitRoot(unsigned int)
Line
Count
Source
1209
124
splitRoot(unsigned Position) {
1210
124
  using namespace IntervalMapImpl;
1211
124
  // How many external leaf nodes to hold RootBranch+1?
1212
124
  const unsigned Nodes = RootBranch::Capacity / Branch::Capacity + 1;
1213
124
1214
124
  // Compute element distribution among new nodes.
1215
124
  unsigned Size[Nodes];
1216
124
  IdxPair NewOffset(0, Position);
1217
124
1218
124
  // Is is very common for the root node to be smaller than external nodes.
1219
124
  if (Nodes == 1)
1220
124
    Size[0] = rootSize;
1221
0
  else
1222
0
    NewOffset = distribute(Nodes, rootSize, Leaf::Capacity,  nullptr, Size,
1223
0
                           Position, true);
1224
124
1225
124
  // Allocate new nodes.
1226
124
  unsigned Pos = 0;
1227
124
  NodeRef Node[Nodes];
1228
248
  for (unsigned n = 0; n != Nodes; 
++n124
) {
1229
124
    Branch *B = newNode<Branch>();
1230
124
    B->copy(rootBranch(), Pos, 0, Size[n]);
1231
124
    Node[n] = NodeRef(B, Size[n]);
1232
124
    Pos += Size[n];
1233
124
  }
1234
124
1235
248
  for (unsigned n = 0; n != Nodes; 
++n124
) {
1236
124
    rootBranch().stop(n) = Node[n].template get<Branch>().stop(Size[n]-1);
1237
124
    rootBranch().subtree(n) = Node[n];
1238
124
  }
1239
124
  rootSize = Nodes;
1240
124
  ++height;
1241
124
  return NewOffset;
1242
124
}
Unexecuted instantiation: DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::splitRoot(unsigned int)
1243
1244
/// visitNodes - Visit each external node.
1245
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1246
void IntervalMap<KeyT, ValT, N, Traits>::
1247
300k
visitNodes(void (IntervalMap::*f)(IntervalMapImpl::NodeRef, unsigned Height)) {
1248
300k
  if (!branched())
1249
0
    return;
1250
300k
  SmallVector<IntervalMapImpl::NodeRef, 4> Refs, NextRefs;
1251
300k
1252
300k
  // Collect level 0 nodes from the root.
1253
1.12M
  for (unsigned i = 0; i != rootSize; 
++i827k
)
1254
827k
    Refs.push_back(rootBranch().subtree(i));
1255
300k
1256
300k
  // Visit all branch nodes.
1257
307k
  for (unsigned h = height - 1; h; 
--h7.08k
) {
1258
25.2k
    for (unsigned i = 0, e = Refs.size(); i != e; 
++i18.2k
) {
1259
189k
      for (unsigned j = 0, s = Refs[i].size(); j != s; 
++j171k
)
1260
171k
        NextRefs.push_back(Refs[i].subtree(j));
1261
18.2k
      (this->*f)(Refs[i], h);
1262
18.2k
    }
1263
7.08k
    Refs.clear();
1264
7.08k
    Refs.swap(NextRefs);
1265
7.08k
  }
1266
300k
1267
300k
  // Visit all leaf nodes.
1268
1.28M
  for (unsigned i = 0, e = Refs.size(); i != e; 
++i981k
)
1269
981k
    (this->*f)(Refs[i], 0);
1270
300k
}
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::visitNodes(void (llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::*)(llvm::IntervalMapImpl::NodeRef, unsigned int))
Line
Count
Source
1247
288k
visitNodes(void (IntervalMap::*f)(IntervalMapImpl::NodeRef, unsigned Height)) {
1248
288k
  if (!branched())
1249
0
    return;
1250
288k
  SmallVector<IntervalMapImpl::NodeRef, 4> Refs, NextRefs;
1251
288k
1252
288k
  // Collect level 0 nodes from the root.
1253
1.08M
  for (unsigned i = 0; i != rootSize; 
++i798k
)
1254
798k
    Refs.push_back(rootBranch().subtree(i));
1255
288k
1256
288k
  // Visit all branch nodes.
1257
294k
  for (unsigned h = height - 1; h; 
--h6.95k
) {
1258
24.8k
    for (unsigned i = 0, e = Refs.size(); i != e; 
++i17.8k
) {
1259
186k
      for (unsigned j = 0, s = Refs[i].size(); j != s; 
++j168k
)
1260
168k
        NextRefs.push_back(Refs[i].subtree(j));
1261
17.8k
      (this->*f)(Refs[i], h);
1262
17.8k
    }
1263
6.95k
    Refs.clear();
1264
6.95k
    Refs.swap(NextRefs);
1265
6.95k
  }
1266
288k
1267
288k
  // Visit all leaf nodes.
1268
1.23M
  for (unsigned i = 0, e = Refs.size(); i != e; 
++i948k
)
1269
948k
    (this->*f)(Refs[i], 0);
1270
288k
}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::visitNodes(void (llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::*)(llvm::IntervalMapImpl::NodeRef, unsigned int))
Line
Count
Source
1247
5
visitNodes(void (IntervalMap::*f)(IntervalMapImpl::NodeRef, unsigned Height)) {
1248
5
  if (!branched())
1249
0
    return;
1250
5
  SmallVector<IntervalMapImpl::NodeRef, 4> Refs, NextRefs;
1251
5
1252
5
  // Collect level 0 nodes from the root.
1253
10
  for (unsigned i = 0; i != rootSize; 
++i5
)
1254
5
    Refs.push_back(rootBranch().subtree(i));
1255
5
1256
5
  // Visit all branch nodes.
1257
5
  for (unsigned h = height - 1; h; 
--h0
) {
1258
0
    for (unsigned i = 0, e = Refs.size(); i != e; ++i) {
1259
0
      for (unsigned j = 0, s = Refs[i].size(); j != s; ++j)
1260
0
        NextRefs.push_back(Refs[i].subtree(j));
1261
0
      (this->*f)(Refs[i], h);
1262
0
    }
1263
0
    Refs.clear();
1264
0
    Refs.swap(NextRefs);
1265
0
  }
1266
5
1267
5
  // Visit all leaf nodes.
1268
10
  for (unsigned i = 0, e = Refs.size(); i != e; 
++i5
)
1269
5
    (this->*f)(Refs[i], 0);
1270
5
}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::visitNodes(void (llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::*)(llvm::IntervalMapImpl::NodeRef, unsigned int))
Line
Count
Source
1247
11.8k
visitNodes(void (IntervalMap::*f)(IntervalMapImpl::NodeRef, unsigned Height)) {
1248
11.8k
  if (!branched())
1249
0
    return;
1250
11.8k
  SmallVector<IntervalMapImpl::NodeRef, 4> Refs, NextRefs;
1251
11.8k
1252
11.8k
  // Collect level 0 nodes from the root.
1253
41.2k
  for (unsigned i = 0; i != rootSize; 
++i29.4k
)
1254
29.4k
    Refs.push_back(rootBranch().subtree(i));
1255
11.8k
1256
11.8k
  // Visit all branch nodes.
1257
12.0k
  for (unsigned h = height - 1; h; 
--h124
) {
1258
461
    for (unsigned i = 0, e = Refs.size(); i != e; 
++i337
) {
1259
3.36k
      for (unsigned j = 0, s = Refs[i].size(); j != s; 
++j3.03k
)
1260
3.03k
        NextRefs.push_back(Refs[i].subtree(j));
1261
337
      (this->*f)(Refs[i], h);
1262
337
    }
1263
124
    Refs.clear();
1264
124
    Refs.swap(NextRefs);
1265
124
  }
1266
11.8k
1267
11.8k
  // Visit all leaf nodes.
1268
43.9k
  for (unsigned i = 0, e = Refs.size(); i != e; 
++i32.1k
)
1269
32.1k
    (this->*f)(Refs[i], 0);
1270
11.8k
}
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::visitNodes(void (llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::*)(llvm::IntervalMapImpl::NodeRef, unsigned int))
Line
Count
Source
1247
90
visitNodes(void (IntervalMap::*f)(IntervalMapImpl::NodeRef, unsigned Height)) {
1248
90
  if (!branched())
1249
0
    return;
1250
90
  SmallVector<IntervalMapImpl::NodeRef, 4> Refs, NextRefs;
1251
90
1252
90
  // Collect level 0 nodes from the root.
1253
260
  for (unsigned i = 0; i != rootSize; 
++i170
)
1254
170
    Refs.push_back(rootBranch().subtree(i));
1255
90
1256
90
  // Visit all branch nodes.
1257
90
  for (unsigned h = height - 1; h; 
--h0
) {
1258
0
    for (unsigned i = 0, e = Refs.size(); i != e; ++i) {
1259
0
      for (unsigned j = 0, s = Refs[i].size(); j != s; ++j)
1260
0
        NextRefs.push_back(Refs[i].subtree(j));
1261
0
      (this->*f)(Refs[i], h);
1262
0
    }
1263
0
    Refs.clear();
1264
0
    Refs.swap(NextRefs);
1265
0
  }
1266
90
1267
90
  // Visit all leaf nodes.
1268
260
  for (unsigned i = 0, e = Refs.size(); i != e; 
++i170
)
1269
170
    (this->*f)(Refs[i], 0);
1270
90
}
1271
1272
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1273
void IntervalMap<KeyT, ValT, N, Traits>::
1274
999k
deleteNode(IntervalMapImpl::NodeRef Node, unsigned Level) {
1275
999k
  if (Level)
1276
18.2k
    deleteNode(&Node.get<Branch>());
1277
981k
  else
1278
981k
    deleteNode(&Node.get<Leaf>());
1279
999k
}
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::deleteNode(llvm::IntervalMapImpl::NodeRef, unsigned int)
Line
Count
Source
1274
966k
deleteNode(IntervalMapImpl::NodeRef Node, unsigned Level) {
1275
966k
  if (Level)
1276
17.8k
    deleteNode(&Node.get<Branch>());
1277
948k
  else
1278
948k
    deleteNode(&Node.get<Leaf>());
1279
966k
}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::deleteNode(llvm::IntervalMapImpl::NodeRef, unsigned int)
Line
Count
Source
1274
5
deleteNode(IntervalMapImpl::NodeRef Node, unsigned Level) {
1275
5
  if (Level)
1276
0
    deleteNode(&Node.get<Branch>());
1277
5
  else
1278
5
    deleteNode(&Node.get<Leaf>());
1279
5
}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::deleteNode(llvm::IntervalMapImpl::NodeRef, unsigned int)
Line
Count
Source
1274
32.4k
deleteNode(IntervalMapImpl::NodeRef Node, unsigned Level) {
1275
32.4k
  if (Level)
1276
337
    deleteNode(&Node.get<Branch>());
1277
32.1k
  else
1278
32.1k
    deleteNode(&Node.get<Leaf>());
1279
32.4k
}
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::deleteNode(llvm::IntervalMapImpl::NodeRef, unsigned int)
Line
Count
Source
1274
170
deleteNode(IntervalMapImpl::NodeRef Node, unsigned Level) {
1275
170
  if (Level)
1276
0
    deleteNode(&Node.get<Branch>());
1277
170
  else
1278
170
    deleteNode(&Node.get<Leaf>());
1279
170
}
1280
1281
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1282
void IntervalMap<KeyT, ValT, N, Traits>::
1283
111M
clear() {
1284
111M
  if (branched()) {
1285
300k
    visitNodes(&IntervalMap::deleteNode);
1286
300k
    switchRootToLeaf();
1287
300k
  }
1288
111M
  rootSize = 0;
1289
111M
}
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::clear()
Line
Count
Source
1283
107M
clear() {
1284
107M
  if (branched()) {
1285
288k
    visitNodes(&IntervalMap::deleteNode);
1286
288k
    switchRootToLeaf();
1287
288k
  }
1288
107M
  rootSize = 0;
1289
107M
}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::clear()
Line
Count
Source
1283
4.68k
clear() {
1284
4.68k
  if (branched()) {
1285
5
    visitNodes(&IntervalMap::deleteNode);
1286
5
    switchRootToLeaf();
1287
5
  }
1288
4.68k
  rootSize = 0;
1289
4.68k
}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::clear()
Line
Count
Source
1283
776k
clear() {
1284
776k
  if (branched()) {
1285
11.8k
    visitNodes(&IntervalMap::deleteNode);
1286
11.8k
    switchRootToLeaf();
1287
11.8k
  }
1288
776k
  rootSize = 0;
1289
776k
}
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::clear()
Line
Count
Source
1283
3.15M
clear() {
1284
3.15M
  if (branched()) {
1285
90
    visitNodes(&IntervalMap::deleteNode);
1286
90
    switchRootToLeaf();
1287
90
  }
1288
3.15M
  rootSize = 0;
1289
3.15M
}
1290
1291
//===----------------------------------------------------------------------===//
1292
//---                   IntervalMap::const_iterator                       ----//
1293
//===----------------------------------------------------------------------===//
1294
1295
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1296
class IntervalMap<KeyT, ValT, N, Traits>::const_iterator :
1297
  public std::iterator<std::bidirectional_iterator_tag, ValT> {
1298
1299
protected:
1300
  friend class IntervalMap;
1301
1302
  // The map referred to.
1303
  IntervalMap *map = nullptr;
1304
1305
  // We store a full path from the root to the current position.
1306
  // The path may be partially filled, but never between iterator calls.
1307
  IntervalMapImpl::Path path;
1308
1309
  explicit const_iterator(const IntervalMap &map) :
1310
13.1M
    map(const_cast<IntervalMap*>(&map)) {}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::const_iterator(llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> > const&)
Line
Count
Source
1310
28.4k
    map(const_cast<IntervalMap*>(&map)) {}
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::const_iterator(llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> > const&)
Line
Count
Source
1310
11.5M
    map(const_cast<IntervalMap*>(&map)) {}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::const_iterator(llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > const&)
Line
Count
Source
1310
871k
    map(const_cast<IntervalMap*>(&map)) {}
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::const_iterator(llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> > const&)
Line
Count
Source
1310
732k
    map(const_cast<IntervalMap*>(&map)) {}
1311
1312
1.17G
  bool branched() const {
1313
1.17G
    assert(map && "Invalid iterator");
1314
1.17G
    return map->branched();
1315
1.17G
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::branched() const
Line
Count
Source
1312
1.16G
  bool branched() const {
1313
1.16G
    assert(map && "Invalid iterator");
1314
1.16G
    return map->branched();
1315
1.16G
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::branched() const
Line
Count
Source
1312
159k
  bool branched() const {
1313
159k
    assert(map && "Invalid iterator");
1314
159k
    return map->branched();
1315
159k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::branched() const
Line
Count
Source
1312
6.49M
  bool branched() const {
1313
6.49M
    assert(map && "Invalid iterator");
1314
6.49M
    return map->branched();
1315
6.49M
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::branched() const
Line
Count
Source
1312
1.48M
  bool branched() const {
1313
1.48M
    assert(map && "Invalid iterator");
1314
1.48M
    return map->branched();
1315
1.48M
  }
1316
1317
161M
  void setRoot(unsigned Offset) {
1318
161M
    if (branched())
1319
34.8M
      path.setRoot(&map->rootBranch(), map->rootSize, Offset);
1320
127M
    else
1321
127M
      path.setRoot(&map->rootLeaf(), map->rootSize, Offset);
1322
161M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::setRoot(unsigned int)
Line
Count
Source
1317
160M
  void setRoot(unsigned Offset) {
1318
160M
    if (branched())
1319
34.1M
      path.setRoot(&map->rootBranch(), map->rootSize, Offset);
1320
126M
    else
1321
126M
      path.setRoot(&map->rootLeaf(), map->rootSize, Offset);
1322
160M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::setRoot(unsigned int)
Line
Count
Source
1317
28.5k
  void setRoot(unsigned Offset) {
1318
28.5k
    if (branched())
1319
92
      path.setRoot(&map->rootBranch(), map->rootSize, Offset);
1320
28.4k
    else
1321
28.4k
      path.setRoot(&map->rootLeaf(), map->rootSize, Offset);
1322
28.5k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::setRoot(unsigned int)
Line
Count
Source
1317
920k
  void setRoot(unsigned Offset) {
1318
920k
    if (branched())
1319
678k
      path.setRoot(&map->rootBranch(), map->rootSize, Offset);
1320
242k
    else
1321
242k
      path.setRoot(&map->rootLeaf(), map->rootSize, Offset);
1322
920k
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::setRoot(unsigned int)
Line
Count
Source
1317
732k
  void setRoot(unsigned Offset) {
1318
732k
    if (branched())
1319
4.30k
      path.setRoot(&map->rootBranch(), map->rootSize, Offset);
1320
728k
    else
1321
728k
      path.setRoot(&map->rootLeaf(), map->rootSize, Offset);
1322
732k
  }
1323
1324
  void pathFillFind(KeyT x);
1325
  void treeFind(KeyT x);
1326
  void treeAdvanceTo(KeyT x);
1327
1328
  /// unsafeStart - Writable access to start() for iterator.
1329
344M
  KeyT &unsafeStart() const {
1330
344M
    assert(valid() && "Cannot access invalid iterator");
1331
344M
    return branched() ? 
path.leaf<Leaf>().start(path.leafOffset())121M
:
1332
344M
                        
path.leaf<RootLeaf>().start(path.leafOffset())223M
;
1333
344M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::unsafeStart() const
Line
Count
Source
1329
342M
  KeyT &unsafeStart() const {
1330
342M
    assert(valid() && "Cannot access invalid iterator");
1331
342M
    return branched() ? 
path.leaf<Leaf>().start(path.leafOffset())120M
:
1332
342M
                        
path.leaf<RootLeaf>().start(path.leafOffset())222M
;
1333
342M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::unsafeStart() const
Line
Count
Source
1329
24.8k
  KeyT &unsafeStart() const {
1330
24.8k
    assert(valid() && "Cannot access invalid iterator");
1331
24.8k
    return branched() ? 
path.leaf<Leaf>().start(path.leafOffset())176
:
1332
24.8k
                        
path.leaf<RootLeaf>().start(path.leafOffset())24.6k
;
1333
24.8k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::unsafeStart() const
Line
Count
Source
1329
1.55M
  KeyT &unsafeStart() const {
1330
1.55M
    assert(valid() && "Cannot access invalid iterator");
1331
1.55M
    return branched() ? 
path.leaf<Leaf>().start(path.leafOffset())469k
:
1332
1.55M
                        
path.leaf<RootLeaf>().start(path.leafOffset())1.08M
;
1333
1.55M
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::unsafeStart() const
Line
Count
Source
1329
225k
  KeyT &unsafeStart() const {
1330
225k
    assert(valid() && "Cannot access invalid iterator");
1331
225k
    return branched() ? 
path.leaf<Leaf>().start(path.leafOffset())1.07k
:
1332
225k
                        
path.leaf<RootLeaf>().start(path.leafOffset())224k
;
1333
225k
  }
1334
1335
  /// unsafeStop - Writable access to stop() for iterator.
1336
272M
  KeyT &unsafeStop() const {
1337
272M
    assert(valid() && "Cannot access invalid iterator");
1338
272M
    return branched() ? 
path.leaf<Leaf>().stop(path.leafOffset())73.2M
:
1339
272M
                        
path.leaf<RootLeaf>().stop(path.leafOffset())198M
;
1340
272M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::unsafeStop() const
Line
Count
Source
1336
271M
  KeyT &unsafeStop() const {
1337
271M
    assert(valid() && "Cannot access invalid iterator");
1338
271M
    return branched() ? 
path.leaf<Leaf>().stop(path.leafOffset())72.9M
:
1339
271M
                        
path.leaf<RootLeaf>().stop(path.leafOffset())198M
;
1340
271M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::unsafeStop() const
Line
Count
Source
1336
9.90k
  KeyT &unsafeStop() const {
1337
9.90k
    assert(valid() && "Cannot access invalid iterator");
1338
9.90k
    return branched() ? 
path.leaf<Leaf>().stop(path.leafOffset())63
:
1339
9.90k
                        
path.leaf<RootLeaf>().stop(path.leafOffset())9.83k
;
1340
9.90k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::unsafeStop() const
Line
Count
Source
1336
1.07M
  KeyT &unsafeStop() const {
1337
1.07M
    assert(valid() && "Cannot access invalid iterator");
1338
1.07M
    return branched() ? 
path.leaf<Leaf>().stop(path.leafOffset())300k
:
1339
1.07M
                        
path.leaf<RootLeaf>().stop(path.leafOffset())770k
;
1340
1.07M
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::unsafeStop() const
Line
Count
Source
1336
22.3k
  KeyT &unsafeStop() const {
1337
22.3k
    assert(valid() && "Cannot access invalid iterator");
1338
22.3k
    return branched() ? 
path.leaf<Leaf>().stop(path.leafOffset())2
:
1339
22.3k
                        
path.leaf<RootLeaf>().stop(path.leafOffset())22.3k
;
1340
22.3k
  }
1341
1342
  /// unsafeValue - Writable access to value() for iterator.
1343
177M
  ValT &unsafeValue() const {
1344
177M
    assert(valid() && "Cannot access invalid iterator");
1345
177M
    return branched() ? 
path.leaf<Leaf>().value(path.leafOffset())52.5M
:
1346
177M
                        
path.leaf<RootLeaf>().value(path.leafOffset())124M
;
1347
177M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::unsafeValue() const
Line
Count
Source
1343
29.7k
  ValT &unsafeValue() const {
1344
29.7k
    assert(valid() && "Cannot access invalid iterator");
1345
29.7k
    return branched() ? 
path.leaf<Leaf>().value(path.leafOffset())205
:
1346
29.7k
                        
path.leaf<RootLeaf>().value(path.leafOffset())29.5k
;
1347
29.7k
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::unsafeValue() const
Line
Count
Source
1343
176M
  ValT &unsafeValue() const {
1344
176M
    assert(valid() && "Cannot access invalid iterator");
1345
176M
    return branched() ? 
path.leaf<Leaf>().value(path.leafOffset())52.3M
:
1346
176M
                        
path.leaf<RootLeaf>().value(path.leafOffset())124M
;
1347
176M
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::unsafeValue() const
Line
Count
Source
1343
702k
  ValT &unsafeValue() const {
1344
702k
    assert(valid() && "Cannot access invalid iterator");
1345
702k
    return branched() ? 
path.leaf<Leaf>().value(path.leafOffset())198k
:
1346
702k
                        
path.leaf<RootLeaf>().value(path.leafOffset())503k
;
1347
702k
  }
1348
1349
public:
1350
  /// const_iterator - Create an iterator that isn't pointing anywhere.
1351
105M
  const_iterator() = default;
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::const_iterator()
Line
Count
Source
1351
105M
  const_iterator() = default;
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::const_iterator()
Line
Count
Source
1351
15
  const_iterator() = default;
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::const_iterator()
Line
Count
Source
1351
143k
  const_iterator() = default;
1352
1353
  /// setMap - Change the map iterated over. This call must be followed by a
1354
  /// call to goToBegin(), goToEnd(), or find()
1355
138M
  void setMap(const IntervalMap &m) { map = const_cast<IntervalMap*>(&m); }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::setMap(llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> > const&)
Line
Count
Source
1355
137M
  void setMap(const IntervalMap &m) { map = const_cast<IntervalMap*>(&m); }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::setMap(llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> > const&)
Line
Count
Source
1355
15
  void setMap(const IntervalMap &m) { map = const_cast<IntervalMap*>(&m); }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::setMap(llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> > const&)
Line
Count
Source
1355
143k
  void setMap(const IntervalMap &m) { map = const_cast<IntervalMap*>(&m); }
1356
1357
  /// valid - Return true if the current position is valid, false for end().
1358
421M
  bool valid() const { return path.valid(); }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::valid() const
Line
Count
Source
1358
417M
  bool valid() const { return path.valid(); }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::valid() const
Line
Count
Source
1358
62.2k
  bool valid() const { return path.valid(); }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::valid() const
Line
Count
Source
1358
2.59M
  bool valid() const { return path.valid(); }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::valid() const
Line
Count
Source
1358
548k
  bool valid() const { return path.valid(); }
1359
1360
  /// atBegin - Return true if the current position is the first map entry.
1361
  bool atBegin() const { return path.atBegin(); }
1362
1363
  /// start - Return the beginning of the current interval.
1364
344M
  const KeyT &start() const { return unsafeStart(); }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::start() const
Line
Count
Source
1364
342M
  const KeyT &start() const { return unsafeStart(); }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::start() const
Line
Count
Source
1364
19.9k
  const KeyT &start() const { return unsafeStart(); }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::start() const
Line
Count
Source
1364
1.55M
  const KeyT &start() const { return unsafeStart(); }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::start() const
Line
Count
Source
1364
225k
  const KeyT &start() const { return unsafeStart(); }
1365
1366
  /// stop - Return the end of the current interval.
1367
272M
  const KeyT &stop() const { return unsafeStop(); }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::stop() const
Line
Count
Source
1367
271M
  const KeyT &stop() const { return unsafeStop(); }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::stop() const
Line
Count
Source
1367
9.85k
  const KeyT &stop() const { return unsafeStop(); }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::stop() const
Line
Count
Source
1367
1.07M
  const KeyT &stop() const { return unsafeStop(); }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::stop() const
Line
Count
Source
1367
22.3k
  const KeyT &stop() const { return unsafeStop(); }
1368
1369
  /// value - Return the mapped value at the current interval.
1370
177M
  const ValT &value() const { return unsafeValue(); }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::value() const
Line
Count
Source
1370
24.7k
  const ValT &value() const { return unsafeValue(); }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::value() const
Line
Count
Source
1370
176M
  const ValT &value() const { return unsafeValue(); }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::value() const
Line
Count
Source
1370
702k
  const ValT &value() const { return unsafeValue(); }
1371
1372
  const ValT &operator*() const { return value(); }
1373
1374
486k
  bool operator==(const const_iterator &RHS) const {
1375
486k
    assert(map == RHS.map && "Cannot compare iterators from different maps");
1376
486k
    if (!valid())
1377
37.3k
      return !RHS.valid();
1378
449k
    if (path.leafOffset() != RHS.path.leafOffset())
1379
229k
      return false;
1380
220k
    return &path.template leaf<Leaf>() == &RHS.path.template leaf<Leaf>();
1381
220k
  }
1382
1383
486k
  bool operator!=(const const_iterator &RHS) const {
1384
486k
    return !operator==(RHS);
1385
486k
  }
1386
1387
  /// goToBegin - Move to the first interval in map.
1388
439k
  void goToBegin() {
1389
439k
    setRoot(0);
1390
439k
    if (branched())
1391
12.9k
      path.fillLeft(map->height);
1392
439k
  }
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::goToBegin()
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::goToBegin()
Line
Count
Source
1388
18.7k
  void goToBegin() {
1389
18.7k
    setRoot(0);
1390
18.7k
    if (branched())
1391
19
      path.fillLeft(map->height);
1392
18.7k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::goToBegin()
Line
Count
Source
1388
177k
  void goToBegin() {
1389
177k
    setRoot(0);
1390
177k
    if (branched())
1391
11.8k
      path.fillLeft(map->height);
1392
177k
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::goToBegin()
Line
Count
Source
1388
242k
  void goToBegin() {
1389
242k
    setRoot(0);
1390
242k
    if (branched())
1391
1.07k
      path.fillLeft(map->height);
1392
242k
  }
1393
1394
  /// goToEnd - Move beyond the last interval in map.
1395
244k
  void goToEnd() {
1396
244k
    setRoot(map->rootSize);
1397
244k
  }
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::goToEnd()
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::goToEnd()
Line
Count
Source
1395
244k
  void goToEnd() {
1396
244k
    setRoot(map->rootSize);
1397
244k
  }
1398
1399
  /// preincrement - move to the next interval.
1400
56.5M
  const_iterator &operator++() {
1401
56.5M
    assert(valid() && "Cannot increment end()");
1402
56.5M
    if (++path.leafOffset() == path.leafSize() && 
branched()15.0M
)
1403
6.06M
      path.moveRight(map->height);
1404
56.5M
    return *this;
1405
56.5M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::operator++()
Line
Count
Source
1400
56.1M
  const_iterator &operator++() {
1401
56.1M
    assert(valid() && "Cannot increment end()");
1402
56.1M
    if (++path.leafOffset() == path.leafSize() && 
branched()14.9M
)
1403
6.04M
      path.moveRight(map->height);
1404
56.1M
    return *this;
1405
56.1M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::operator++()
Line
Count
Source
1400
19.7k
  const_iterator &operator++() {
1401
19.7k
    assert(valid() && "Cannot increment end()");
1402
19.7k
    if (++path.leafOffset() == path.leafSize() && 
branched()18.6k
)
1403
22
      path.moveRight(map->height);
1404
19.7k
    return *this;
1405
19.7k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::operator++()
Line
Count
Source
1400
355k
  const_iterator &operator++() {
1401
355k
    assert(valid() && "Cannot increment end()");
1402
355k
    if (++path.leafOffset() == path.leafSize() && 
branched()91.5k
)
1403
14.1k
      path.moveRight(map->height);
1404
355k
    return *this;
1405
355k
  }
1406
1407
  /// postincrement - Dont do that!
1408
  const_iterator operator++(int) {
1409
    const_iterator tmp = *this;
1410
    operator++();
1411
    return tmp;
1412
  }
1413
1414
  /// predecrement - move to the previous interval.
1415
4.72M
  const_iterator &operator--() {
1416
4.72M
    if (path.leafOffset() && 
(4.34M
valid()4.34M
||
!branched()843k
))
1417
4.14M
      --path.leafOffset();
1418
586k
    else
1419
586k
      path.moveLeft(map->height);
1420
4.72M
    return *this;
1421
4.72M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::operator--()
Line
Count
Source
1415
4.70M
  const_iterator &operator--() {
1416
4.70M
    if (path.leafOffset() && 
(4.32M
valid()4.32M
||
!branched()824k
))
1417
4.12M
      --path.leafOffset();
1418
586k
    else
1419
586k
      path.moveLeft(map->height);
1420
4.70M
    return *this;
1421
4.70M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::operator--()
Line
Count
Source
1415
12
  const_iterator &operator--() {
1416
12
    if (path.leafOffset() && (valid() || 
!branched()0
))
1417
12
      --path.leafOffset();
1418
0
    else
1419
0
      path.moveLeft(map->height);
1420
12
    return *this;
1421
12
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::operator--()
Line
Count
Source
1415
22.3k
  const_iterator &operator--() {
1416
22.3k
    if (path.leafOffset() && (valid() || 
!branched()18.6k
))
1417
22.3k
      --path.leafOffset();
1418
2
    else
1419
2
      path.moveLeft(map->height);
1420
22.3k
    return *this;
1421
22.3k
  }
1422
1423
  /// postdecrement - Dont do that!
1424
  const_iterator operator--(int) {
1425
    const_iterator tmp = *this;
1426
    operator--();
1427
    return tmp;
1428
  }
1429
1430
  /// find - Move to the first interval with stop >= x, or end().
1431
  /// This is a full search from the root, the current position is ignored.
1432
158M
  void find(KeyT x) {
1433
158M
    if (branched())
1434
32.3M
      treeFind(x);
1435
126M
    else
1436
126M
      setRoot(map->rootLeaf().findFrom(0, map->rootSize, x));
1437
158M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::find(llvm::SlotIndex)
Line
Count
Source
1432
157M
  void find(KeyT x) {
1433
157M
    if (branched())
1434
31.6M
      treeFind(x);
1435
125M
    else
1436
125M
      setRoot(map->rootLeaf().findFrom(0, map->rootSize, x));
1437
157M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::find(llvm::SlotIndex)
Line
Count
Source
1432
9.79k
  void find(KeyT x) {
1433
9.79k
    if (branched())
1434
69
      treeFind(x);
1435
9.72k
    else
1436
9.72k
      setRoot(map->rootLeaf().findFrom(0, map->rootSize, x));
1437
9.79k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::find(llvm::SlotIndex)
Line
Count
Source
1432
735k
  void find(KeyT x) {
1433
735k
    if (branched())
1434
658k
      treeFind(x);
1435
76.6k
    else
1436
76.6k
      setRoot(map->rootLeaf().findFrom(0, map->rootSize, x));
1437
735k
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::find(long long)
Line
Count
Source
1432
245k
  void find(KeyT x) {
1433
245k
    if (branched())
1434
2.15k
      treeFind(x);
1435
243k
    else
1436
243k
      setRoot(map->rootLeaf().findFrom(0, map->rootSize, x));
1437
245k
  }
1438
1439
  /// advanceTo - Move to the first interval with stop >= x, or end().
1440
  /// The search is started from the current position, and no earlier positions
1441
  /// can be found. This is much faster than find() for small moves.
1442
28.6M
  void advanceTo(KeyT x) {
1443
28.6M
    if (!valid())
1444
5.77M
      return;
1445
22.8M
    if (branched())
1446
12.9M
      treeAdvanceTo(x);
1447
9.97M
    else
1448
9.97M
      path.leafOffset() =
1449
9.97M
        map->rootLeaf().findFrom(path.leafOffset(), map->rootSize, x);
1450
22.8M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::advanceTo(llvm::SlotIndex)
Line
Count
Source
1442
28.0M
  void advanceTo(KeyT x) {
1443
28.0M
    if (!valid())
1444
5.68M
      return;
1445
22.3M
    if (branched())
1446
12.7M
      treeAdvanceTo(x);
1447
9.55M
    else
1448
9.55M
      path.leafOffset() =
1449
9.55M
        map->rootLeaf().findFrom(path.leafOffset(), map->rootSize, x);
1450
22.3M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::advanceTo(llvm::SlotIndex)
Line
Count
Source
1442
9.24k
  void advanceTo(KeyT x) {
1443
9.24k
    if (!valid())
1444
2
      return;
1445
9.24k
    if (branched())
1446
8
      treeAdvanceTo(x);
1447
9.23k
    else
1448
9.23k
      path.leafOffset() =
1449
9.23k
        map->rootLeaf().findFrom(path.leafOffset(), map->rootSize, x);
1450
9.24k
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::advanceTo(llvm::SlotIndex)
Line
Count
Source
1442
627k
  void advanceTo(KeyT x) {
1443
627k
    if (!valid())
1444
83.6k
      return;
1445
543k
    if (branched())
1446
128k
      treeAdvanceTo(x);
1447
414k
    else
1448
414k
      path.leafOffset() =
1449
414k
        map->rootLeaf().findFrom(path.leafOffset(), map->rootSize, x);
1450
543k
  }
1451
};
1452
1453
/// pathFillFind - Complete path by searching for x.
1454
/// @param x Key to search for.
1455
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1456
void IntervalMap<KeyT, ValT, N, Traits>::
1457
32.9M
const_iterator::pathFillFind(KeyT x) {
1458
32.9M
  IntervalMapImpl::NodeRef NR = path.subtree(path.height());
1459
36.5M
  for (unsigned i = map->height - path.height() - 1; i; 
--i3.58M
) {
1460
3.58M
    unsigned p = NR.get<Branch>().safeFind(0, x);
1461
3.58M
    path.push(NR, p);
1462
3.58M
    NR = NR.subtree(p);
1463
3.58M
  }
1464
32.9M
  path.push(NR, NR.get<Leaf>().safeFind(0, x));
1465
32.9M
}
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::pathFillFind(llvm::SlotIndex)
Line
Count
Source
1457
32.3M
const_iterator::pathFillFind(KeyT x) {
1458
32.3M
  IntervalMapImpl::NodeRef NR = path.subtree(path.height());
1459
35.8M
  for (unsigned i = map->height - path.height() - 1; i; 
--i3.54M
) {
1460
3.54M
    unsigned p = NR.get<Branch>().safeFind(0, x);
1461
3.54M
    path.push(NR, p);
1462
3.54M
    NR = NR.subtree(p);
1463
3.54M
  }
1464
32.3M
  path.push(NR, NR.get<Leaf>().safeFind(0, x));
1465
32.3M
}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::pathFillFind(llvm::SlotIndex)
Line
Count
Source
1457
64
const_iterator::pathFillFind(KeyT x) {
1458
64
  IntervalMapImpl::NodeRef NR = path.subtree(path.height());
1459
64
  for (unsigned i = map->height - path.height() - 1; i; 
--i0
) {
1460
0
    unsigned p = NR.get<Branch>().safeFind(0, x);
1461
0
    path.push(NR, p);
1462
0
    NR = NR.subtree(p);
1463
0
  }
1464
64
  path.push(NR, NR.get<Leaf>().safeFind(0, x));
1465
64
}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::pathFillFind(llvm::SlotIndex)
Line
Count
Source
1457
623k
const_iterator::pathFillFind(KeyT x) {
1458
623k
  IntervalMapImpl::NodeRef NR = path.subtree(path.height());
1459
668k
  for (unsigned i = map->height - path.height() - 1; i; 
--i45.1k
) {
1460
45.1k
    unsigned p = NR.get<Branch>().safeFind(0, x);
1461
45.1k
    path.push(NR, p);
1462
45.1k
    NR = NR.subtree(p);
1463
45.1k
  }
1464
623k
  path.push(NR, NR.get<Leaf>().safeFind(0, x));
1465
623k
}
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::pathFillFind(long long)
Line
Count
Source
1457
2.14k
const_iterator::pathFillFind(KeyT x) {
1458
2.14k
  IntervalMapImpl::NodeRef NR = path.subtree(path.height());
1459
2.14k
  for (unsigned i = map->height - path.height() - 1; i; 
--i0
) {
1460
0
    unsigned p = NR.get<Branch>().safeFind(0, x);
1461
0
    path.push(NR, p);
1462
0
    NR = NR.subtree(p);
1463
0
  }
1464
2.14k
  path.push(NR, NR.get<Leaf>().safeFind(0, x));
1465
2.14k
}
1466
1467
/// treeFind - Find in a branched tree.
1468
/// @param x Key to search for.
1469
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1470
void IntervalMap<KeyT, ValT, N, Traits>::
1471
32.3M
const_iterator::treeFind(KeyT x) {
1472
32.3M
  setRoot(map->rootBranch().findFrom(0, map->rootSize, x));
1473
32.3M
  if (valid())
1474
30.4M
    pathFillFind(x);
1475
32.3M
}
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::treeFind(llvm::SlotIndex)
Line
Count
Source
1471
31.6M
const_iterator::treeFind(KeyT x) {
1472
31.6M
  setRoot(map->rootBranch().findFrom(0, map->rootSize, x));
1473
31.6M
  if (valid())
1474
29.8M
    pathFillFind(x);
1475
31.6M
}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::treeFind(llvm::SlotIndex)
Line
Count
Source
1471
69
const_iterator::treeFind(KeyT x) {
1472
69
  setRoot(map->rootBranch().findFrom(0, map->rootSize, x));
1473
69
  if (valid())
1474
64
    pathFillFind(x);
1475
69
}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::treeFind(llvm::SlotIndex)
Line
Count
Source
1471
658k
const_iterator::treeFind(KeyT x) {
1472
658k
  setRoot(map->rootBranch().findFrom(0, map->rootSize, x));
1473
658k
  if (valid())
1474
616k
    pathFillFind(x);
1475
658k
}
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::const_iterator::treeFind(long long)
Line
Count
Source
1471
2.15k
const_iterator::treeFind(KeyT x) {
1472
2.15k
  setRoot(map->rootBranch().findFrom(0, map->rootSize, x));
1473
2.15k
  if (valid())
1474
2.14k
    pathFillFind(x);
1475
2.15k
}
1476
1477
/// treeAdvanceTo - Find position after the current one.
1478
/// @param x Key to search for.
1479
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1480
void IntervalMap<KeyT, ValT, N, Traits>::
1481
12.9M
const_iterator::treeAdvanceTo(KeyT x) {
1482
12.9M
  // Can we stay on the same leaf node?
1483
12.9M
  if (!Traits::stopLess(path.leaf<Leaf>().stop(path.leafSize() - 1), x)) {
1484
9.86M
    path.leafOffset() = path.leaf<Leaf>().safeFind(path.leafOffset(), x);
1485
9.86M
    return;
1486
9.86M
  }
1487
3.05M
1488
3.05M
  // Drop the current leaf.
1489
3.05M
  path.pop();
1490
3.05M
1491
3.05M
  // Search towards the root for a usable subtree.
1492
3.05M
  if (path.height()) {
1493
815k
    for (unsigned l = path.height() - 1; l; 
--l16.9k
) {
1494
60.2k
      if (!Traits::stopLess(path.node<Branch>(l).stop(path.offset(l)), x)) {
1495
43.3k
        // The branch node at l+1 is usable
1496
43.3k
        path.offset(l + 1) =
1497
43.3k
          path.node<Branch>(l + 1).safeFind(path.offset(l + 1), x);
1498
43.3k
        return pathFillFind(x);
1499
43.3k
      }
1500
16.9k
      path.pop();
1501
16.9k
    }
1502
798k
    // Is the level-1 Branch usable?
1503
798k
    
if (755k
!Traits::stopLess(map->rootBranch().stop(path.offset(0)), x)755k
) {
1504
579k
      path.offset(1) = path.node<Branch>(1).safeFind(path.offset(1), x);
1505
579k
      return pathFillFind(x);
1506
579k
    }
1507
2.43M
  }
1508
2.43M
1509
2.43M
  // We reached the root.
1510
2.43M
  setRoot(map->rootBranch().findFrom(path.offset(0), map->rootSize, x));
1511
2.43M
  if (valid())
1512
1.88M
    pathFillFind(x);
1513
2.43M
}
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::treeAdvanceTo(llvm::SlotIndex)
Line
Count
Source
1481
12.7M
const_iterator::treeAdvanceTo(KeyT x) {
1482
12.7M
  // Can we stay on the same leaf node?
1483
12.7M
  if (!Traits::stopLess(path.leaf<Leaf>().stop(path.leafSize() - 1), x)) {
1484
9.74M
    path.leafOffset() = path.leaf<Leaf>().safeFind(path.leafOffset(), x);
1485
9.74M
    return;
1486
9.74M
  }
1487
3.05M
1488
3.05M
  // Drop the current leaf.
1489
3.05M
  path.pop();
1490
3.05M
1491
3.05M
  // Search towards the root for a usable subtree.
1492
3.05M
  if (path.height()) {
1493
814k
    for (unsigned l = path.height() - 1; l; 
--l16.9k
) {
1494
60.2k
      if (!Traits::stopLess(path.node<Branch>(l).stop(path.offset(l)), x)) {
1495
43.3k
        // The branch node at l+1 is usable
1496
43.3k
        path.offset(l + 1) =
1497
43.3k
          path.node<Branch>(l + 1).safeFind(path.offset(l + 1), x);
1498
43.3k
        return pathFillFind(x);
1499
43.3k
      }
1500
16.9k
      path.pop();
1501
16.9k
    }
1502
797k
    // Is the level-1 Branch usable?
1503
797k
    
if (754k
!Traits::stopLess(map->rootBranch().stop(path.offset(0)), x)754k
) {
1504
578k
      path.offset(1) = path.node<Branch>(1).safeFind(path.offset(1), x);
1505
578k
      return pathFillFind(x);
1506
578k
    }
1507
2.42M
  }
1508
2.42M
1509
2.42M
  // We reached the root.
1510
2.42M
  setRoot(map->rootBranch().findFrom(path.offset(0), map->rootSize, x));
1511
2.42M
  if (valid())
1512
1.87M
    pathFillFind(x);
1513
2.42M
}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::treeAdvanceTo(llvm::SlotIndex)
Line
Count
Source
1481
8
const_iterator::treeAdvanceTo(KeyT x) {
1482
8
  // Can we stay on the same leaf node?
1483
8
  if (!Traits::stopLess(path.leaf<Leaf>().stop(path.leafSize() - 1), x)) {
1484
4
    path.leafOffset() = path.leaf<Leaf>().safeFind(path.leafOffset(), x);
1485
4
    return;
1486
4
  }
1487
4
1488
4
  // Drop the current leaf.
1489
4
  path.pop();
1490
4
1491
4
  // Search towards the root for a usable subtree.
1492
4
  if (path.height()) {
1493
0
    for (unsigned l = path.height() - 1; l; --l) {
1494
0
      if (!Traits::stopLess(path.node<Branch>(l).stop(path.offset(l)), x)) {
1495
0
        // The branch node at l+1 is usable
1496
0
        path.offset(l + 1) =
1497
0
          path.node<Branch>(l + 1).safeFind(path.offset(l + 1), x);
1498
0
        return pathFillFind(x);
1499
0
      }
1500
0
      path.pop();
1501
0
    }
1502
0
    // Is the level-1 Branch usable?
1503
0
    if (!Traits::stopLess(map->rootBranch().stop(path.offset(0)), x)) {
1504
0
      path.offset(1) = path.node<Branch>(1).safeFind(path.offset(1), x);
1505
0
      return pathFillFind(x);
1506
0
    }
1507
4
  }
1508
4
1509
4
  // We reached the root.
1510
4
  setRoot(map->rootBranch().findFrom(path.offset(0), map->rootSize, x));
1511
4
  if (valid())
1512
0
    pathFillFind(x);
1513
4
}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::const_iterator::treeAdvanceTo(llvm::SlotIndex)
Line
Count
Source
1481
128k
const_iterator::treeAdvanceTo(KeyT x) {
1482
128k
  // Can we stay on the same leaf node?
1483
128k
  if (!Traits::stopLess(path.leaf<Leaf>().stop(path.leafSize() - 1), x)) {
1484
120k
    path.leafOffset() = path.leaf<Leaf>().safeFind(path.leafOffset(), x);
1485
120k
    return;
1486
120k
  }
1487
8.94k
1488
8.94k
  // Drop the current leaf.
1489
8.94k
  path.pop();
1490
8.94k
1491
8.94k
  // Search towards the root for a usable subtree.
1492
8.94k
  if (path.height()) {
1493
1.16k
    for (unsigned l = path.height() - 1; l; 
--l0
) {
1494
0
      if (!Traits::stopLess(path.node<Branch>(l).stop(path.offset(l)), x)) {
1495
0
        // The branch node at l+1 is usable
1496
0
        path.offset(l + 1) =
1497
0
          path.node<Branch>(l + 1).safeFind(path.offset(l + 1), x);
1498
0
        return pathFillFind(x);
1499
0
      }
1500
0
      path.pop();
1501
0
    }
1502
1.16k
    // Is the level-1 Branch usable?
1503
1.16k
    if (!Traits::stopLess(map->rootBranch().stop(path.offset(0)), x)) {
1504
1.06k
      path.offset(1) = path.node<Branch>(1).safeFind(path.offset(1), x);
1505
1.06k
      return pathFillFind(x);
1506
1.06k
    }
1507
7.88k
  }
1508
7.88k
1509
7.88k
  // We reached the root.
1510
7.88k
  setRoot(map->rootBranch().findFrom(path.offset(0), map->rootSize, x));
1511
7.88k
  if (valid())
1512
6.19k
    pathFillFind(x);
1513
7.88k
}
1514
1515
//===----------------------------------------------------------------------===//
1516
//---                       IntervalMap::iterator                         ----//
1517
//===----------------------------------------------------------------------===//
1518
1519
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1520
class IntervalMap<KeyT, ValT, N, Traits>::iterator : public const_iterator {
1521
  friend class IntervalMap;
1522
1523
  using IdxPair = IntervalMapImpl::IdxPair;
1524
1525
13.1M
  explicit iterator(IntervalMap &map) : const_iterator(map) {}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::iterator(llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >&)
Line
Count
Source
1525
28.4k
  explicit iterator(IntervalMap &map) : const_iterator(map) {}
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::iterator(llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >&)
Line
Count
Source
1525
11.5M
  explicit iterator(IntervalMap &map) : const_iterator(map) {}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::iterator(llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >&)
Line
Count
Source
1525
871k
  explicit iterator(IntervalMap &map) : const_iterator(map) {}
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::iterator::iterator(llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >&)
Line
Count
Source
1525
732k
  explicit iterator(IntervalMap &map) : const_iterator(map) {}
1526
1527
  void setNodeStop(unsigned Level, KeyT Stop);
1528
  bool insertNode(unsigned Level, IntervalMapImpl::NodeRef Node, KeyT Stop);
1529
  template <typename NodeT> bool overflow(unsigned Level);
1530
  void treeInsert(KeyT a, KeyT b, ValT y);
1531
  void eraseNode(unsigned Level);
1532
  void treeErase(bool UpdateRoot = true);
1533
  bool canCoalesceLeft(KeyT Start, ValT x);
1534
  bool canCoalesceRight(KeyT Stop, ValT x);
1535
1536
public:
1537
  /// iterator - Create null iterator.
1538
2.73M
  iterator() = default;
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::iterator()
Line
Count
Source
1538
2.59M
  iterator() = default;
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::iterator()
Line
Count
Source
1538
15
  iterator() = default;
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::iterator()
Line
Count
Source
1538
143k
  iterator() = default;
1539
1540
  /// setStart - Move the start of the current interval.
1541
  /// This may cause coalescing with the previous interval.
1542
  /// @param a New start key, must not overlap the previous interval.
1543
  void setStart(KeyT a);
1544
1545
  /// setStop - Move the end of the current interval.
1546
  /// This may cause coalescing with the following interval.
1547
  /// @param b New stop key, must not overlap the following interval.
1548
  void setStop(KeyT b);
1549
1550
  /// setValue - Change the mapped value of the current interval.
1551
  /// This may cause coalescing with the previous and following intervals.
1552
  /// @param x New value.
1553
  void setValue(ValT x);
1554
1555
  /// setStartUnchecked - Move the start of the current interval without
1556
  /// checking for coalescing or overlaps.
1557
  /// This should only be used when it is known that coalescing is not required.
1558
  /// @param a New start key.
1559
11
  void setStartUnchecked(KeyT a) { this->unsafeStart() = a; }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::setStartUnchecked(llvm::SlotIndex)
Line
Count
Source
1559
11
  void setStartUnchecked(KeyT a) { this->unsafeStart() = a; }
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::setStartUnchecked(llvm::SlotIndex)
1560
1561
  /// setStopUnchecked - Move the end of the current interval without checking
1562
  /// for coalescing or overlaps.
1563
  /// This should only be used when it is known that coalescing is not required.
1564
  /// @param b New stop key.
1565
203
  void setStopUnchecked(KeyT b) {
1566
203
    this->unsafeStop() = b;
1567
203
    // Update keys in branch nodes as well.
1568
203
    if (this->path.atLastEntry(this->path.height()))
1569
81
      setNodeStop(this->path.height(), b);
1570
203
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::setStopUnchecked(llvm::SlotIndex)
Line
Count
Source
1565
48
  void setStopUnchecked(KeyT b) {
1566
48
    this->unsafeStop() = b;
1567
48
    // Update keys in branch nodes as well.
1568
48
    if (this->path.atLastEntry(this->path.height()))
1569
47
      setNodeStop(this->path.height(), b);
1570
48
  }
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::setStopUnchecked(llvm::SlotIndex)
Line
Count
Source
1565
155
  void setStopUnchecked(KeyT b) {
1566
155
    this->unsafeStop() = b;
1567
155
    // Update keys in branch nodes as well.
1568
155
    if (this->path.atLastEntry(this->path.height()))
1569
34
      setNodeStop(this->path.height(), b);
1570
155
  }
1571
1572
  /// setValueUnchecked - Change the mapped value of the current interval
1573
  /// without checking for coalescing.
1574
  /// @param x New value.
1575
5.00k
  void setValueUnchecked(ValT x) { this->unsafeValue() = x; }
1576
1577
  /// insert - Insert mapping [a;b] -> y before the current position.
1578
  void insert(KeyT a, KeyT b, ValT y);
1579
1580
  /// erase - Erase the current interval.
1581
  void erase();
1582
1583
27.4M
  iterator &operator++() {
1584
27.4M
    const_iterator::operator++();
1585
27.4M
    return *this;
1586
27.4M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::operator++()
Line
Count
Source
1583
27.4M
  iterator &operator++() {
1584
27.4M
    const_iterator::operator++();
1585
27.4M
    return *this;
1586
27.4M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::operator++()
Line
Count
Source
1583
9.75k
  iterator &operator++() {
1584
9.75k
    const_iterator::operator++();
1585
9.75k
    return *this;
1586
9.75k
  }
1587
1588
  iterator operator++(int) {
1589
    iterator tmp = *this;
1590
    operator++();
1591
    return tmp;
1592
  }
1593
1594
4.72M
  iterator &operator--() {
1595
4.72M
    const_iterator::operator--();
1596
4.72M
    return *this;
1597
4.72M
  }
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::operator--()
Line
Count
Source
1594
4.70M
  iterator &operator--() {
1595
4.70M
    const_iterator::operator--();
1596
4.70M
    return *this;
1597
4.70M
  }
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::operator--()
Line
Count
Source
1594
12
  iterator &operator--() {
1595
12
    const_iterator::operator--();
1596
12
    return *this;
1597
12
  }
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::iterator::operator--()
Line
Count
Source
1594
22.3k
  iterator &operator--() {
1595
22.3k
    const_iterator::operator--();
1596
22.3k
    return *this;
1597
22.3k
  }
1598
1599
  iterator operator--(int) {
1600
    iterator tmp = *this;
1601
    operator--();
1602
    return tmp;
1603
  }
1604
};
1605
1606
/// canCoalesceLeft - Can the current interval coalesce to the left after
1607
/// changing start or value?
1608
/// @param Start New start of current interval.
1609
/// @param Value New value for current interval.
1610
/// @return True when updating the current interval would enable coalescing.
1611
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1612
bool IntervalMap<KeyT, ValT, N, Traits>::
1613
53
iterator::canCoalesceLeft(KeyT Start, ValT Value) {
1614
53
  using namespace IntervalMapImpl;
1615
53
  Path &P = this->path;
1616
53
  if (!this->branched()) {
1617
53
    unsigned i = P.leafOffset();
1618
53
    RootLeaf &Node = P.leaf<RootLeaf>();
1619
53
    return i && 
Node.value(i-1) == Value21
&&
1620
53
                
Traits::adjacent(Node.stop(i-1), Start)3
;
1621
53
  }
1622
0
  // Branched.
1623
0
  if (unsigned i = P.leafOffset()) {
1624
0
    Leaf &Node = P.leaf<Leaf>();
1625
0
    return Node.value(i-1) == Value && Traits::adjacent(Node.stop(i-1), Start);
1626
0
  } else if (NodeRef NR = P.getLeftSibling(P.height())) {
1627
0
    unsigned i = NR.size() - 1;
1628
0
    Leaf &Node = NR.get<Leaf>();
1629
0
    return Node.value(i) == Value && Traits::adjacent(Node.stop(i), Start);
1630
0
  }
1631
0
  return false;
1632
0
}
1633
1634
/// canCoalesceRight - Can the current interval coalesce to the right after
1635
/// changing stop or value?
1636
/// @param Stop New stop of current interval.
1637
/// @param Value New value for current interval.
1638
/// @return True when updating the current interval would enable coalescing.
1639
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1640
bool IntervalMap<KeyT, ValT, N, Traits>::
1641
53
iterator::canCoalesceRight(KeyT Stop, ValT Value) {
1642
53
  using namespace IntervalMapImpl;
1643
53
  Path &P = this->path;
1644
53
  unsigned i = P.leafOffset() + 1;
1645
53
  if (!this->branched()) {
1646
53
    if (i >= P.leafSize())
1647
41
      return false;
1648
12
    RootLeaf &Node = P.leaf<RootLeaf>();
1649
12
    return Node.value(i) == Value && 
Traits::adjacent(Stop, Node.start(i))0
;
1650
12
  }
1651
0
  // Branched.
1652
0
  if (i < P.leafSize()) {
1653
0
    Leaf &Node = P.leaf<Leaf>();
1654
0
    return Node.value(i) == Value && Traits::adjacent(Stop, Node.start(i));
1655
0
  } else if (NodeRef NR = P.getRightSibling(P.height())) {
1656
0
    Leaf &Node = NR.get<Leaf>();
1657
0
    return Node.value(0) == Value && Traits::adjacent(Stop, Node.start(0));
1658
0
  }
1659
0
  return false;
1660
0
}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::canCoalesceRight(llvm::SlotIndex, DbgValueLocation)
Line
Count
Source
1641
53
iterator::canCoalesceRight(KeyT Stop, ValT Value) {
1642
53
  using namespace IntervalMapImpl;
1643
53
  Path &P = this->path;
1644
53
  unsigned i = P.leafOffset() + 1;
1645
53
  if (!this->branched()) {
1646
53
    if (i >= P.leafSize())
1647
41
      return false;
1648
12
    RootLeaf &Node = P.leaf<RootLeaf>();
1649
12
    return Node.value(i) == Value && 
Traits::adjacent(Stop, Node.start(i))0
;
1650
12
  }
1651
0
  // Branched.
1652
0
  if (i < P.leafSize()) {
1653
0
    Leaf &Node = P.leaf<Leaf>();
1654
0
    return Node.value(i) == Value && Traits::adjacent(Stop, Node.start(i));
1655
0
  } else if (NodeRef NR = P.getRightSibling(P.height())) {
1656
0
    Leaf &Node = NR.get<Leaf>();
1657
0
    return Node.value(0) == Value && Traits::adjacent(Stop, Node.start(0));
1658
0
  }
1659
0
  return false;
1660
0
}
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::canCoalesceRight(llvm::SlotIndex, unsigned int)
1661
1662
/// setNodeStop - Update the stop key of the current node at level and above.
1663
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1664
void IntervalMap<KeyT, ValT, N, Traits>::
1665
4.12M
iterator::setNodeStop(unsigned Level, KeyT Stop) {
1666
4.12M
  // There are no references to the root node, so nothing to update.
1667
4.12M
  if (!Level)
1668
47
    return;
1669
4.12M
  IntervalMapImpl::Path &P = this->path;
1670
4.12M
  // Update nodes pointing to the current node.
1671
4.50M
  while (--Level) {
1672
1.03M
    P.node<Branch>(Level).stop(P.offset(Level)) = Stop;
1673
1.03M
    if (!P.atLastEntry(Level))
1674
656k
      return;
1675
1.03M
  }
1676
4.12M
  // Update root separately since it has a different layout.
1677
4.12M
  P.node<RootBranch>(Level).stop(P.offset(Level)) = Stop;
1678
3.46M
}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::setNodeStop(unsigned int, llvm::SlotIndex)
Line
Count
Source
1665
63
iterator::setNodeStop(unsigned Level, KeyT Stop) {
1666
63
  // There are no references to the root node, so nothing to update.
1667
63
  if (!Level)
1668
47
    return;
1669
16
  IntervalMapImpl::Path &P = this->path;
1670
16
  // Update nodes pointing to the current node.
1671
16
  while (--Level) {
1672
0
    P.node<Branch>(Level).stop(P.offset(Level)) = Stop;
1673
0
    if (!P.atLastEntry(Level))
1674
0
      return;
1675
0
  }
1676
16
  // Update root separately since it has a different layout.
1677
16
  P.node<RootBranch>(Level).stop(P.offset(Level)) = Stop;
1678
16
}
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::setNodeStop(unsigned int, llvm::SlotIndex)
Line
Count
Source
1665
3.95M
iterator::setNodeStop(unsigned Level, KeyT Stop) {
1666
3.95M
  // There are no references to the root node, so nothing to update.
1667
3.95M
  if (!Level)
1668
0
    return;
1669
3.95M
  IntervalMapImpl::Path &P = this->path;
1670
3.95M
  // Update nodes pointing to the current node.
1671
4.32M
  while (--Level) {
1672
1.01M
    P.node<Branch>(Level).stop(P.offset(Level)) = Stop;
1673
1.01M
    if (!P.atLastEntry(Level))
1674
640k
      return;
1675
1.01M
  }
1676
3.95M
  // Update root separately since it has a different layout.
1677
3.95M
  P.node<RootBranch>(Level).stop(P.offset(Level)) = Stop;
1678
3.31M
}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::setNodeStop(unsigned int, llvm::SlotIndex)
Line
Count
Source
1665
173k
iterator::setNodeStop(unsigned Level, KeyT Stop) {
1666
173k
  // There are no references to the root node, so nothing to update.
1667
173k
  if (!Level)
1668
0
    return;
1669
173k
  IntervalMapImpl::Path &P = this->path;
1670
173k
  // Update nodes pointing to the current node.
1671
182k
  while (--Level) {
1672
24.9k
    P.node<Branch>(Level).stop(P.offset(Level)) = Stop;
1673
24.9k
    if (!P.atLastEntry(Level))
1674
15.6k
      return;
1675
24.9k
  }
1676
173k
  // Update root separately since it has a different layout.
1677
173k
  P.node<RootBranch>(Level).stop(P.offset(Level)) = Stop;
1678
157k
}
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::iterator::setNodeStop(unsigned int, long long)
Line
Count
Source
1665
348
iterator::setNodeStop(unsigned Level, KeyT Stop) {
1666
348
  // There are no references to the root node, so nothing to update.
1667
348
  if (!Level)
1668
0
    return;
1669
348
  IntervalMapImpl::Path &P = this->path;
1670
348
  // Update nodes pointing to the current node.
1671
348
  while (--Level) {
1672
0
    P.node<Branch>(Level).stop(P.offset(Level)) = Stop;
1673
0
    if (!P.atLastEntry(Level))
1674
0
      return;
1675
0
  }
1676
348
  // Update root separately since it has a different layout.
1677
348
  P.node<RootBranch>(Level).stop(P.offset(Level)) = Stop;
1678
348
}
1679
1680
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1681
void IntervalMap<KeyT, ValT, N, Traits>::
1682
4.92k
iterator::setStart(KeyT a) {
1683
4.92k
  assert(Traits::nonEmpty(a, this->stop()) && "Cannot move start beyond stop");
1684
4.92k
  KeyT &CurStart = this->unsafeStart();
1685
4.92k
  if (!Traits::startLess(a, CurStart) || 
!canCoalesceLeft(a, this->value())0
) {
1686
4.92k
    CurStart = a;
1687
4.92k
    return;
1688
4.92k
  }
1689
0
  // Coalesce with the interval to the left.
1690
0
  --*this;
1691
0
  a = this->start();
1692
0
  erase();
1693
0
  setStartUnchecked(a);
1694
0
}
1695
1696
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1697
void IntervalMap<KeyT, ValT, N, Traits>::
1698
155
iterator::setStop(KeyT b) {
1699
155
  assert(Traits::nonEmpty(this->start(), b) && "Cannot move stop beyond start");
1700
155
  if (Traits::startLess(b, this->stop()) ||
1701
155
      
!canCoalesceRight(b, this->value())0
) {
1702
155
    setStopUnchecked(b);
1703
155
    return;
1704
155
  }
1705
0
  // Coalesce with interval to the right.
1706
0
  KeyT a = this->start();
1707
0
  erase();
1708
0
  setStartUnchecked(a);
1709
0
}
1710
1711
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1712
void IntervalMap<KeyT, ValT, N, Traits>::
1713
53
iterator::setValue(ValT x) {
1714
53
  setValueUnchecked(x);
1715
53
  if (canCoalesceRight(this->stop(), x)) {
1716
0
    KeyT a = this->start();
1717
0
    erase();
1718
0
    setStartUnchecked(a);
1719
0
  }
1720
53
  if (canCoalesceLeft(this->start(), x)) {
1721
3
    --*this;
1722
3
    KeyT a = this->start();
1723
3
    erase();
1724
3
    setStartUnchecked(a);
1725
3
  }
1726
53
}
1727
1728
/// insertNode - insert a node before the current path at level.
1729
/// Leave the current path pointing at the new node.
1730
/// @param Level path index of the node to be inserted.
1731
/// @param Node The node to be inserted.
1732
/// @param Stop The last index in the new node.
1733
/// @return True if the tree height was increased.
1734
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1735
bool IntervalMap<KeyT, ValT, N, Traits>::
1736
416k
iterator::insertNode(unsigned Level, IntervalMapImpl::NodeRef Node, KeyT Stop) {
1737
416k
  assert(Level && "Cannot insert next to the root");
1738
416k
  bool SplitRoot = false;
1739
416k
  IntervalMap &IM = *this->map;
1740
416k
  IntervalMapImpl::Path &P = this->path;
1741
416k
1742
416k
  if (Level == 1) {
1743
322k
    // Insert into the root branch node.
1744
322k
    if (IM.rootSize < RootBranch::Capacity) {
1745
314k
      IM.rootBranch().insert(P.offset(0), IM.rootSize, Node, Stop);
1746
314k
      P.setSize(0, ++IM.rootSize);
1747
314k
      P.reset(Level);
1748
314k
      return SplitRoot;
1749
314k
    }
1750
7.20k
1751
7.20k
    // We need to split the root while keeping our position.
1752
7.20k
    SplitRoot = true;
1753
7.20k
    IdxPair Offset = IM.splitRoot(P.offset(0));
1754
7.20k
    P.replaceRoot(&IM.rootBranch(), IM.rootSize, Offset);
1755
7.20k
1756
7.20k
    // Fall through to insert at the new higher level.
1757
7.20k
    ++Level;
1758
7.20k
  }
1759
416k
1760
416k
  // When inserting before end(), make sure we have a valid path.
1761
416k
  P.legalizeForInsert(--Level);
1762
101k
1763
101k
  // Insert into the branch node at Level-1.
1764
101k
  if (P.size(Level) == Branch::Capacity) {
1765
27.1k
    // Branch node is full, handle handle the overflow.
1766
27.1k
    assert(!SplitRoot && "Cannot overflow after splitting the root");
1767
27.1k
    SplitRoot = overflow<Branch>(Level);
1768
27.1k
    Level += SplitRoot;
1769
27.1k
  }
1770
101k
  P.node<Branch>(Level).insert(P.offset(Level), P.size(Level), Node, Stop);
1771
101k
  P.setSize(Level, P.size(Level) + 1);
1772
101k
  if (P.atLastEntry(Level))
1773
991
    setNodeStop(Level, Stop);
1774
101k
  P.reset(Level + 1);
1775
101k
  return SplitRoot;
1776
416k
}
Unexecuted instantiation: llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::insertNode(unsigned int, llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex)
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::insertNode(unsigned int, llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex)
Line
Count
Source
1736
406k
iterator::insertNode(unsigned Level, IntervalMapImpl::NodeRef Node, KeyT Stop) {
1737
406k
  assert(Level && "Cannot insert next to the root");
1738
406k
  bool SplitRoot = false;
1739
406k
  IntervalMap &IM = *this->map;
1740
406k
  IntervalMapImpl::Path &P = this->path;
1741
406k
1742
406k
  if (Level == 1) {
1743
314k
    // Insert into the root branch node.
1744
314k
    if (IM.rootSize < RootBranch::Capacity) {
1745
306k
      IM.rootBranch().insert(P.offset(0), IM.rootSize, Node, Stop);
1746
306k
      P.setSize(0, ++IM.rootSize);
1747
306k
      P.reset(Level);
1748
306k
      return SplitRoot;
1749
306k
    }
1750
7.08k
1751
7.08k
    // We need to split the root while keeping our position.
1752
7.08k
    SplitRoot = true;
1753
7.08k
    IdxPair Offset = IM.splitRoot(P.offset(0));
1754
7.08k
    P.replaceRoot(&IM.rootBranch(), IM.rootSize, Offset);
1755
7.08k
1756
7.08k
    // Fall through to insert at the new higher level.
1757
7.08k
    ++Level;
1758
7.08k
  }
1759
406k
1760
406k
  // When inserting before end(), make sure we have a valid path.
1761
406k
  P.legalizeForInsert(--Level);
1762
99.8k
1763
99.8k
  // Insert into the branch node at Level-1.
1764
99.8k
  if (P.size(Level) == Branch::Capacity) {
1765
26.7k
    // Branch node is full, handle handle the overflow.
1766
26.7k
    assert(!SplitRoot && "Cannot overflow after splitting the root");
1767
26.7k
    SplitRoot = overflow<Branch>(Level);
1768
26.7k
    Level += SplitRoot;
1769
26.7k
  }
1770
99.8k
  P.node<Branch>(Level).insert(P.offset(Level), P.size(Level), Node, Stop);
1771
99.8k
  P.setSize(Level, P.size(Level) + 1);
1772
99.8k
  if (P.atLastEntry(Level))
1773
958
    setNodeStop(Level, Stop);
1774
99.8k
  P.reset(Level + 1);
1775
99.8k
  return SplitRoot;
1776
406k
}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::insertNode(unsigned int, llvm::IntervalMapImpl::NodeRef, llvm::SlotIndex)
Line
Count
Source
1736
9.67k
iterator::insertNode(unsigned Level, IntervalMapImpl::NodeRef Node, KeyT Stop) {
1737
9.67k
  assert(Level && "Cannot insert next to the root");
1738
9.67k
  bool SplitRoot = false;
1739
9.67k
  IntervalMap &IM = *this->map;
1740
9.67k
  IntervalMapImpl::Path &P = this->path;
1741
9.67k
1742
9.67k
  if (Level == 1) {
1743
8.02k
    // Insert into the root branch node.
1744
8.02k
    if (IM.rootSize < RootBranch::Capacity) {
1745
7.90k
      IM.rootBranch().insert(P.offset(0), IM.rootSize, Node, Stop);
1746
7.90k
      P.setSize(0, ++IM.rootSize);
1747
7.90k
      P.reset(Level);
1748
7.90k
      return SplitRoot;
1749
7.90k
    }
1750
124
1751
124
    // We need to split the root while keeping our position.
1752
124
    SplitRoot = true;
1753
124
    IdxPair Offset = IM.splitRoot(P.offset(0));
1754
124
    P.replaceRoot(&IM.rootBranch(), IM.rootSize, Offset);
1755
124
1756
124
    // Fall through to insert at the new higher level.
1757
124
    ++Level;
1758
124
  }
1759
9.67k
1760
9.67k
  // When inserting before end(), make sure we have a valid path.
1761
9.67k
  P.legalizeForInsert(--Level);
1762
1.77k
1763
1.77k
  // Insert into the branch node at Level-1.
1764
1.77k
  if (P.size(Level) == Branch::Capacity) {
1765
456
    // Branch node is full, handle handle the overflow.
1766
456
    assert(!SplitRoot && "Cannot overflow after splitting the root");
1767
456
    SplitRoot = overflow<Branch>(Level);
1768
456
    Level += SplitRoot;
1769
456
  }
1770
1.77k
  P.node<Branch>(Level).insert(P.offset(Level), P.size(Level), Node, Stop);
1771
1.77k
  P.setSize(Level, P.size(Level) + 1);
1772
1.77k
  if (P.atLastEntry(Level))
1773
33
    setNodeStop(Level, Stop);
1774
1.77k
  P.reset(Level + 1);
1775
1.77k
  return SplitRoot;
1776
9.67k
}
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::iterator::insertNode(unsigned int, llvm::IntervalMapImpl::NodeRef, long long)
Line
Count
Source
1736
80
iterator::insertNode(unsigned Level, IntervalMapImpl::NodeRef Node, KeyT Stop) {
1737
80
  assert(Level && "Cannot insert next to the root");
1738
80
  bool SplitRoot = false;
1739
80
  IntervalMap &IM = *this->map;
1740
80
  IntervalMapImpl::Path &P = this->path;
1741
80
1742
80
  if (Level == 1) {
1743
80
    // Insert into the root branch node.
1744
80
    if (IM.rootSize < RootBranch::Capacity) {
1745
80
      IM.rootBranch().insert(P.offset(0), IM.rootSize, Node, Stop);
1746
80
      P.setSize(0, ++IM.rootSize);
1747
80
      P.reset(Level);
1748
80
      return SplitRoot;
1749
80
    }
1750
0
1751
0
    // We need to split the root while keeping our position.
1752
0
    SplitRoot = true;
1753
0
    IdxPair Offset = IM.splitRoot(P.offset(0));
1754
0
    P.replaceRoot(&IM.rootBranch(), IM.rootSize, Offset);
1755
0
1756
0
    // Fall through to insert at the new higher level.
1757
0
    ++Level;
1758
0
  }
1759
80
1760
80
  // When inserting before end(), make sure we have a valid path.
1761
80
  P.legalizeForInsert(--Level);
1762
0
1763
0
  // Insert into the branch node at Level-1.
1764
0
  if (P.size(Level) == Branch::Capacity) {
1765
0
    // Branch node is full, handle handle the overflow.
1766
0
    assert(!SplitRoot && "Cannot overflow after splitting the root");
1767
0
    SplitRoot = overflow<Branch>(Level);
1768
0
    Level += SplitRoot;
1769
0
  }
1770
0
  P.node<Branch>(Level).insert(P.offset(Level), P.size(Level), Node, Stop);
1771
0
  P.setSize(Level, P.size(Level) + 1);
1772
0
  if (P.atLastEntry(Level))
1773
0
    setNodeStop(Level, Stop);
1774
0
  P.reset(Level + 1);
1775
0
  return SplitRoot;
1776
80
}
1777
1778
// insert
1779
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1780
void IntervalMap<KeyT, ValT, N, Traits>::
1781
16.8M
iterator::insert(KeyT a, KeyT b, ValT y) {
1782
16.8M
  if (this->branched())
1783
5.13M
    return treeInsert(a, b, y);
1784
11.6M
  IntervalMap &IM = *this->map;
1785
11.6M
  IntervalMapImpl::Path &P = this->path;
1786
11.6M
1787
11.6M
  // Try simple root leaf insert.
1788
11.6M
  unsigned Size = IM.rootLeaf().insertFrom(P.leafOffset(), IM.rootSize, a, b, y);
1789
11.6M
1790
11.6M
  // Was the root node insert successful?
1791
11.6M
  if (Size <= RootLeaf::Capacity) {
1792
11.3M
    P.setSize(0, IM.rootSize = Size);
1793
11.3M
    return;
1794
11.3M
  }
1795
310k
1796
310k
  // Root leaf node is full, we must branch.
1797
310k
  IdxPair Offset = IM.branchRoot(P.leafOffset());
1798
310k
  P.replaceRoot(&IM.rootBranch(), IM.rootSize, Offset);
1799
310k
1800
310k
  // Now it fits in the new leaf.
1801
310k
  treeInsert(a, b, y);
1802
310k
}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::insert(llvm::SlotIndex, llvm::SlotIndex, DbgValueLocation)
Line
Count
Source
1781
9.67k
iterator::insert(KeyT a, KeyT b, ValT y) {
1782
9.67k
  if (this->branched())
1783
38
    return treeInsert(a, b, y);
1784
9.63k
  IntervalMap &IM = *this->map;
1785
9.63k
  IntervalMapImpl::Path &P = this->path;
1786
9.63k
1787
9.63k
  // Try simple root leaf insert.
1788
9.63k
  unsigned Size = IM.rootLeaf().insertFrom(P.leafOffset(), IM.rootSize, a, b, y);
1789
9.63k
1790
9.63k
  // Was the root node insert successful?
1791
9.63k
  if (Size <= RootLeaf::Capacity) {
1792
9.63k
    P.setSize(0, IM.rootSize = Size);
1793
9.63k
    return;
1794
9.63k
  }
1795
5
1796
5
  // Root leaf node is full, we must branch.
1797
5
  IdxPair Offset = IM.branchRoot(P.leafOffset());
1798
5
  P.replaceRoot(&IM.rootBranch(), IM.rootSize, Offset);
1799
5
1800
5
  // Now it fits in the new leaf.
1801
5
  treeInsert(a, b, y);
1802
5
}
llvm::IntervalMap<llvm::SlotIndex, llvm::LiveInterval*, 8u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::insert(llvm::SlotIndex, llvm::SlotIndex, llvm::LiveInterval*)
Line
Count
Source
1781
16.1M
iterator::insert(KeyT a, KeyT b, ValT y) {
1782
16.1M
  if (this->branched())
1783
4.49M
    return treeInsert(a, b, y);
1784
11.6M
  IntervalMap &IM = *this->map;
1785
11.6M
  IntervalMapImpl::Path &P = this->path;
1786
11.6M
1787
11.6M
  // Try simple root leaf insert.
1788
11.6M
  unsigned Size = IM.rootLeaf().insertFrom(P.leafOffset(), IM.rootSize, a, b, y);
1789
11.6M
1790
11.6M
  // Was the root node insert successful?
1791
11.6M
  if (Size <= RootLeaf::Capacity) {
1792
11.3M
    P.setSize(0, IM.rootSize = Size);
1793
11.3M
    return;
1794
11.3M
  }
1795
298k
1796
298k
  // Root leaf node is full, we must branch.
1797
298k
  IdxPair Offset = IM.branchRoot(P.leafOffset());
1798
298k
  P.replaceRoot(&IM.rootBranch(), IM.rootSize, Offset);
1799
298k
1800
298k
  // Now it fits in the new leaf.
1801
298k
  treeInsert(a, b, y);
1802
298k
}
llvm::IntervalMap<llvm::SlotIndex, unsigned int, 9u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::insert(llvm::SlotIndex, llvm::SlotIndex, unsigned int)
Line
Count
Source
1781
693k
iterator::insert(KeyT a, KeyT b, ValT y) {
1782
693k
  if (this->branched())
1783
637k
    return treeInsert(a, b, y);
1784
56.8k
  IntervalMap &IM = *this->map;
1785
56.8k
  IntervalMapImpl::Path &P = this->path;
1786
56.8k
1787
56.8k
  // Try simple root leaf insert.
1788
56.8k
  unsigned Size = IM.rootLeaf().insertFrom(P.leafOffset(), IM.rootSize, a, b, y);
1789
56.8k
1790
56.8k
  // Was the root node insert successful?
1791
56.8k
  if (Size <= RootLeaf::Capacity) {
1792
44.9k
    P.setSize(0, IM.rootSize = Size);
1793
44.9k
    return;
1794
44.9k
  }
1795
11.8k
1796
11.8k
  // Root leaf node is full, we must branch.
1797
11.8k
  IdxPair Offset = IM.branchRoot(P.leafOffset());
1798
11.8k
  P.replaceRoot(&IM.rootBranch(), IM.rootSize, Offset);
1799
11.8k
1800
11.8k
  // Now it fits in the new leaf.
1801
11.8k
  treeInsert(a, b, y);
1802
11.8k
}
DAGCombiner.cpp:llvm::IntervalMap<long long, (anonymous namespace)::UnitT, 8u, llvm::IntervalMapHalfOpenInfo<long long> >::iterator::insert(long long, long long, (anonymous namespace)::UnitT)
Line
Count
Source
1781
1.28k
iterator::insert(KeyT a, KeyT b, ValT y) {
1782
1.28k
  if (this->branched())
1783
1.07k
    return treeInsert(a, b, y);
1784
215
  IntervalMap &IM = *this->map;
1785
215
  IntervalMapImpl::Path &P = this->path;
1786
215
1787
215
  // Try simple root leaf insert.
1788
215
  unsigned Size = IM.rootLeaf().insertFrom(P.leafOffset(), IM.rootSize, a, b, y);
1789
215
1790
215
  // Was the root node insert successful?
1791
215
  if (Size <= RootLeaf::Capacity) {
1792
125
    P.setSize(0, IM.rootSize = Size);
1793
125
    return;
1794
125
  }
1795
90
1796
90
  // Root leaf node is full, we must branch.
1797
90
  IdxPair Offset = IM.branchRoot(P.leafOffset());
1798
90
  P.replaceRoot(&IM.rootBranch(), IM.rootSize, Offset);
1799
90
1800
90
  // Now it fits in the new leaf.
1801
90
  treeInsert(a, b, y);
1802
90
}
1803
1804
template <typename KeyT, typename ValT, unsigned N, typename Traits>
1805
void IntervalMap<KeyT, ValT, N, Traits>::
1806
5.44M
iterator::treeInsert(KeyT a, KeyT b, ValT y) {
1807
5.44M
  using namespace IntervalMapImpl;
1808
5.44M
  Path &P = this->path;
1809
5.44M
1810
5.44M
  if (!P.valid())
1811
948k
    P.legalizeForInsert(this->map->height);
1812
5.44M
1813
5.44M
  // Check if this insertion will extend the node to the left.
1814
5.44M
  if (P.leafOffset() == 0 && 
Traits::startLess(a, P.leaf<Leaf>().start(0))393k
) {
1815
393k
    // Node is growing to the left, will it affect a left sibling node?
1816
393k
    if (NodeRef Sib = P.getLeftSibling(P.height())) {
1817
296k
      Leaf &SibLeaf = Sib.get<Leaf>();
1818
296k
      unsigned SibOfs = Sib.size() - 1;
1819
296k
      if (SibLeaf.value(SibOfs) == y &&
1820
296k
          
Traits::adjacent(SibLeaf.stop(SibOfs), a)100k
) {
1821
57.7k
        // This insertion will coalesce with the last entry in SibLeaf. We can
1822
57.7k
        // handle it in two ways:
1823
57.7k
        //  1. Extend SibLeaf.stop to b and be done, or
1824
57.7k
        //  2. Extend a to SibLeaf, erase the SibLeaf entry and continue.
1825
57.7k
        // We prefer 1., but need 2 when coalescing to the right as well.
1826
57.7k
        Leaf &CurLeaf = P.leaf<Leaf>();
1827
57.7k
        P.moveLeft(P.height());
1828
57.7k
        if (Traits::stopLess(b, CurLeaf.start(0)) &&
1829
57.7k
            (y != CurLeaf.value(0) || 
!Traits::adjacent(b, CurLeaf.start(0))39.8k
)) {
1830
40.1k
          // Easy, just extend SibLeaf and we're done.
1831
40.1k
          setNodeStop(P.height(), SibLeaf.stop(SibOfs) = b);
1832
40.1k
          return;
1833
40.1k
        } else {
1834
17.5k
          // We have both left and right coalescing. Erase the old SibLeaf entry
1835
17.5k
          // and continue inserting the larger interval.
1836
17.5k
          a = SibLeaf.start(SibOfs);
1837
17.5k
          treeErase(/* UpdateRoot= */false);
1838
17.5k
        }
1839
57.7k
      }
1840
296k
    } else {
1841
97.2k
      // No left sibling means we are at begin(). Update cached bound.
1842
97.2k
      this->map->rootBranchStart() = a;
1843
97.2k
    }
1844
393k
  }
1845
5.44M
1846
5.44M
  // When we are inserting at the end of a leaf node, we must update stops.
1847
5.44M
  unsigned Size = P.leafSize();
1848
5.40M
  bool Grow = P.leafOffset() == Size;
1849
5.40M
  Size = P.leaf<Leaf>().insertFrom(P.leafOffset(), Size, a, b, y);
1850
5.40M
1851
5.40M
  // Leaf insertion unsuccessful? Overflow and try again.
1852
5.40M
  if (Size > Leaf::Capacity) {
1853
1.21M
    overflow<Leaf>(P.height());
1854
1.21M
    Grow = P.leafOffset() == P.leafSize();
1855
1.21M
    Size = P.leaf<Leaf>().insertFrom(P.leafOffset(), P.leafSize(), a, b, y);
1856
1.21M
    assert(Size <= Leaf::Capacity && "overflow() didn't make room");
1857
1.21M
  }
1858
5.40M
1859
5.40M
  // Inserted, update offset and leaf size.
1860
5.40M
  P.setSize(P.height(), Size);
1861
5.40M
1862
5.40M
  // Insert was the last node entry, update stops.
1863
5.40M
  if (Grow)
1864
1.14M
    setNodeStop(P.height(), b);
1865
5.40M
}
llvm::IntervalMap<llvm::SlotIndex, DbgValueLocation, 4u, llvm::IntervalMapInfo<llvm::SlotIndex> >::iterator::treeInsert(llvm::SlotIndex, llvm::SlotIndex, DbgValueLocation)
Line
Count
Source
1806
43
iterator::treeInsert(KeyT a, KeyT b, ValT y) {
1807
43
  using namespace IntervalMapImpl;
1808
43
  Path &P = this->path;
1809
43
1810
43
  if (!P.valid())
1811
11
    P.legalizeForInsert(this->map->height);
1812
43
1813
43
  // Check if this insertion will extend the node to the left.
1814
43
  if (P.leafOffset() == 0 && 
Traits::startLess(a, P.leaf<Leaf>().start(0))0
) {
1815
0
    // Node is growing to the left, will it affect a left sibling node?
1816
0
    if (NodeRef Sib = P.getLeftSibling(P.height())) {
1817
0
      Leaf &SibLeaf = Sib.get<Leaf>();
1818
0
      unsigned SibOfs = Sib.size() - 1;
1819
0
      if (SibLeaf.value(SibOfs) == y &&
1820
0
          Traits::adjacent(SibLeaf.stop(SibOfs), a)) {
1821
0
        // This insertion will coalesce with the last entry in SibLeaf. We can
1822
0
        // handle it in two ways:
1823
0
        //  1. Extend SibLeaf.stop to b and be done, or
1824
0
        //  2. Extend a to SibLeaf, erase the SibLeaf entry and continue.
1825
0
        // We prefer 1., but need 2 when coalescing to the right as well.
1826
0
        Leaf &CurLeaf = P.leaf<Leaf>();
1827
0
        P.moveLeft(P.height());
1828
0
        if (Traits::stopLess(b, CurLeaf.start(0)) &&
1829
0
            (y != CurLeaf.value(0) || !Traits::adjacent(b, CurLeaf.start(0)))) {
1830
0
          // Easy, just extend SibLeaf and we're done.
1831
0
          setNodeStop(P.height(), SibLeaf.stop(SibOfs) = b);
1832
0
          return;
1833
0
        } else {
1834
0
          // We have both left and right coalescing. Erase the old SibLeaf entry
1835
0
          // and continue inserting the larger interval.
1836
0
          a = SibLeaf.start(SibOfs);
1837
0
          treeErase(/* UpdateRoot= */false);
1838
0
        }
1839
0
      }
1840
0
    } else {
1841
0
      // No left sibling means we are at begin(). Update cached bound.
1842
0
      this->map->rootBranchStart() = a;
1843
0
    }
1844
0
  }
1845
43
1846
43
  // When we are inserting at the end of a leaf node, we must update stops.
1847
43
  unsigned Size = P.leafSize();
1848
43
  bool Grow = P.leafOffset() == Size;
1849
43
  Size = P.leaf<Leaf>().insertFrom(P.leafOffset(), Size, a, b, y);
1850
43
1851
43
  // Leaf insertion unsuccessful? Overflow and try again.
1852
43
  if (Size > Leaf::Capacity) {
1853
0
    overflow<Leaf>(P.height());
1854
0
    Grow = P.leafOffset() == P.leafSize();
1855
0
    Size = P.leaf<Leaf>().insertFrom(P.leafOffset(), P.leafSize(), a, b, y);
1856
0
    assert(Size <= Leaf::Capacity && "overflow() didn't make room");
1857
0
  }
1858
43
1859
43
  // Inserted, update offset and leaf size.
1860
43
  P.setSize(P.height(), Size);
1861
4