Add SlotIndexes::repairIndexesInRange(), which repairs SlotIndexes after adding
[oota-llvm.git] / include / llvm / CodeGen / SlotIndexes.h
1 //===- llvm/CodeGen/SlotIndexes.h - Slot indexes representation -*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements SlotIndex and related classes. The purpose of SlotIndex
11 // is to describe a position at which a register can become live, or cease to
12 // be live.
13 //
14 // SlotIndex is mostly a proxy for entries of the SlotIndexList, a class which
15 // is held is LiveIntervals and provides the real numbering. This allows
16 // LiveIntervals to perform largely transparent renumbering.
17 //===----------------------------------------------------------------------===//
18
19 #ifndef LLVM_CODEGEN_SLOTINDEXES_H
20 #define LLVM_CODEGEN_SLOTINDEXES_H
21
22 #include "llvm/ADT/DenseMap.h"
23 #include "llvm/ADT/IntervalMap.h"
24 #include "llvm/ADT/PointerIntPair.h"
25 #include "llvm/ADT/SmallVector.h"
26 #include "llvm/ADT/ilist.h"
27 #include "llvm/CodeGen/MachineFunction.h"
28 #include "llvm/CodeGen/MachineFunctionPass.h"
29 #include "llvm/CodeGen/MachineInstrBundle.h"
30 #include "llvm/Support/Allocator.h"
31
32 namespace llvm {
33
34   /// This class represents an entry in the slot index list held in the
35   /// SlotIndexes pass. It should not be used directly. See the
36   /// SlotIndex & SlotIndexes classes for the public interface to this
37   /// information.
38   class IndexListEntry : public ilist_node<IndexListEntry> {
39     MachineInstr *mi;
40     unsigned index;
41
42   public:
43
44     IndexListEntry(MachineInstr *mi, unsigned index) : mi(mi), index(index) {}
45
46     MachineInstr* getInstr() const { return mi; }
47     void setInstr(MachineInstr *mi) {
48       this->mi = mi;
49     }
50
51     unsigned getIndex() const { return index; }
52     void setIndex(unsigned index) {
53       this->index = index;
54     }
55
56   };
57
58   template <>
59   struct ilist_traits<IndexListEntry> : public ilist_default_traits<IndexListEntry> {
60   private:
61     mutable ilist_half_node<IndexListEntry> Sentinel;
62   public:
63     IndexListEntry *createSentinel() const {
64       return static_cast<IndexListEntry*>(&Sentinel);
65     }
66     void destroySentinel(IndexListEntry *) const {}
67
68     IndexListEntry *provideInitialHead() const { return createSentinel(); }
69     IndexListEntry *ensureHead(IndexListEntry*) const { return createSentinel(); }
70     static void noteHead(IndexListEntry*, IndexListEntry*) {}
71     void deleteNode(IndexListEntry *N) {}
72
73   private:
74     void createNode(const IndexListEntry &);
75   };
76
77   /// SlotIndex - An opaque wrapper around machine indexes.
78   class SlotIndex {
79     friend class SlotIndexes;
80
81     enum Slot {
82       /// Basic block boundary.  Used for live ranges entering and leaving a
83       /// block without being live in the layout neighbor.  Also used as the
84       /// def slot of PHI-defs.
85       Slot_Block,
86
87       /// Early-clobber register use/def slot.  A live range defined at
88       /// Slot_EarlyCLobber interferes with normal live ranges killed at
89       /// Slot_Register.  Also used as the kill slot for live ranges tied to an
90       /// early-clobber def.
91       Slot_EarlyClobber,
92
93       /// Normal register use/def slot.  Normal instructions kill and define
94       /// register live ranges at this slot.
95       Slot_Register,
96
97       /// Dead def kill point.  Kill slot for a live range that is defined by
98       /// the same instruction (Slot_Register or Slot_EarlyClobber), but isn't
99       /// used anywhere.
100       Slot_Dead,
101
102       Slot_Count
103     };
104
105     PointerIntPair<IndexListEntry*, 2, unsigned> lie;
106
107     SlotIndex(IndexListEntry *entry, unsigned slot)
108       : lie(entry, slot) {}
109
110     IndexListEntry* listEntry() const {
111       assert(isValid() && "Attempt to compare reserved index.");
112       return lie.getPointer();
113     }
114
115     unsigned getIndex() const {
116       return listEntry()->getIndex() | getSlot();
117     }
118
119     /// Returns the slot for this SlotIndex.
120     Slot getSlot() const {
121       return static_cast<Slot>(lie.getInt());
122     }
123
124   public:
125     enum {
126       /// The default distance between instructions as returned by distance().
127       /// This may vary as instructions are inserted and removed.
128       InstrDist = 4 * Slot_Count
129     };
130
131     /// Construct an invalid index.
132     SlotIndex() : lie(0, 0) {}
133
134     // Construct a new slot index from the given one, and set the slot.
135     SlotIndex(const SlotIndex &li, Slot s) : lie(li.listEntry(), unsigned(s)) {
136       assert(lie.getPointer() != 0 &&
137              "Attempt to construct index with 0 pointer.");
138     }
139
140     /// Returns true if this is a valid index. Invalid indicies do
141     /// not point into an index table, and cannot be compared.
142     bool isValid() const {
143       return lie.getPointer();
144     }
145
146     /// Return true for a valid index.
147     operator bool() const { return isValid(); }
148
149     /// Print this index to the given raw_ostream.
150     void print(raw_ostream &os) const;
151
152     /// Dump this index to stderr.
153     void dump() const;
154
155     /// Compare two SlotIndex objects for equality.
156     bool operator==(SlotIndex other) const {
157       return lie == other.lie;
158     }
159     /// Compare two SlotIndex objects for inequality.
160     bool operator!=(SlotIndex other) const {
161       return lie != other.lie;
162     }
163
164     /// Compare two SlotIndex objects. Return true if the first index
165     /// is strictly lower than the second.
166     bool operator<(SlotIndex other) const {
167       return getIndex() < other.getIndex();
168     }
169     /// Compare two SlotIndex objects. Return true if the first index
170     /// is lower than, or equal to, the second.
171     bool operator<=(SlotIndex other) const {
172       return getIndex() <= other.getIndex();
173     }
174
175     /// Compare two SlotIndex objects. Return true if the first index
176     /// is greater than the second.
177     bool operator>(SlotIndex other) const {
178       return getIndex() > other.getIndex();
179     }
180
181     /// Compare two SlotIndex objects. Return true if the first index
182     /// is greater than, or equal to, the second.
183     bool operator>=(SlotIndex other) const {
184       return getIndex() >= other.getIndex();
185     }
186
187     /// isSameInstr - Return true if A and B refer to the same instruction.
188     static bool isSameInstr(SlotIndex A, SlotIndex B) {
189       return A.lie.getPointer() == B.lie.getPointer();
190     }
191
192     /// isEarlierInstr - Return true if A refers to an instruction earlier than
193     /// B. This is equivalent to A < B && !isSameInstr(A, B).
194     static bool isEarlierInstr(SlotIndex A, SlotIndex B) {
195       return A.listEntry()->getIndex() < B.listEntry()->getIndex();
196     }
197
198     /// Return the distance from this index to the given one.
199     int distance(SlotIndex other) const {
200       return other.getIndex() - getIndex();
201     }
202
203     /// isBlock - Returns true if this is a block boundary slot.
204     bool isBlock() const { return getSlot() == Slot_Block; }
205
206     /// isEarlyClobber - Returns true if this is an early-clobber slot.
207     bool isEarlyClobber() const { return getSlot() == Slot_EarlyClobber; }
208
209     /// isRegister - Returns true if this is a normal register use/def slot.
210     /// Note that early-clobber slots may also be used for uses and defs.
211     bool isRegister() const { return getSlot() == Slot_Register; }
212
213     /// isDead - Returns true if this is a dead def kill slot.
214     bool isDead() const { return getSlot() == Slot_Dead; }
215
216     /// Returns the base index for associated with this index. The base index
217     /// is the one associated with the Slot_Block slot for the instruction
218     /// pointed to by this index.
219     SlotIndex getBaseIndex() const {
220       return SlotIndex(listEntry(), Slot_Block);
221     }
222
223     /// Returns the boundary index for associated with this index. The boundary
224     /// index is the one associated with the Slot_Block slot for the instruction
225     /// pointed to by this index.
226     SlotIndex getBoundaryIndex() const {
227       return SlotIndex(listEntry(), Slot_Dead);
228     }
229
230     /// Returns the register use/def slot in the current instruction for a
231     /// normal or early-clobber def.
232     SlotIndex getRegSlot(bool EC = false) const {
233       return SlotIndex(listEntry(), EC ? Slot_EarlyClobber : Slot_Register);
234     }
235
236     /// Returns the dead def kill slot for the current instruction.
237     SlotIndex getDeadSlot() const {
238       return SlotIndex(listEntry(), Slot_Dead);
239     }
240
241     /// Returns the next slot in the index list. This could be either the
242     /// next slot for the instruction pointed to by this index or, if this
243     /// index is a STORE, the first slot for the next instruction.
244     /// WARNING: This method is considerably more expensive than the methods
245     /// that return specific slots (getUseIndex(), etc). If you can - please
246     /// use one of those methods.
247     SlotIndex getNextSlot() const {
248       Slot s = getSlot();
249       if (s == Slot_Dead) {
250         return SlotIndex(listEntry()->getNextNode(), Slot_Block);
251       }
252       return SlotIndex(listEntry(), s + 1);
253     }
254
255     /// Returns the next index. This is the index corresponding to the this
256     /// index's slot, but for the next instruction.
257     SlotIndex getNextIndex() const {
258       return SlotIndex(listEntry()->getNextNode(), getSlot());
259     }
260
261     /// Returns the previous slot in the index list. This could be either the
262     /// previous slot for the instruction pointed to by this index or, if this
263     /// index is a Slot_Block, the last slot for the previous instruction.
264     /// WARNING: This method is considerably more expensive than the methods
265     /// that return specific slots (getUseIndex(), etc). If you can - please
266     /// use one of those methods.
267     SlotIndex getPrevSlot() const {
268       Slot s = getSlot();
269       if (s == Slot_Block) {
270         return SlotIndex(listEntry()->getPrevNode(), Slot_Dead);
271       }
272       return SlotIndex(listEntry(), s - 1);
273     }
274
275     /// Returns the previous index. This is the index corresponding to this
276     /// index's slot, but for the previous instruction.
277     SlotIndex getPrevIndex() const {
278       return SlotIndex(listEntry()->getPrevNode(), getSlot());
279     }
280
281   };
282
283   template <> struct isPodLike<SlotIndex> { static const bool value = true; };
284
285
286   inline raw_ostream& operator<<(raw_ostream &os, SlotIndex li) {
287     li.print(os);
288     return os;
289   }
290
291   typedef std::pair<SlotIndex, MachineBasicBlock*> IdxMBBPair;
292
293   inline bool operator<(SlotIndex V, const IdxMBBPair &IM) {
294     return V < IM.first;
295   }
296
297   inline bool operator<(const IdxMBBPair &IM, SlotIndex V) {
298     return IM.first < V;
299   }
300
301   struct Idx2MBBCompare {
302     bool operator()(const IdxMBBPair &LHS, const IdxMBBPair &RHS) const {
303       return LHS.first < RHS.first;
304     }
305   };
306
307   /// SlotIndexes pass.
308   ///
309   /// This pass assigns indexes to each instruction.
310   class SlotIndexes : public MachineFunctionPass {
311   private:
312
313     typedef ilist<IndexListEntry> IndexList;
314     IndexList indexList;
315
316     MachineFunction *mf;
317
318     typedef DenseMap<const MachineInstr*, SlotIndex> Mi2IndexMap;
319     Mi2IndexMap mi2iMap;
320
321     /// MBBRanges - Map MBB number to (start, stop) indexes.
322     SmallVector<std::pair<SlotIndex, SlotIndex>, 8> MBBRanges;
323
324     /// Idx2MBBMap - Sorted list of pairs of index of first instruction
325     /// and MBB id.
326     SmallVector<IdxMBBPair, 8> idx2MBBMap;
327
328     // IndexListEntry allocator.
329     BumpPtrAllocator ileAllocator;
330
331     IndexListEntry* createEntry(MachineInstr *mi, unsigned index) {
332       IndexListEntry *entry =
333         static_cast<IndexListEntry*>(
334           ileAllocator.Allocate(sizeof(IndexListEntry),
335           alignOf<IndexListEntry>()));
336
337       new (entry) IndexListEntry(mi, index);
338
339       return entry;
340     }
341
342     /// Renumber locally after inserting curItr.
343     void renumberIndexes(IndexList::iterator curItr);
344
345   public:
346     static char ID;
347
348     SlotIndexes() : MachineFunctionPass(ID) {
349       initializeSlotIndexesPass(*PassRegistry::getPassRegistry());
350     }
351
352     virtual void getAnalysisUsage(AnalysisUsage &au) const;
353     virtual void releaseMemory();
354
355     virtual bool runOnMachineFunction(MachineFunction &fn);
356
357     /// Dump the indexes.
358     void dump() const;
359
360     /// Renumber the index list, providing space for new instructions.
361     void renumberIndexes();
362
363     /// Repair indexes after adding and removing instructions.
364     void repairIndexesInRange(MachineBasicBlock *MBB,
365                               MachineBasicBlock::iterator Begin,
366                               MachineBasicBlock::iterator End);
367
368     /// Returns the zero index for this analysis.
369     SlotIndex getZeroIndex() {
370       assert(indexList.front().getIndex() == 0 && "First index is not 0?");
371       return SlotIndex(&indexList.front(), 0);
372     }
373
374     /// Returns the base index of the last slot in this analysis.
375     SlotIndex getLastIndex() {
376       return SlotIndex(&indexList.back(), 0);
377     }
378
379     /// Returns true if the given machine instr is mapped to an index,
380     /// otherwise returns false.
381     bool hasIndex(const MachineInstr *instr) const {
382       return mi2iMap.count(instr);
383     }
384
385     /// Returns the base index for the given instruction.
386     SlotIndex getInstructionIndex(const MachineInstr *MI) const {
387       // Instructions inside a bundle have the same number as the bundle itself.
388       Mi2IndexMap::const_iterator itr = mi2iMap.find(getBundleStart(MI));
389       assert(itr != mi2iMap.end() && "Instruction not found in maps.");
390       return itr->second;
391     }
392
393     /// Returns the instruction for the given index, or null if the given
394     /// index has no instruction associated with it.
395     MachineInstr* getInstructionFromIndex(SlotIndex index) const {
396       return index.isValid() ? index.listEntry()->getInstr() : 0;
397     }
398
399     /// Returns the next non-null index.
400     SlotIndex getNextNonNullIndex(SlotIndex index) {
401       IndexList::iterator itr(index.listEntry());
402       ++itr;
403       while (itr != indexList.end() && itr->getInstr() == 0) { ++itr; }
404       return SlotIndex(itr, index.getSlot());
405     }
406
407     /// getIndexBefore - Returns the index of the last indexed instruction
408     /// before MI, or the start index of its basic block.
409     /// MI is not required to have an index.
410     SlotIndex getIndexBefore(const MachineInstr *MI) const {
411       const MachineBasicBlock *MBB = MI->getParent();
412       assert(MBB && "MI must be inserted inna basic block");
413       MachineBasicBlock::const_iterator I = MI, B = MBB->begin();
414       for (;;) {
415         if (I == B)
416           return getMBBStartIdx(MBB);
417         --I;
418         Mi2IndexMap::const_iterator MapItr = mi2iMap.find(I);
419         if (MapItr != mi2iMap.end())
420           return MapItr->second;
421       }
422     }
423
424     /// getIndexAfter - Returns the index of the first indexed instruction
425     /// after MI, or the end index of its basic block.
426     /// MI is not required to have an index.
427     SlotIndex getIndexAfter(const MachineInstr *MI) const {
428       const MachineBasicBlock *MBB = MI->getParent();
429       assert(MBB && "MI must be inserted inna basic block");
430       MachineBasicBlock::const_iterator I = MI, E = MBB->end();
431       for (;;) {
432         ++I;
433         if (I == E)
434           return getMBBEndIdx(MBB);
435         Mi2IndexMap::const_iterator MapItr = mi2iMap.find(I);
436         if (MapItr != mi2iMap.end())
437           return MapItr->second;
438       }
439     }
440
441     /// Return the (start,end) range of the given basic block number.
442     const std::pair<SlotIndex, SlotIndex> &
443     getMBBRange(unsigned Num) const {
444       return MBBRanges[Num];
445     }
446
447     /// Return the (start,end) range of the given basic block.
448     const std::pair<SlotIndex, SlotIndex> &
449     getMBBRange(const MachineBasicBlock *MBB) const {
450       return getMBBRange(MBB->getNumber());
451     }
452
453     /// Returns the first index in the given basic block number.
454     SlotIndex getMBBStartIdx(unsigned Num) const {
455       return getMBBRange(Num).first;
456     }
457
458     /// Returns the first index in the given basic block.
459     SlotIndex getMBBStartIdx(const MachineBasicBlock *mbb) const {
460       return getMBBRange(mbb).first;
461     }
462
463     /// Returns the last index in the given basic block number.
464     SlotIndex getMBBEndIdx(unsigned Num) const {
465       return getMBBRange(Num).second;
466     }
467
468     /// Returns the last index in the given basic block.
469     SlotIndex getMBBEndIdx(const MachineBasicBlock *mbb) const {
470       return getMBBRange(mbb).second;
471     }
472
473     /// Returns the basic block which the given index falls in.
474     MachineBasicBlock* getMBBFromIndex(SlotIndex index) const {
475       if (MachineInstr *MI = getInstructionFromIndex(index))
476         return MI->getParent();
477       SmallVectorImpl<IdxMBBPair>::const_iterator I =
478         std::lower_bound(idx2MBBMap.begin(), idx2MBBMap.end(), index);
479       // Take the pair containing the index
480       SmallVectorImpl<IdxMBBPair>::const_iterator J =
481         ((I != idx2MBBMap.end() && I->first > index) ||
482          (I == idx2MBBMap.end() && idx2MBBMap.size()>0)) ? (I-1): I;
483
484       assert(J != idx2MBBMap.end() && J->first <= index &&
485              index < getMBBEndIdx(J->second) &&
486              "index does not correspond to an MBB");
487       return J->second;
488     }
489
490     bool findLiveInMBBs(SlotIndex start, SlotIndex end,
491                         SmallVectorImpl<MachineBasicBlock*> &mbbs) const {
492       SmallVectorImpl<IdxMBBPair>::const_iterator itr =
493         std::lower_bound(idx2MBBMap.begin(), idx2MBBMap.end(), start);
494       bool resVal = false;
495
496       while (itr != idx2MBBMap.end()) {
497         if (itr->first >= end)
498           break;
499         mbbs.push_back(itr->second);
500         resVal = true;
501         ++itr;
502       }
503       return resVal;
504     }
505
506     /// Returns the MBB covering the given range, or null if the range covers
507     /// more than one basic block.
508     MachineBasicBlock* getMBBCoveringRange(SlotIndex start, SlotIndex end) const {
509
510       assert(start < end && "Backwards ranges not allowed.");
511
512       SmallVectorImpl<IdxMBBPair>::const_iterator itr =
513         std::lower_bound(idx2MBBMap.begin(), idx2MBBMap.end(), start);
514
515       if (itr == idx2MBBMap.end()) {
516         itr = prior(itr);
517         return itr->second;
518       }
519
520       // Check that we don't cross the boundary into this block.
521       if (itr->first < end)
522         return 0;
523
524       itr = prior(itr);
525
526       if (itr->first <= start)
527         return itr->second;
528
529       return 0;
530     }
531
532     /// Insert the given machine instruction into the mapping. Returns the
533     /// assigned index.
534     /// If Late is set and there are null indexes between mi's neighboring
535     /// instructions, create the new index after the null indexes instead of
536     /// before them.
537     SlotIndex insertMachineInstrInMaps(MachineInstr *mi, bool Late = false) {
538       assert(!mi->isInsideBundle() &&
539              "Instructions inside bundles should use bundle start's slot.");
540       assert(mi2iMap.find(mi) == mi2iMap.end() && "Instr already indexed.");
541       // Numbering DBG_VALUE instructions could cause code generation to be
542       // affected by debug information.
543       assert(!mi->isDebugValue() && "Cannot number DBG_VALUE instructions.");
544
545       assert(mi->getParent() != 0 && "Instr must be added to function.");
546
547       // Get the entries where mi should be inserted.
548       IndexList::iterator prevItr, nextItr;
549       if (Late) {
550         // Insert mi's index immediately before the following instruction.
551         nextItr = getIndexAfter(mi).listEntry();
552         prevItr = prior(nextItr);
553       } else {
554         // Insert mi's index immediately after the preceding instruction.
555         prevItr = getIndexBefore(mi).listEntry();
556         nextItr = llvm::next(prevItr);
557       }
558
559       // Get a number for the new instr, or 0 if there's no room currently.
560       // In the latter case we'll force a renumber later.
561       unsigned dist = ((nextItr->getIndex() - prevItr->getIndex())/2) & ~3u;
562       unsigned newNumber = prevItr->getIndex() + dist;
563
564       // Insert a new list entry for mi.
565       IndexList::iterator newItr =
566         indexList.insert(nextItr, createEntry(mi, newNumber));
567
568       // Renumber locally if we need to.
569       if (dist == 0)
570         renumberIndexes(newItr);
571
572       SlotIndex newIndex(&*newItr, SlotIndex::Slot_Block);
573       mi2iMap.insert(std::make_pair(mi, newIndex));
574       return newIndex;
575     }
576
577     /// Remove the given machine instruction from the mapping.
578     void removeMachineInstrFromMaps(MachineInstr *mi) {
579       // remove index -> MachineInstr and
580       // MachineInstr -> index mappings
581       Mi2IndexMap::iterator mi2iItr = mi2iMap.find(mi);
582       if (mi2iItr != mi2iMap.end()) {
583         IndexListEntry *miEntry(mi2iItr->second.listEntry());
584         assert(miEntry->getInstr() == mi && "Instruction indexes broken.");
585         // FIXME: Eventually we want to actually delete these indexes.
586         miEntry->setInstr(0);
587         mi2iMap.erase(mi2iItr);
588       }
589     }
590
591     /// ReplaceMachineInstrInMaps - Replacing a machine instr with a new one in
592     /// maps used by register allocator.
593     void replaceMachineInstrInMaps(MachineInstr *mi, MachineInstr *newMI) {
594       Mi2IndexMap::iterator mi2iItr = mi2iMap.find(mi);
595       if (mi2iItr == mi2iMap.end())
596         return;
597       SlotIndex replaceBaseIndex = mi2iItr->second;
598       IndexListEntry *miEntry(replaceBaseIndex.listEntry());
599       assert(miEntry->getInstr() == mi &&
600              "Mismatched instruction in index tables.");
601       miEntry->setInstr(newMI);
602       mi2iMap.erase(mi2iItr);
603       mi2iMap.insert(std::make_pair(newMI, replaceBaseIndex));
604     }
605
606     /// Add the given MachineBasicBlock into the maps.
607     void insertMBBInMaps(MachineBasicBlock *mbb) {
608       MachineFunction::iterator nextMBB =
609         llvm::next(MachineFunction::iterator(mbb));
610
611       IndexListEntry *startEntry = 0;
612       IndexListEntry *endEntry = 0;
613       IndexList::iterator newItr;
614       if (nextMBB == mbb->getParent()->end()) {
615         startEntry = &indexList.back();
616         endEntry = createEntry(0, 0);
617         newItr = indexList.insertAfter(startEntry, endEntry);
618       } else {
619         startEntry = createEntry(0, 0);
620         endEntry = getMBBStartIdx(nextMBB).listEntry();
621         newItr = indexList.insert(endEntry, startEntry);
622       }
623
624       SlotIndex startIdx(startEntry, SlotIndex::Slot_Block);
625       SlotIndex endIdx(endEntry, SlotIndex::Slot_Block);
626
627       MachineFunction::iterator prevMBB(mbb);
628       assert(prevMBB != mbb->getParent()->end() &&
629              "Can't insert a new block at the beginning of a function.");
630       --prevMBB;
631       MBBRanges[prevMBB->getNumber()].second = startIdx;
632
633       assert(unsigned(mbb->getNumber()) == MBBRanges.size() &&
634              "Blocks must be added in order");
635       MBBRanges.push_back(std::make_pair(startIdx, endIdx));
636       idx2MBBMap.push_back(IdxMBBPair(startIdx, mbb));
637
638       renumberIndexes(newItr);
639       std::sort(idx2MBBMap.begin(), idx2MBBMap.end(), Idx2MBBCompare());
640     }
641
642   };
643
644
645   // Specialize IntervalMapInfo for half-open slot index intervals.
646   template <>
647   struct IntervalMapInfo<SlotIndex> : IntervalMapHalfOpenInfo<SlotIndex> {
648   };
649
650 }
651
652 #endif // LLVM_CODEGEN_SLOTINDEXES_H