Lines Matching defs:SlotIndex

10 // This file implements SlotIndex and related classes. The purpose of SlotIndex
14 // SlotIndex is mostly a proxy for entries of the SlotIndexList, a class which
36 /// SlotIndex & SlotIndexes classes for the public interface to this
59 // poisoned, so that dangling SlotIndex access can be reliably detected.
91 /// SlotIndex - An opaque wrapper around machine indexes.
92 class SlotIndex {
121 SlotIndex(IndexListEntry *entry, unsigned slot)
137 /// Returns the slot for this SlotIndex.
150 SlotIndex() : lie(nullptr, 0) {}
153 SlotIndex(const SlotIndex &li, Slot s) : lie(li.listEntry(), unsigned(s)) {
173 /// Compare two SlotIndex objects for equality.
174 bool operator==(SlotIndex other) const {
177 /// Compare two SlotIndex objects for inequality.
178 bool operator!=(SlotIndex other) const {
182 /// Compare two SlotIndex objects. Return true if the first index
184 bool operator<(SlotIndex other) const {
187 /// Compare two SlotIndex objects. Return true if the first index
189 bool operator<=(SlotIndex other) const {
193 /// Compare two SlotIndex objects. Return true if the first index
195 bool operator>(SlotIndex other) const {
199 /// Compare two SlotIndex objects. Return true if the first index
201 bool operator>=(SlotIndex other) const {
206 static bool isSameInstr(SlotIndex A, SlotIndex B) {
212 static bool isEarlierInstr(SlotIndex A, SlotIndex B) {
217 int distance(SlotIndex other) const {
223 int getInstrDistance(SlotIndex other) const {
244 SlotIndex getBaseIndex() const {
245 return SlotIndex(listEntry(), Slot_Block);
251 SlotIndex getBoundaryIndex() const {
252 return SlotIndex(listEntry(), Slot_Dead);
257 SlotIndex getRegSlot(bool EC = false) const {
258 return SlotIndex(listEntry(), EC ? Slot_EarlyClobber : Slot_Register);
262 SlotIndex getDeadSlot() const {
263 return SlotIndex(listEntry(), Slot_Dead);
272 SlotIndex getNextSlot() const {
275 return SlotIndex(&*++listEntry()->getIterator(), Slot_Block);
277 return SlotIndex(listEntry(), s + 1);
282 SlotIndex getNextIndex() const {
283 return SlotIndex(&*++listEntry()->getIterator(), getSlot());
292 SlotIndex getPrevSlot() const {
295 return SlotIndex(&*--listEntry()->getIterator(), Slot_Dead);
297 return SlotIndex(listEntry(), s - 1);
302 SlotIndex getPrevIndex() const {
303 return SlotIndex(&*--listEntry()->getIterator(), getSlot());
308 template <> struct isPodLike<SlotIndex> { static const bool value = true; };
310 inline raw_ostream& operator<<(raw_ostream &os, SlotIndex li) {
315 typedef std::pair<SlotIndex, MachineBasicBlock*> IdxMBBPair;
317 inline bool operator<(SlotIndex V, const IdxMBBPair &IM) {
321 inline bool operator<(const IdxMBBPair &IM, SlotIndex V) {
348 typedef DenseMap<const MachineInstr*, SlotIndex> Mi2IndexMap;
352 SmallVector<std::pair<SlotIndex, SlotIndex>, 8> MBBRanges;
401 SlotIndex getZeroIndex() {
403 return SlotIndex(&indexList.front(), 0);
407 SlotIndex getLastIndex() {
408 return SlotIndex(&indexList.back(), 0);
418 SlotIndex getInstructionIndex(const MachineInstr *MI) const {
427 MachineInstr* getInstructionFromIndex(SlotIndex index) const {
433 SlotIndex getNextNonNullIndex(SlotIndex Index) {
438 return SlotIndex(&*I, Index.getSlot());
446 SlotIndex getIndexBefore(const MachineInstr *MI) const {
463 SlotIndex getIndexAfter(const MachineInstr *MI) const {
478 const std::pair<SlotIndex, SlotIndex> &
484 const std::pair<SlotIndex, SlotIndex> &
490 SlotIndex getMBBStartIdx(unsigned Num) const {
495 SlotIndex getMBBStartIdx(const MachineBasicBlock *mbb) const {
500 SlotIndex getMBBEndIdx(unsigned Num) const {
505 SlotIndex getMBBEndIdx(const MachineBasicBlock *mbb) const {
512 /// Move iterator to the next IdxMBBPair where the SlotIndex is greater or
514 MBBIndexIterator advanceMBBIndex(MBBIndexIterator I, SlotIndex To) const {
517 /// Get an iterator pointing to the IdxMBBPair with the biggest SlotIndex
519 MBBIndexIterator findMBBIndex(SlotIndex Idx) const {
532 MachineBasicBlock* getMBBFromIndex(SlotIndex index) const {
550 MachineBasicBlock* getMBBCoveringRange(SlotIndex start, SlotIndex end) const {
576 SlotIndex insertMachineInstrInMaps(MachineInstr *mi, bool Late = false) {
611 SlotIndex newIndex(&*newItr, SlotIndex::Slot_Block);
636 SlotIndex replaceBaseIndex = mi2iItr->second;
663 SlotIndex startIdx(startEntry, SlotIndex::Slot_Block);
664 SlotIndex endIdx(endEntry, SlotIndex::Slot_Block);
681 /// \brief Free the resources that were required to maintain a SlotIndex.
686 /// performance. Any remaining SlotIndex objects that point to the same
692 /// previously pointed to has been re-used. To detect dangling SlotIndex
696 void eraseIndex(SlotIndex index) {
712 struct IntervalMapInfo<SlotIndex> : IntervalMapHalfOpenInfo<SlotIndex> {