Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:29

0001 //===- LiveIntervals.h - Live Interval Analysis -----------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 /// \file This file implements the LiveInterval analysis pass.  Given some
0010 /// numbering of each the machine instructions (in this implemention depth-first
0011 /// order) an interval [i, j) is said to be a live interval for register v if
0012 /// there is no instruction with number j' > j such that v is live at j' and
0013 /// there is no instruction with number i' < i such that v is live at i'. In
0014 /// this implementation intervals can have holes, i.e. an interval might look
0015 /// like [1,20), [50,65), [1000,1001).
0016 //
0017 //===----------------------------------------------------------------------===//
0018 
0019 #ifndef LLVM_CODEGEN_LIVEINTERVALS_H
0020 #define LLVM_CODEGEN_LIVEINTERVALS_H
0021 
0022 #include "llvm/ADT/ArrayRef.h"
0023 #include "llvm/ADT/IndexedMap.h"
0024 #include "llvm/ADT/SmallVector.h"
0025 #include "llvm/CodeGen/LiveInterval.h"
0026 #include "llvm/CodeGen/LiveIntervalCalc.h"
0027 #include "llvm/CodeGen/MachineBasicBlock.h"
0028 #include "llvm/CodeGen/MachineFunctionPass.h"
0029 #include "llvm/CodeGen/MachinePassManager.h"
0030 #include "llvm/CodeGen/SlotIndexes.h"
0031 #include "llvm/CodeGen/TargetRegisterInfo.h"
0032 #include "llvm/MC/LaneBitmask.h"
0033 #include "llvm/Support/CommandLine.h"
0034 #include "llvm/Support/Compiler.h"
0035 #include "llvm/Support/ErrorHandling.h"
0036 #include <cassert>
0037 #include <cstdint>
0038 #include <utility>
0039 
0040 namespace llvm {
0041 
0042 extern cl::opt<bool> UseSegmentSetForPhysRegs;
0043 
0044 class BitVector;
0045 class MachineBlockFrequencyInfo;
0046 class MachineDominatorTree;
0047 class MachineFunction;
0048 class MachineInstr;
0049 class MachineRegisterInfo;
0050 class ProfileSummaryInfo;
0051 class raw_ostream;
0052 class TargetInstrInfo;
0053 class VirtRegMap;
0054 
0055 class LiveIntervals {
0056   friend class LiveIntervalsAnalysis;
0057   friend class LiveIntervalsWrapperPass;
0058 
0059   MachineFunction *MF = nullptr;
0060   MachineRegisterInfo *MRI = nullptr;
0061   const TargetRegisterInfo *TRI = nullptr;
0062   const TargetInstrInfo *TII = nullptr;
0063   SlotIndexes *Indexes = nullptr;
0064   MachineDominatorTree *DomTree = nullptr;
0065   std::unique_ptr<LiveIntervalCalc> LICalc;
0066 
0067   /// Special pool allocator for VNInfo's (LiveInterval val#).
0068   VNInfo::Allocator VNInfoAllocator;
0069 
0070   /// Live interval pointers for all the virtual registers.
0071   IndexedMap<LiveInterval *, VirtReg2IndexFunctor> VirtRegIntervals;
0072 
0073   /// Sorted list of instructions with register mask operands. Always use the
0074   /// 'r' slot, RegMasks are normal clobbers, not early clobbers.
0075   SmallVector<SlotIndex, 8> RegMaskSlots;
0076 
0077   /// This vector is parallel to RegMaskSlots, it holds a pointer to the
0078   /// corresponding register mask.  This pointer can be recomputed as:
0079   ///
0080   ///   MI = Indexes->getInstructionFromIndex(RegMaskSlot[N]);
0081   ///   unsigned OpNum = findRegMaskOperand(MI);
0082   ///   RegMaskBits[N] = MI->getOperand(OpNum).getRegMask();
0083   ///
0084   /// This is kept in a separate vector partly because some standard
0085   /// libraries don't support lower_bound() with mixed objects, partly to
0086   /// improve locality when searching in RegMaskSlots.
0087   /// Also see the comment in LiveInterval::find().
0088   SmallVector<const uint32_t *, 8> RegMaskBits;
0089 
0090   /// For each basic block number, keep (begin, size) pairs indexing into the
0091   /// RegMaskSlots and RegMaskBits arrays.
0092   /// Note that basic block numbers may not be layout contiguous, that's why
0093   /// we can't just keep track of the first register mask in each basic
0094   /// block.
0095   SmallVector<std::pair<unsigned, unsigned>, 8> RegMaskBlocks;
0096 
0097   /// Keeps a live range set for each register unit to track fixed physreg
0098   /// interference.
0099   SmallVector<LiveRange *, 0> RegUnitRanges;
0100 
0101   // Can only be created from pass manager.
0102   LiveIntervals() = default;
0103   LiveIntervals(MachineFunction &MF, SlotIndexes &SI, MachineDominatorTree &DT)
0104       : Indexes(&SI), DomTree(&DT) {
0105     analyze(MF);
0106   }
0107 
0108   void analyze(MachineFunction &MF);
0109 
0110   void clear();
0111 
0112 public:
0113   LiveIntervals(LiveIntervals &&) = default;
0114   ~LiveIntervals();
0115 
0116   bool invalidate(MachineFunction &MF, const PreservedAnalyses &PA,
0117                   MachineFunctionAnalysisManager::Invalidator &Inv);
0118 
0119   /// Calculate the spill weight to assign to a single instruction.
0120   /// If \p PSI is provided the calculation is altered for optsize functions.
0121   static float getSpillWeight(bool isDef, bool isUse,
0122                               const MachineBlockFrequencyInfo *MBFI,
0123                               const MachineInstr &MI,
0124                               ProfileSummaryInfo *PSI = nullptr);
0125 
0126   /// Calculate the spill weight to assign to a single instruction.
0127   /// If \p PSI is provided the calculation is altered for optsize functions.
0128   static float getSpillWeight(bool isDef, bool isUse,
0129                               const MachineBlockFrequencyInfo *MBFI,
0130                               const MachineBasicBlock *MBB,
0131                               ProfileSummaryInfo *PSI = nullptr);
0132 
0133   LiveInterval &getInterval(Register Reg) {
0134     if (hasInterval(Reg))
0135       return *VirtRegIntervals[Reg.id()];
0136 
0137     return createAndComputeVirtRegInterval(Reg);
0138   }
0139 
0140   const LiveInterval &getInterval(Register Reg) const {
0141     return const_cast<LiveIntervals *>(this)->getInterval(Reg);
0142   }
0143 
0144   bool hasInterval(Register Reg) const {
0145     return VirtRegIntervals.inBounds(Reg.id()) && VirtRegIntervals[Reg.id()];
0146   }
0147 
0148   /// Interval creation.
0149   LiveInterval &createEmptyInterval(Register Reg) {
0150     assert(!hasInterval(Reg) && "Interval already exists!");
0151     VirtRegIntervals.grow(Reg.id());
0152     VirtRegIntervals[Reg.id()] = createInterval(Reg);
0153     return *VirtRegIntervals[Reg.id()];
0154   }
0155 
0156   LiveInterval &createAndComputeVirtRegInterval(Register Reg) {
0157     LiveInterval &LI = createEmptyInterval(Reg);
0158     computeVirtRegInterval(LI);
0159     return LI;
0160   }
0161 
0162   /// Return an existing interval for \p Reg.
0163   /// If \p Reg has no interval then this creates a new empty one instead.
0164   /// Note: does not trigger interval computation.
0165   LiveInterval &getOrCreateEmptyInterval(Register Reg) {
0166     return hasInterval(Reg) ? getInterval(Reg) : createEmptyInterval(Reg);
0167   }
0168 
0169   /// Interval removal.
0170   void removeInterval(Register Reg) {
0171     delete VirtRegIntervals[Reg];
0172     VirtRegIntervals[Reg] = nullptr;
0173   }
0174 
0175   /// Given a register and an instruction, adds a live segment from that
0176   /// instruction to the end of its MBB.
0177   LiveInterval::Segment addSegmentToEndOfBlock(Register Reg,
0178                                                MachineInstr &startInst);
0179 
0180   /// After removing some uses of a register, shrink its live range to just
0181   /// the remaining uses. This method does not compute reaching defs for new
0182   /// uses, and it doesn't remove dead defs.
0183   /// Dead PHIDef values are marked as unused. New dead machine instructions
0184   /// are added to the dead vector. Returns true if the interval may have been
0185   /// separated into multiple connected components.
0186   bool shrinkToUses(LiveInterval *li,
0187                     SmallVectorImpl<MachineInstr *> *dead = nullptr);
0188 
0189   /// Specialized version of
0190   /// shrinkToUses(LiveInterval *li, SmallVectorImpl<MachineInstr*> *dead)
0191   /// that works on a subregister live range and only looks at uses matching
0192   /// the lane mask of the subregister range.
0193   /// This may leave the subrange empty which needs to be cleaned up with
0194   /// LiveInterval::removeEmptySubranges() afterwards.
0195   void shrinkToUses(LiveInterval::SubRange &SR, Register Reg);
0196 
0197   /// Extend the live range \p LR to reach all points in \p Indices. The
0198   /// points in the \p Indices array must be jointly dominated by the union
0199   /// of the existing defs in \p LR and points in \p Undefs.
0200   ///
0201   /// PHI-defs are added as needed to maintain SSA form.
0202   ///
0203   /// If a SlotIndex in \p Indices is the end index of a basic block, \p LR
0204   /// will be extended to be live out of the basic block.
0205   /// If a SlotIndex in \p Indices is jointy dominated only by points in
0206   /// \p Undefs, the live range will not be extended to that point.
0207   ///
0208   /// See also LiveRangeCalc::extend().
0209   void extendToIndices(LiveRange &LR, ArrayRef<SlotIndex> Indices,
0210                        ArrayRef<SlotIndex> Undefs);
0211 
0212   void extendToIndices(LiveRange &LR, ArrayRef<SlotIndex> Indices) {
0213     extendToIndices(LR, Indices, /*Undefs=*/{});
0214   }
0215 
0216   /// If \p LR has a live value at \p Kill, prune its live range by removing
0217   /// any liveness reachable from Kill. Add live range end points to
0218   /// EndPoints such that extendToIndices(LI, EndPoints) will reconstruct the
0219   /// value's live range.
0220   ///
0221   /// Calling pruneValue() and extendToIndices() can be used to reconstruct
0222   /// SSA form after adding defs to a virtual register.
0223   void pruneValue(LiveRange &LR, SlotIndex Kill,
0224                   SmallVectorImpl<SlotIndex> *EndPoints);
0225 
0226   /// This function should not be used. Its intent is to tell you that you are
0227   /// doing something wrong if you call pruneValue directly on a
0228   /// LiveInterval. Indeed, you are supposed to call pruneValue on the main
0229   /// LiveRange and all the LiveRanges of the subranges if any.
0230   LLVM_ATTRIBUTE_UNUSED void pruneValue(LiveInterval &, SlotIndex,
0231                                         SmallVectorImpl<SlotIndex> *) {
0232     llvm_unreachable(
0233         "Use pruneValue on the main LiveRange and on each subrange");
0234   }
0235 
0236   SlotIndexes *getSlotIndexes() const { return Indexes; }
0237 
0238   /// Returns true if the specified machine instr has been removed or was
0239   /// never entered in the map.
0240   bool isNotInMIMap(const MachineInstr &Instr) const {
0241     return !Indexes->hasIndex(Instr);
0242   }
0243 
0244   /// Returns the base index of the given instruction.
0245   SlotIndex getInstructionIndex(const MachineInstr &Instr) const {
0246     return Indexes->getInstructionIndex(Instr);
0247   }
0248 
0249   /// Returns the instruction associated with the given index.
0250   MachineInstr *getInstructionFromIndex(SlotIndex index) const {
0251     return Indexes->getInstructionFromIndex(index);
0252   }
0253 
0254   /// Return the first index in the given basic block.
0255   SlotIndex getMBBStartIdx(const MachineBasicBlock *mbb) const {
0256     return Indexes->getMBBStartIdx(mbb);
0257   }
0258 
0259   /// Return the last index in the given basic block.
0260   SlotIndex getMBBEndIdx(const MachineBasicBlock *mbb) const {
0261     return Indexes->getMBBEndIdx(mbb);
0262   }
0263 
0264   bool isLiveInToMBB(const LiveRange &LR, const MachineBasicBlock *mbb) const {
0265     return LR.liveAt(getMBBStartIdx(mbb));
0266   }
0267 
0268   bool isLiveOutOfMBB(const LiveRange &LR, const MachineBasicBlock *mbb) const {
0269     return LR.liveAt(getMBBEndIdx(mbb).getPrevSlot());
0270   }
0271 
0272   MachineBasicBlock *getMBBFromIndex(SlotIndex index) const {
0273     return Indexes->getMBBFromIndex(index);
0274   }
0275 
0276   void insertMBBInMaps(MachineBasicBlock *MBB) {
0277     Indexes->insertMBBInMaps(MBB);
0278     assert(unsigned(MBB->getNumber()) == RegMaskBlocks.size() &&
0279            "Blocks must be added in order.");
0280     RegMaskBlocks.push_back(std::make_pair(RegMaskSlots.size(), 0));
0281   }
0282 
0283   SlotIndex InsertMachineInstrInMaps(MachineInstr &MI) {
0284     return Indexes->insertMachineInstrInMaps(MI);
0285   }
0286 
0287   void InsertMachineInstrRangeInMaps(MachineBasicBlock::iterator B,
0288                                      MachineBasicBlock::iterator E) {
0289     for (MachineBasicBlock::iterator I = B; I != E; ++I)
0290       Indexes->insertMachineInstrInMaps(*I);
0291   }
0292 
0293   void RemoveMachineInstrFromMaps(MachineInstr &MI) {
0294     Indexes->removeMachineInstrFromMaps(MI);
0295   }
0296 
0297   SlotIndex ReplaceMachineInstrInMaps(MachineInstr &MI, MachineInstr &NewMI) {
0298     return Indexes->replaceMachineInstrInMaps(MI, NewMI);
0299   }
0300 
0301   VNInfo::Allocator &getVNInfoAllocator() { return VNInfoAllocator; }
0302 
0303   /// Implement the dump method.
0304   void print(raw_ostream &O) const;
0305   void dump() const;
0306 
0307   // For legacy pass to recompute liveness.
0308   void reanalyze(MachineFunction &MF) {
0309     clear();
0310     analyze(MF);
0311   }
0312 
0313   MachineDominatorTree &getDomTree() { return *DomTree; }
0314 
0315   /// If LI is confined to a single basic block, return a pointer to that
0316   /// block.  If LI is live in to or out of any block, return NULL.
0317   MachineBasicBlock *intervalIsInOneMBB(const LiveInterval &LI) const;
0318 
0319   /// Returns true if VNI is killed by any PHI-def values in LI.
0320   /// This may conservatively return true to avoid expensive computations.
0321   bool hasPHIKill(const LiveInterval &LI, const VNInfo *VNI) const;
0322 
0323   /// Add kill flags to any instruction that kills a virtual register.
0324   void addKillFlags(const VirtRegMap *);
0325 
0326   /// Call this method to notify LiveIntervals that instruction \p MI has been
0327   /// moved within a basic block. This will update the live intervals for all
0328   /// operands of \p MI. Moves between basic blocks are not supported.
0329   ///
0330   /// \param UpdateFlags Update live intervals for nonallocatable physregs.
0331   void handleMove(MachineInstr &MI, bool UpdateFlags = false);
0332 
0333   /// Update intervals of operands of all instructions in the newly
0334   /// created bundle specified by \p BundleStart.
0335   ///
0336   /// \param UpdateFlags Update live intervals for nonallocatable physregs.
0337   ///
0338   /// Assumes existing liveness is accurate.
0339   /// \pre BundleStart should be the first instruction in the Bundle.
0340   /// \pre BundleStart should not have a have SlotIndex as one will be assigned.
0341   void handleMoveIntoNewBundle(MachineInstr &BundleStart,
0342                                bool UpdateFlags = false);
0343 
0344   /// Update live intervals for instructions in a range of iterators. It is
0345   /// intended for use after target hooks that may insert or remove
0346   /// instructions, and is only efficient for a small number of instructions.
0347   ///
0348   /// OrigRegs is a vector of registers that were originally used by the
0349   /// instructions in the range between the two iterators.
0350   ///
0351   /// Currently, the only changes that are supported are simple removal
0352   /// and addition of uses.
0353   void repairIntervalsInRange(MachineBasicBlock *MBB,
0354                               MachineBasicBlock::iterator Begin,
0355                               MachineBasicBlock::iterator End,
0356                               ArrayRef<Register> OrigRegs);
0357 
0358   // Register mask functions.
0359   //
0360   // Machine instructions may use a register mask operand to indicate that a
0361   // large number of registers are clobbered by the instruction.  This is
0362   // typically used for calls.
0363   //
0364   // For compile time performance reasons, these clobbers are not recorded in
0365   // the live intervals for individual physical registers.  Instead,
0366   // LiveIntervalAnalysis maintains a sorted list of instructions with
0367   // register mask operands.
0368 
0369   /// Returns a sorted array of slot indices of all instructions with
0370   /// register mask operands.
0371   ArrayRef<SlotIndex> getRegMaskSlots() const { return RegMaskSlots; }
0372 
0373   /// Returns a sorted array of slot indices of all instructions with register
0374   /// mask operands in the basic block numbered \p MBBNum.
0375   ArrayRef<SlotIndex> getRegMaskSlotsInBlock(unsigned MBBNum) const {
0376     std::pair<unsigned, unsigned> P = RegMaskBlocks[MBBNum];
0377     return getRegMaskSlots().slice(P.first, P.second);
0378   }
0379 
0380   /// Returns an array of register mask pointers corresponding to
0381   /// getRegMaskSlots().
0382   ArrayRef<const uint32_t *> getRegMaskBits() const { return RegMaskBits; }
0383 
0384   /// Returns an array of mask pointers corresponding to
0385   /// getRegMaskSlotsInBlock(MBBNum).
0386   ArrayRef<const uint32_t *> getRegMaskBitsInBlock(unsigned MBBNum) const {
0387     std::pair<unsigned, unsigned> P = RegMaskBlocks[MBBNum];
0388     return getRegMaskBits().slice(P.first, P.second);
0389   }
0390 
0391   /// Test if \p LI is live across any register mask instructions, and
0392   /// compute a bit mask of physical registers that are not clobbered by any
0393   /// of them.
0394   ///
0395   /// Returns false if \p LI doesn't cross any register mask instructions. In
0396   /// that case, the bit vector is not filled in.
0397   bool checkRegMaskInterference(const LiveInterval &LI, BitVector &UsableRegs);
0398 
0399   // Register unit functions.
0400   //
0401   // Fixed interference occurs when MachineInstrs use physregs directly
0402   // instead of virtual registers. This typically happens when passing
0403   // arguments to a function call, or when instructions require operands in
0404   // fixed registers.
0405   //
0406   // Each physreg has one or more register units, see MCRegisterInfo. We
0407   // track liveness per register unit to handle aliasing registers more
0408   // efficiently.
0409 
0410   /// Return the live range for register unit \p Unit. It will be computed if
0411   /// it doesn't exist.
0412   LiveRange &getRegUnit(unsigned Unit) {
0413     LiveRange *LR = RegUnitRanges[Unit];
0414     if (!LR) {
0415       // Compute missing ranges on demand.
0416       // Use segment set to speed-up initial computation of the live range.
0417       RegUnitRanges[Unit] = LR = new LiveRange(UseSegmentSetForPhysRegs);
0418       computeRegUnitRange(*LR, Unit);
0419     }
0420     return *LR;
0421   }
0422 
0423   /// Return the live range for register unit \p Unit if it has already been
0424   /// computed, or nullptr if it hasn't been computed yet.
0425   LiveRange *getCachedRegUnit(unsigned Unit) { return RegUnitRanges[Unit]; }
0426 
0427   const LiveRange *getCachedRegUnit(unsigned Unit) const {
0428     return RegUnitRanges[Unit];
0429   }
0430 
0431   /// Remove computed live range for register unit \p Unit. Subsequent uses
0432   /// should rely on on-demand recomputation.
0433   void removeRegUnit(unsigned Unit) {
0434     delete RegUnitRanges[Unit];
0435     RegUnitRanges[Unit] = nullptr;
0436   }
0437 
0438   /// Remove associated live ranges for the register units associated with \p
0439   /// Reg. Subsequent uses should rely on on-demand recomputation.  \note This
0440   /// method can result in inconsistent liveness tracking if multiple phyical
0441   /// registers share a regunit, and should be used cautiously.
0442   void removeAllRegUnitsForPhysReg(MCRegister Reg) {
0443     for (MCRegUnit Unit : TRI->regunits(Reg))
0444       removeRegUnit(Unit);
0445   }
0446 
0447   /// Remove value numbers and related live segments starting at position
0448   /// \p Pos that are part of any liverange of physical register \p Reg or one
0449   /// of its subregisters.
0450   void removePhysRegDefAt(MCRegister Reg, SlotIndex Pos);
0451 
0452   /// Remove value number and related live segments of \p LI and its subranges
0453   /// that start at position \p Pos.
0454   void removeVRegDefAt(LiveInterval &LI, SlotIndex Pos);
0455 
0456   /// Split separate components in LiveInterval \p LI into separate intervals.
0457   void splitSeparateComponents(LiveInterval &LI,
0458                                SmallVectorImpl<LiveInterval *> &SplitLIs);
0459 
0460   /// For live interval \p LI with correct SubRanges construct matching
0461   /// information for the main live range. Expects the main live range to not
0462   /// have any segments or value numbers.
0463   void constructMainRangeFromSubranges(LiveInterval &LI);
0464 
0465 private:
0466   /// Compute live intervals for all virtual registers.
0467   void computeVirtRegs();
0468 
0469   /// Compute RegMaskSlots and RegMaskBits.
0470   void computeRegMasks();
0471 
0472   /// Walk the values in \p LI and check for dead values:
0473   /// - Dead PHIDef values are marked as unused.
0474   /// - Dead operands are marked as such.
0475   /// - Completely dead machine instructions are added to the \p dead vector
0476   ///   if it is not nullptr.
0477   /// Returns true if any PHI value numbers have been removed which may
0478   /// have separated the interval into multiple connected components.
0479   bool computeDeadValues(LiveInterval &LI,
0480                          SmallVectorImpl<MachineInstr *> *dead);
0481 
0482   static LiveInterval *createInterval(Register Reg);
0483 
0484   void printInstrs(raw_ostream &O) const;
0485   void dumpInstrs() const;
0486 
0487   void computeLiveInRegUnits();
0488   void computeRegUnitRange(LiveRange &, unsigned Unit);
0489   bool computeVirtRegInterval(LiveInterval &);
0490 
0491   using ShrinkToUsesWorkList = SmallVector<std::pair<SlotIndex, VNInfo *>, 16>;
0492   void extendSegmentsToUses(LiveRange &Segments, ShrinkToUsesWorkList &WorkList,
0493                             Register Reg, LaneBitmask LaneMask);
0494 
0495   /// Helper function for repairIntervalsInRange(), walks backwards and
0496   /// creates/modifies live segments in \p LR to match the operands found.
0497   /// Only full operands or operands with subregisters matching \p LaneMask
0498   /// are considered.
0499   void repairOldRegInRange(MachineBasicBlock::iterator Begin,
0500                            MachineBasicBlock::iterator End,
0501                            const SlotIndex endIdx, LiveRange &LR, Register Reg,
0502                            LaneBitmask LaneMask = LaneBitmask::getAll());
0503 
0504   class HMEditor;
0505 };
0506 
0507 class LiveIntervalsAnalysis : public AnalysisInfoMixin<LiveIntervalsAnalysis> {
0508   friend AnalysisInfoMixin<LiveIntervalsAnalysis>;
0509   static AnalysisKey Key;
0510 
0511 public:
0512   using Result = LiveIntervals;
0513   Result run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM);
0514 };
0515 
0516 class LiveIntervalsPrinterPass
0517     : public PassInfoMixin<LiveIntervalsPrinterPass> {
0518   raw_ostream &OS;
0519 
0520 public:
0521   explicit LiveIntervalsPrinterPass(raw_ostream &OS) : OS(OS) {}
0522   PreservedAnalyses run(MachineFunction &MF,
0523                         MachineFunctionAnalysisManager &MFAM);
0524   static bool isRequired() { return true; }
0525 };
0526 
0527 class LiveIntervalsWrapperPass : public MachineFunctionPass {
0528   LiveIntervals LIS;
0529 
0530 public:
0531   static char ID;
0532 
0533   LiveIntervalsWrapperPass();
0534 
0535   void getAnalysisUsage(AnalysisUsage &AU) const override;
0536   void releaseMemory() override { LIS.clear(); }
0537 
0538   /// Pass entry point; Calculates LiveIntervals.
0539   bool runOnMachineFunction(MachineFunction &) override;
0540 
0541   /// Implement the dump method.
0542   void print(raw_ostream &O, const Module * = nullptr) const override {
0543     LIS.print(O);
0544   }
0545 
0546   LiveIntervals &getLIS() { return LIS; }
0547 };
0548 
0549 } // end namespace llvm
0550 
0551 #endif