diff options
Diffstat (limited to 'contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h')
-rw-r--r-- | contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h index 97a49ce4dc4f..0c9110cbaa87 100644 --- a/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h +++ b/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h @@ -25,6 +25,7 @@ #include "llvm/MC/LaneBitmask.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/Support/BranchProbability.h" +#include "llvm/Support/Printable.h" #include <cassert> #include <cstdint> #include <functional> @@ -97,6 +98,8 @@ private: using const_probability_iterator = std::vector<BranchProbability>::const_iterator; + Optional<uint64_t> IrrLoopHeaderWeight; + /// Keep track of the physical registers that are livein of the basicblock. using LiveInVector = std::vector<RegisterMaskPair>; LiveInVector LiveIns; @@ -699,8 +702,8 @@ public: LQR_Unknown ///< Register liveness not decidable from local neighborhood. }; - /// Return whether (physical) register \p Reg has been <def>ined and not - /// <kill>ed as of just before \p Before. + /// Return whether (physical) register \p Reg has been defined and not + /// killed as of just before \p Before. /// /// Search is localised to a neighborhood of \p Neighborhood instructions /// before (searching for defs or kills) and \p Neighborhood instructions @@ -729,6 +732,14 @@ public: /// Return the MCSymbol for this basic block. MCSymbol *getSymbol() const; + Optional<uint64_t> getIrrLoopHeaderWeight() const { + return IrrLoopHeaderWeight; + } + + void setIrrLoopHeaderWeight(uint64_t Weight) { + IrrLoopHeaderWeight = Weight; + } + private: /// Return probability iterator corresponding to the I successor iterator. probability_iterator getProbabilityIterator(succ_iterator I); @@ -748,7 +759,7 @@ private: // Machine-CFG mutators - /// Remove Pred as a predecessor of this MachineBasicBlock. Don't do this + /// Add Pred as a predecessor of this MachineBasicBlock. Don't do this /// unless you know what you're doing, because it doesn't update Pred's /// successors list. Use Pred->addSuccessor instead. void addPredecessor(MachineBasicBlock *Pred); @@ -761,9 +772,17 @@ private: raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB); +/// Prints a machine basic block reference. +/// +/// The format is: +/// %bb.5 - a machine basic block with MBB.getNumber() == 5. +/// +/// Usage: OS << printMBBReference(MBB) << '\n'; +Printable printMBBReference(const MachineBasicBlock &MBB); + // This is useful when building IndexedMaps keyed on basic block pointers. -struct MBB2NumberFunctor : - public std::unary_function<const MachineBasicBlock*, unsigned> { +struct MBB2NumberFunctor { + using argument_type = const MachineBasicBlock *; unsigned operator()(const MachineBasicBlock *MBB) const { return MBB->getNumber(); } |