LLVM  15.0.0git
MachineBasicBlock.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/MachineBasicBlock.h -------------------------*- 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 // Collect the sequence of machine instructions for a basic block.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CODEGEN_MACHINEBASICBLOCK_H
14 #define LLVM_CODEGEN_MACHINEBASICBLOCK_H
15 
16 #include "llvm/ADT/GraphTraits.h"
18 #include "llvm/ADT/ilist.h"
22 #include "llvm/IR/DebugLoc.h"
23 #include "llvm/MC/LaneBitmask.h"
25 #include <cassert>
26 #include <cstdint>
27 #include <iterator>
28 #include <string>
29 #include <vector>
30 
31 namespace llvm {
32 
33 class BasicBlock;
34 class MachineFunction;
35 class MCSymbol;
36 class ModuleSlotTracker;
37 class Pass;
38 class Printable;
39 class SlotIndexes;
40 class StringRef;
41 class raw_ostream;
42 class LiveIntervals;
43 class TargetRegisterClass;
44 class TargetRegisterInfo;
45 
46 // This structure uniquely identifies a basic block section.
47 // Possible values are
48 // {Type: Default, Number: (unsigned)} (These are regular section IDs)
49 // {Type: Exception, Number: 0} (ExceptionSectionID)
50 // {Type: Cold, Number: 0} (ColdSectionID)
51 struct MBBSectionID {
52  enum SectionType {
53  Default = 0, // Regular section (these sections are distinguished by the
54  // Number field).
55  Exception, // Special section type for exception handling blocks
56  Cold, // Special section type for cold blocks
57  } Type;
58  unsigned Number;
59 
60  MBBSectionID(unsigned N) : Type(Default), Number(N) {}
61 
62  // Special unique sections for cold and exception blocks.
65 
66  bool operator==(const MBBSectionID &Other) const {
67  return Type == Other.Type && Number == Other.Number;
68  }
69 
70  bool operator!=(const MBBSectionID &Other) const { return !(*this == Other); }
71 
72 private:
73  // This is only used to construct the special cold and exception sections.
74  MBBSectionID(SectionType T) : Type(T), Number(0) {}
75 };
76 
77 template <> struct ilist_traits<MachineInstr> {
78 private:
79  friend class MachineBasicBlock; // Set by the owning MachineBasicBlock.
80 
81  MachineBasicBlock *Parent;
82 
83  using instr_iterator =
85 
86 public:
90  instr_iterator Last);
91  void deleteNode(MachineInstr *MI);
92 };
93 
95  : public ilist_node_with_parent<MachineBasicBlock, MachineFunction> {
96 public:
97  /// Pair of physical register and lane mask.
98  /// This is not simply a std::pair typedef because the members should be named
99  /// clearly as they both have an integer type.
101  public:
104 
107  };
108 
109 private:
111 
112  const BasicBlock *BB;
113  int Number;
114  MachineFunction *xParent;
115  Instructions Insts;
116 
117  /// Keep track of the predecessor / successor basic blocks.
118  std::vector<MachineBasicBlock *> Predecessors;
119  std::vector<MachineBasicBlock *> Successors;
120 
121  /// Keep track of the probabilities to the successors. This vector has the
122  /// same order as Successors, or it is empty if we don't use it (disable
123  /// optimization).
124  std::vector<BranchProbability> Probs;
125  using probability_iterator = std::vector<BranchProbability>::iterator;
126  using const_probability_iterator =
127  std::vector<BranchProbability>::const_iterator;
128 
129  Optional<uint64_t> IrrLoopHeaderWeight;
130 
131  /// Keep track of the physical registers that are livein of the basicblock.
132  using LiveInVector = std::vector<RegisterMaskPair>;
133  LiveInVector LiveIns;
134 
135  /// Alignment of the basic block. One if the basic block does not need to be
136  /// aligned.
137  Align Alignment;
138  /// Maximum amount of bytes that can be added to align the basic block. If the
139  /// alignment cannot be reached in this many bytes, no bytes are emitted.
140  /// Zero to represent no maximum.
141  unsigned MaxBytesForAlignment = 0;
142 
143  /// Indicate that this basic block is entered via an exception handler.
144  bool IsEHPad = false;
145 
146  /// Indicate that this basic block is potentially the target of an indirect
147  /// branch.
148  bool AddressTaken = false;
149 
150  /// Indicate that this basic block needs its symbol be emitted regardless of
151  /// whether the flow just falls-through to it.
152  bool LabelMustBeEmitted = false;
153 
154  /// Indicate that this basic block is the entry block of an EH scope, i.e.,
155  /// the block that used to have a catchpad or cleanuppad instruction in the
156  /// LLVM IR.
157  bool IsEHScopeEntry = false;
158 
159  /// Indicates if this is a target block of a catchret.
160  bool IsEHCatchretTarget = false;
161 
162  /// Indicate that this basic block is the entry block of an EH funclet.
163  bool IsEHFuncletEntry = false;
164 
165  /// Indicate that this basic block is the entry block of a cleanup funclet.
166  bool IsCleanupFuncletEntry = false;
167 
168  /// With basic block sections, this stores the Section ID of the basic block.
169  MBBSectionID SectionID{0};
170 
171  // Indicate that this basic block begins a section.
172  bool IsBeginSection = false;
173 
174  // Indicate that this basic block ends a section.
175  bool IsEndSection = false;
176 
177  /// Indicate that this basic block is the indirect dest of an INLINEASM_BR.
178  bool IsInlineAsmBrIndirectTarget = false;
179 
180  /// since getSymbol is a relatively heavy-weight operation, the symbol
181  /// is only computed once and is cached.
182  mutable MCSymbol *CachedMCSymbol = nullptr;
183 
184  /// Cached MCSymbol for this block (used if IsEHCatchRetTarget).
185  mutable MCSymbol *CachedEHCatchretMCSymbol = nullptr;
186 
187  /// Marks the end of the basic block. Used during basic block sections to
188  /// calculate the size of the basic block, or the BB section ending with it.
189  mutable MCSymbol *CachedEndMCSymbol = nullptr;
190 
191  // Intrusive list support
192  MachineBasicBlock() = default;
193 
194  explicit MachineBasicBlock(MachineFunction &MF, const BasicBlock *BB);
195 
196  ~MachineBasicBlock();
197 
198  // MachineBasicBlocks are allocated and owned by MachineFunction.
199  friend class MachineFunction;
200 
201 public:
202  /// Return the LLVM basic block that this instance corresponded to originally.
203  /// Note that this may be NULL if this instance does not correspond directly
204  /// to an LLVM basic block.
205  const BasicBlock *getBasicBlock() const { return BB; }
206 
207  /// Remove the reference to the underlying IR BasicBlock. This is for
208  /// reduction tools and should generally not be used.
210  BB = nullptr;
211  }
212 
213  /// Return the name of the corresponding LLVM basic block, or an empty string.
214  StringRef getName() const;
215 
216  /// Return a formatted string to identify this block and its parent function.
217  std::string getFullName() const;
218 
219  /// Test whether this block is potentially the target of an indirect branch.
220  bool hasAddressTaken() const { return AddressTaken; }
221 
222  /// Set this block to reflect that it potentially is the target of an indirect
223  /// branch.
224  void setHasAddressTaken() { AddressTaken = true; }
225 
226  /// Test whether this block must have its label emitted.
227  bool hasLabelMustBeEmitted() const { return LabelMustBeEmitted; }
228 
229  /// Set this block to reflect that, regardless how we flow to it, we need
230  /// its label be emitted.
231  void setLabelMustBeEmitted() { LabelMustBeEmitted = true; }
232 
233  /// Return the MachineFunction containing this basic block.
234  const MachineFunction *getParent() const { return xParent; }
235  MachineFunction *getParent() { return xParent; }
236 
241 
245  using const_reverse_iterator =
247 
248  unsigned size() const { return (unsigned)Insts.size(); }
249  bool sizeWithoutDebugLargerThan(unsigned Limit) const;
250  bool empty() const { return Insts.empty(); }
251 
252  MachineInstr &instr_front() { return Insts.front(); }
253  MachineInstr &instr_back() { return Insts.back(); }
254  const MachineInstr &instr_front() const { return Insts.front(); }
255  const MachineInstr &instr_back() const { return Insts.back(); }
256 
257  MachineInstr &front() { return Insts.front(); }
258  MachineInstr &back() { return *--end(); }
259  const MachineInstr &front() const { return Insts.front(); }
260  const MachineInstr &back() const { return *--end(); }
261 
262  instr_iterator instr_begin() { return Insts.begin(); }
263  const_instr_iterator instr_begin() const { return Insts.begin(); }
264  instr_iterator instr_end() { return Insts.end(); }
265  const_instr_iterator instr_end() const { return Insts.end(); }
266  reverse_instr_iterator instr_rbegin() { return Insts.rbegin(); }
267  const_reverse_instr_iterator instr_rbegin() const { return Insts.rbegin(); }
268  reverse_instr_iterator instr_rend () { return Insts.rend(); }
269  const_reverse_instr_iterator instr_rend () const { return Insts.rend(); }
270 
276  }
277 
278  iterator begin() { return instr_begin(); }
279  const_iterator begin() const { return instr_begin(); }
280  iterator end () { return instr_end(); }
281  const_iterator end () const { return instr_end(); }
284  }
287  }
291  }
292 
293  /// Support for MachineInstr::getNextNode().
295  return &MachineBasicBlock::Insts;
296  }
297 
299  return make_range(getFirstTerminator(), end());
300  }
302  return make_range(getFirstTerminator(), end());
303  }
304 
305  /// Returns a range that iterates over the phis in the basic block.
307  return make_range(begin(), getFirstNonPHI());
308  }
310  return const_cast<MachineBasicBlock *>(this)->phis();
311  }
312 
313  // Machine-CFG iterators
314  using pred_iterator = std::vector<MachineBasicBlock *>::iterator;
315  using const_pred_iterator = std::vector<MachineBasicBlock *>::const_iterator;
316  using succ_iterator = std::vector<MachineBasicBlock *>::iterator;
317  using const_succ_iterator = std::vector<MachineBasicBlock *>::const_iterator;
318  using pred_reverse_iterator =
319  std::vector<MachineBasicBlock *>::reverse_iterator;
321  std::vector<MachineBasicBlock *>::const_reverse_iterator;
322  using succ_reverse_iterator =
323  std::vector<MachineBasicBlock *>::reverse_iterator;
325  std::vector<MachineBasicBlock *>::const_reverse_iterator;
326  pred_iterator pred_begin() { return Predecessors.begin(); }
327  const_pred_iterator pred_begin() const { return Predecessors.begin(); }
328  pred_iterator pred_end() { return Predecessors.end(); }
329  const_pred_iterator pred_end() const { return Predecessors.end(); }
331  { return Predecessors.rbegin();}
333  { return Predecessors.rbegin();}
335  { return Predecessors.rend(); }
337  { return Predecessors.rend(); }
338  unsigned pred_size() const {
339  return (unsigned)Predecessors.size();
340  }
341  bool pred_empty() const { return Predecessors.empty(); }
342  succ_iterator succ_begin() { return Successors.begin(); }
343  const_succ_iterator succ_begin() const { return Successors.begin(); }
344  succ_iterator succ_end() { return Successors.end(); }
345  const_succ_iterator succ_end() const { return Successors.end(); }
347  { return Successors.rbegin(); }
349  { return Successors.rbegin(); }
351  { return Successors.rend(); }
353  { return Successors.rend(); }
354  unsigned succ_size() const {
355  return (unsigned)Successors.size();
356  }
357  bool succ_empty() const { return Successors.empty(); }
358 
360  return make_range(pred_begin(), pred_end());
361  }
363  return make_range(pred_begin(), pred_end());
364  }
366  return make_range(succ_begin(), succ_end());
367  }
369  return make_range(succ_begin(), succ_end());
370  }
371 
372  // LiveIn management methods.
373 
374  /// Adds the specified register as a live in. Note that it is an error to add
375  /// the same register to the same set more than once unless the intention is
376  /// to call sortUniqueLiveIns after all registers are added.
377  void addLiveIn(MCRegister PhysReg,
378  LaneBitmask LaneMask = LaneBitmask::getAll()) {
379  LiveIns.push_back(RegisterMaskPair(PhysReg, LaneMask));
380  }
381  void addLiveIn(const RegisterMaskPair &RegMaskPair) {
382  LiveIns.push_back(RegMaskPair);
383  }
384 
385  /// Sorts and uniques the LiveIns vector. It can be significantly faster to do
386  /// this than repeatedly calling isLiveIn before calling addLiveIn for every
387  /// LiveIn insertion.
388  void sortUniqueLiveIns();
389 
390  /// Clear live in list.
391  void clearLiveIns();
392 
393  /// Add PhysReg as live in to this block, and ensure that there is a copy of
394  /// PhysReg to a virtual register of class RC. Return the virtual register
395  /// that is a copy of the live in PhysReg.
396  Register addLiveIn(MCRegister PhysReg, const TargetRegisterClass *RC);
397 
398  /// Remove the specified register from the live in set.
400  LaneBitmask LaneMask = LaneBitmask::getAll());
401 
402  /// Return true if the specified register is in the live in set.
403  bool isLiveIn(MCPhysReg Reg,
404  LaneBitmask LaneMask = LaneBitmask::getAll()) const;
405 
406  // Iteration support for live in sets. These sets are kept in sorted
407  // order by their register number.
408  using livein_iterator = LiveInVector::const_iterator;
409 
410  /// Unlike livein_begin, this method does not check that the liveness
411  /// information is accurate. Still for debug purposes it may be useful
412  /// to have iterators that won't assert if the liveness information
413  /// is not current.
414  livein_iterator livein_begin_dbg() const { return LiveIns.begin(); }
417  }
418 
420  livein_iterator livein_end() const { return LiveIns.end(); }
421  bool livein_empty() const { return LiveIns.empty(); }
423  return make_range(livein_begin(), livein_end());
424  }
425 
426  /// Remove entry from the livein set and return iterator to the next.
428 
430  public:
431  using iterator_category = std::input_iterator_tag;
432  using difference_type = std::ptrdiff_t;
434  using pointer = const RegisterMaskPair *;
435  using reference = const RegisterMaskPair &;
436 
438  MCPhysReg ExceptionSelector, bool End)
439  : ExceptionPointer(ExceptionPointer),
440  ExceptionSelector(ExceptionSelector), BlockI(MBB.succ_begin()),
441  BlockEnd(MBB.succ_end()) {
442  if (End)
443  BlockI = BlockEnd;
444  else if (BlockI != BlockEnd) {
445  LiveRegI = (*BlockI)->livein_begin();
446  if (!advanceToValidPosition())
447  return;
448  if (LiveRegI->PhysReg == ExceptionPointer ||
449  LiveRegI->PhysReg == ExceptionSelector)
450  ++(*this);
451  }
452  }
453 
455  do {
456  ++LiveRegI;
457  if (!advanceToValidPosition())
458  return *this;
459  } while ((*BlockI)->isEHPad() &&
460  (LiveRegI->PhysReg == ExceptionPointer ||
461  LiveRegI->PhysReg == ExceptionSelector));
462  return *this;
463  }
464 
466  liveout_iterator Tmp = *this;
467  ++(*this);
468  return Tmp;
469  }
470 
472  return *LiveRegI;
473  }
474 
475  pointer operator->() const {
476  return &*LiveRegI;
477  }
478 
479  bool operator==(const liveout_iterator &RHS) const {
480  if (BlockI != BlockEnd)
481  return BlockI == RHS.BlockI && LiveRegI == RHS.LiveRegI;
482  return RHS.BlockI == BlockEnd;
483  }
484 
485  bool operator!=(const liveout_iterator &RHS) const {
486  return !(*this == RHS);
487  }
488  private:
489  bool advanceToValidPosition() {
490  if (LiveRegI != (*BlockI)->livein_end())
491  return true;
492 
493  do {
494  ++BlockI;
495  } while (BlockI != BlockEnd && (*BlockI)->livein_empty());
496  if (BlockI == BlockEnd)
497  return false;
498 
499  LiveRegI = (*BlockI)->livein_begin();
500  return true;
501  }
502 
503  MCPhysReg ExceptionPointer, ExceptionSelector;
504  const_succ_iterator BlockI;
505  const_succ_iterator BlockEnd;
506  livein_iterator LiveRegI;
507  };
508 
509  /// Iterator scanning successor basic blocks' liveins to determine the
510  /// registers potentially live at the end of this block. There may be
511  /// duplicates or overlapping registers in the list returned.
512  liveout_iterator liveout_begin() const;
514  return liveout_iterator(*this, 0, 0, true);
515  }
517  return make_range(liveout_begin(), liveout_end());
518  }
519 
520  /// Get the clobber mask for the start of this basic block. Funclets use this
521  /// to prevent register allocation across funclet transitions.
522  const uint32_t *getBeginClobberMask(const TargetRegisterInfo *TRI) const;
523 
524  /// Get the clobber mask for the end of the basic block.
525  /// \see getBeginClobberMask()
526  const uint32_t *getEndClobberMask(const TargetRegisterInfo *TRI) const;
527 
528  /// Return alignment of the basic block.
529  Align getAlignment() const { return Alignment; }
530 
531  /// Set alignment of the basic block.
532  void setAlignment(Align A) { Alignment = A; }
533 
534  void setAlignment(Align A, unsigned MaxBytes) {
535  setAlignment(A);
536  setMaxBytesForAlignment(MaxBytes);
537  }
538 
539  /// Return the maximum amount of padding allowed for aligning the basic block.
540  unsigned getMaxBytesForAlignment() const { return MaxBytesForAlignment; }
541 
542  /// Set the maximum amount of padding allowed for aligning the basic block
543  void setMaxBytesForAlignment(unsigned MaxBytes) {
544  MaxBytesForAlignment = MaxBytes;
545  }
546 
547  /// Returns true if the block is a landing pad. That is this basic block is
548  /// entered via an exception handler.
549  bool isEHPad() const { return IsEHPad; }
550 
551  /// Indicates the block is a landing pad. That is this basic block is entered
552  /// via an exception handler.
553  void setIsEHPad(bool V = true) { IsEHPad = V; }
554 
555  bool hasEHPadSuccessor() const;
556 
557  /// Returns true if this is the entry block of the function.
558  bool isEntryBlock() const;
559 
560  /// Returns true if this is the entry block of an EH scope, i.e., the block
561  /// that used to have a catchpad or cleanuppad instruction in the LLVM IR.
562  bool isEHScopeEntry() const { return IsEHScopeEntry; }
563 
564  /// Indicates if this is the entry block of an EH scope, i.e., the block that
565  /// that used to have a catchpad or cleanuppad instruction in the LLVM IR.
566  void setIsEHScopeEntry(bool V = true) { IsEHScopeEntry = V; }
567 
568  /// Returns true if this is a target block of a catchret.
569  bool isEHCatchretTarget() const { return IsEHCatchretTarget; }
570 
571  /// Indicates if this is a target block of a catchret.
572  void setIsEHCatchretTarget(bool V = true) { IsEHCatchretTarget = V; }
573 
574  /// Returns true if this is the entry block of an EH funclet.
575  bool isEHFuncletEntry() const { return IsEHFuncletEntry; }
576 
577  /// Indicates if this is the entry block of an EH funclet.
578  void setIsEHFuncletEntry(bool V = true) { IsEHFuncletEntry = V; }
579 
580  /// Returns true if this is the entry block of a cleanup funclet.
581  bool isCleanupFuncletEntry() const { return IsCleanupFuncletEntry; }
582 
583  /// Indicates if this is the entry block of a cleanup funclet.
584  void setIsCleanupFuncletEntry(bool V = true) { IsCleanupFuncletEntry = V; }
585 
586  /// Returns true if this block begins any section.
587  bool isBeginSection() const { return IsBeginSection; }
588 
589  /// Returns true if this block ends any section.
590  bool isEndSection() const { return IsEndSection; }
591 
592  void setIsBeginSection(bool V = true) { IsBeginSection = V; }
593 
594  void setIsEndSection(bool V = true) { IsEndSection = V; }
595 
596  /// Returns the section ID of this basic block.
597  MBBSectionID getSectionID() const { return SectionID; }
598 
599  /// Returns the unique section ID number of this basic block.
600  unsigned getSectionIDNum() const {
601  return ((unsigned)MBBSectionID::SectionType::Cold) -
602  ((unsigned)SectionID.Type) + SectionID.Number;
603  }
604 
605  /// Sets the section ID for this basic block.
606  void setSectionID(MBBSectionID V) { SectionID = V; }
607 
608  /// Returns the MCSymbol marking the end of this basic block.
609  MCSymbol *getEndSymbol() const;
610 
611  /// Returns true if this block may have an INLINEASM_BR (overestimate, by
612  /// checking if any of the successors are indirect targets of any inlineasm_br
613  /// in the function).
614  bool mayHaveInlineAsmBr() const;
615 
616  /// Returns true if this is the indirect dest of an INLINEASM_BR.
618  return IsInlineAsmBrIndirectTarget;
619  }
620 
621  /// Indicates if this is the indirect dest of an INLINEASM_BR.
622  void setIsInlineAsmBrIndirectTarget(bool V = true) {
623  IsInlineAsmBrIndirectTarget = V;
624  }
625 
626  /// Returns true if it is legal to hoist instructions into this block.
627  bool isLegalToHoistInto() const;
628 
629  // Code Layout methods.
630 
631  /// Move 'this' block before or after the specified block. This only moves
632  /// the block, it does not modify the CFG or adjust potential fall-throughs at
633  /// the end of the block.
634  void moveBefore(MachineBasicBlock *NewAfter);
635  void moveAfter(MachineBasicBlock *NewBefore);
636 
637  /// Returns true if this and MBB belong to the same section.
638  bool sameSection(const MachineBasicBlock *MBB) const {
639  return getSectionID() == MBB->getSectionID();
640  }
641 
642  /// Update the terminator instructions in block to account for changes to
643  /// block layout which may have been made. PreviousLayoutSuccessor should be
644  /// set to the block which may have been used as fallthrough before the block
645  /// layout was modified. If the block previously fell through to that block,
646  /// it may now need a branch. If it previously branched to another block, it
647  /// may now be able to fallthrough to the current layout successor.
648  void updateTerminator(MachineBasicBlock *PreviousLayoutSuccessor);
649 
650  // Machine-CFG mutators
651 
652  /// Add Succ as a successor of this MachineBasicBlock. The Predecessors list
653  /// of Succ is automatically updated. PROB parameter is stored in
654  /// Probabilities list. The default probability is set as unknown. Mixing
655  /// known and unknown probabilities in successor list is not allowed. When all
656  /// successors have unknown probabilities, 1 / N is returned as the
657  /// probability for each successor, where N is the number of successors.
658  ///
659  /// Note that duplicate Machine CFG edges are not allowed.
660  void addSuccessor(MachineBasicBlock *Succ,
662 
663  /// Add Succ as a successor of this MachineBasicBlock. The Predecessors list
664  /// of Succ is automatically updated. The probability is not provided because
665  /// BPI is not available (e.g. -O0 is used), in which case edge probabilities
666  /// won't be used. Using this interface can save some space.
668 
669  /// Set successor probability of a given iterator.
671 
672  /// Normalize probabilities of all successors so that the sum of them becomes
673  /// one. This is usually done when the current update on this MBB is done, and
674  /// the sum of its successors' probabilities is not guaranteed to be one. The
675  /// user is responsible for the correct use of this function.
676  /// MBB::removeSuccessor() has an option to do this automatically.
678  BranchProbability::normalizeProbabilities(Probs.begin(), Probs.end());
679  }
680 
681  /// Validate successors' probabilities and check if the sum of them is
682  /// approximate one. This only works in DEBUG mode.
683  void validateSuccProbs() const;
684 
685  /// Remove successor from the successors list of this MachineBasicBlock. The
686  /// Predecessors list of Succ is automatically updated.
687  /// If NormalizeSuccProbs is true, then normalize successors' probabilities
688  /// after the successor is removed.
690  bool NormalizeSuccProbs = false);
691 
692  /// Remove specified successor from the successors list of this
693  /// MachineBasicBlock. The Predecessors list of Succ is automatically updated.
694  /// If NormalizeSuccProbs is true, then normalize successors' probabilities
695  /// after the successor is removed.
696  /// Return the iterator to the element after the one removed.
698  bool NormalizeSuccProbs = false);
699 
700  /// Replace successor OLD with NEW and update probability info.
702 
703  /// Copy a successor (and any probability info) from original block to this
704  /// block's. Uses an iterator into the original blocks successors.
705  ///
706  /// This is useful when doing a partial clone of successors. Afterward, the
707  /// probabilities may need to be normalized.
709 
710  /// Split the old successor into old plus new and updates the probability
711  /// info.
713  bool NormalizeSuccProbs = false);
714 
715  /// Transfers all the successors from MBB to this machine basic block (i.e.,
716  /// copies all the successors FromMBB and remove all the successors from
717  /// FromMBB).
718  void transferSuccessors(MachineBasicBlock *FromMBB);
719 
720  /// Transfers all the successors, as in transferSuccessors, and update PHI
721  /// operands in the successor blocks which refer to FromMBB to refer to this.
723 
724  /// Return true if any of the successors have probabilities attached to them.
725  bool hasSuccessorProbabilities() const { return !Probs.empty(); }
726 
727  /// Return true if the specified MBB is a predecessor of this block.
728  bool isPredecessor(const MachineBasicBlock *MBB) const;
729 
730  /// Return true if the specified MBB is a successor of this block.
731  bool isSuccessor(const MachineBasicBlock *MBB) const;
732 
733  /// Return true if the specified MBB will be emitted immediately after this
734  /// block, such that if this block exits by falling through, control will
735  /// transfer to the specified MBB. Note that MBB need not be a successor at
736  /// all, for example if this block ends with an unconditional branch to some
737  /// other block.
738  bool isLayoutSuccessor(const MachineBasicBlock *MBB) const;
739 
740  /// Return the successor of this block if it has a single successor.
741  /// Otherwise return a null pointer.
742  ///
743  const MachineBasicBlock *getSingleSuccessor() const;
745  return const_cast<MachineBasicBlock *>(
746  static_cast<const MachineBasicBlock *>(this)->getSingleSuccessor());
747  }
748 
749  /// Return the fallthrough block if the block can implicitly
750  /// transfer control to the block after it by falling off the end of
751  /// it. This should return null if it can reach the block after
752  /// it, but it uses an explicit branch to do so (e.g., a table
753  /// jump). Non-null return is a conservative answer.
755 
756  /// Return true if the block can implicitly transfer control to the
757  /// block after it by falling off the end of it. This should return
758  /// false if it can reach the block after it, but it uses an
759  /// explicit branch to do so (e.g., a table jump). True is a
760  /// conservative answer.
761  bool canFallThrough();
762 
763  /// Returns a pointer to the first instruction in this block that is not a
764  /// PHINode instruction. When adding instructions to the beginning of the
765  /// basic block, they should be added before the returned value, not before
766  /// the first instruction, which might be PHI.
767  /// Returns end() is there's no non-PHI instruction.
769 
770  /// Return the first instruction in MBB after I that is not a PHI or a label.
771  /// This is the correct point to insert lowered copies at the beginning of a
772  /// basic block that must be before any debugging information.
774 
775  /// Return the first instruction in MBB after I that is not a PHI, label or
776  /// debug. This is the correct point to insert copies at the beginning of a
777  /// basic block.
778  iterator SkipPHIsLabelsAndDebug(iterator I, bool SkipPseudoOp = true);
779 
780  /// Returns an iterator to the first terminator instruction of this basic
781  /// block. If a terminator does not exist, it returns end().
784  return const_cast<MachineBasicBlock *>(this)->getFirstTerminator();
785  }
786 
787  /// Same getFirstTerminator but it ignores bundles and return an
788  /// instr_iterator instead.
790 
791  /// Returns an iterator to the first non-debug instruction in the basic block,
792  /// or end(). Skip any pseudo probe operation if \c SkipPseudoOp is true.
793  /// Pseudo probes are like debug instructions which do not turn into real
794  /// machine code. We try to use the function to skip both debug instructions
795  /// and pseudo probe operations to avoid API proliferation. This should work
796  /// most of the time when considering optimizing the rest of code in the
797  /// block, except for certain cases where pseudo probes are designed to block
798  /// the optimizations. For example, code merge like optimizations are supposed
799  /// to be blocked by pseudo probes for better AutoFDO profile quality.
800  /// Therefore, they should be considered as a valid instruction when this
801  /// function is called in a context of such optimizations. On the other hand,
802  /// \c SkipPseudoOp should be true when it's used in optimizations that
803  /// unlikely hurt profile quality, e.g., without block merging. The default
804  /// value of \c SkipPseudoOp is set to true to maximize code quality in
805  /// general, with an explict false value passed in in a few places like branch
806  /// folding and if-conversion to favor profile quality.
807  iterator getFirstNonDebugInstr(bool SkipPseudoOp = true);
808  const_iterator getFirstNonDebugInstr(bool SkipPseudoOp = true) const {
809  return const_cast<MachineBasicBlock *>(this)->getFirstNonDebugInstr(
810  SkipPseudoOp);
811  }
812 
813  /// Returns an iterator to the last non-debug instruction in the basic block,
814  /// or end(). Skip any pseudo operation if \c SkipPseudoOp is true.
815  /// Pseudo probes are like debug instructions which do not turn into real
816  /// machine code. We try to use the function to skip both debug instructions
817  /// and pseudo probe operations to avoid API proliferation. This should work
818  /// most of the time when considering optimizing the rest of code in the
819  /// block, except for certain cases where pseudo probes are designed to block
820  /// the optimizations. For example, code merge like optimizations are supposed
821  /// to be blocked by pseudo probes for better AutoFDO profile quality.
822  /// Therefore, they should be considered as a valid instruction when this
823  /// function is called in a context of such optimizations. On the other hand,
824  /// \c SkipPseudoOp should be true when it's used in optimizations that
825  /// unlikely hurt profile quality, e.g., without block merging. The default
826  /// value of \c SkipPseudoOp is set to true to maximize code quality in
827  /// general, with an explict false value passed in in a few places like branch
828  /// folding and if-conversion to favor profile quality.
829  iterator getLastNonDebugInstr(bool SkipPseudoOp = true);
830  const_iterator getLastNonDebugInstr(bool SkipPseudoOp = true) const {
831  return const_cast<MachineBasicBlock *>(this)->getLastNonDebugInstr(
832  SkipPseudoOp);
833  }
834 
835  /// Convenience function that returns true if the block ends in a return
836  /// instruction.
837  bool isReturnBlock() const {
838  return !empty() && back().isReturn();
839  }
840 
841  /// Convenience function that returns true if the bock ends in a EH scope
842  /// return instruction.
843  bool isEHScopeReturnBlock() const {
844  return !empty() && back().isEHScopeReturn();
845  }
846 
847  /// Split a basic block into 2 pieces at \p SplitPoint. A new block will be
848  /// inserted after this block, and all instructions after \p SplitInst moved
849  /// to it (\p SplitInst will be in the original block). If \p LIS is provided,
850  /// LiveIntervals will be appropriately updated. \return the newly inserted
851  /// block.
852  ///
853  /// If \p UpdateLiveIns is true, this will ensure the live ins list is
854  /// accurate, including for physreg uses/defs in the original block.
855  MachineBasicBlock *splitAt(MachineInstr &SplitInst, bool UpdateLiveIns = true,
856  LiveIntervals *LIS = nullptr);
857 
858  /// Split the critical edge from this block to the given successor block, and
859  /// return the newly created block, or null if splitting is not possible.
860  ///
861  /// This function updates LiveVariables, MachineDominatorTree, and
862  /// MachineLoopInfo, as applicable.
865  std::vector<SparseBitVector<>> *LiveInSets = nullptr);
866 
867  /// Check if the edge between this block and the given successor \p
868  /// Succ, can be split. If this returns true a subsequent call to
869  /// SplitCriticalEdge is guaranteed to return a valid basic block if
870  /// no changes occurred in the meantime.
871  bool canSplitCriticalEdge(const MachineBasicBlock *Succ) const;
872 
873  void pop_front() { Insts.pop_front(); }
874  void pop_back() { Insts.pop_back(); }
875  void push_back(MachineInstr *MI) { Insts.push_back(MI); }
876 
877  /// Insert MI into the instruction list before I, possibly inside a bundle.
878  ///
879  /// If the insertion point is inside a bundle, MI will be added to the bundle,
880  /// otherwise MI will not be added to any bundle. That means this function
881  /// alone can't be used to prepend or append instructions to bundles. See
882  /// MIBundleBuilder::insert() for a more reliable way of doing that.
884 
885  /// Insert a range of instructions into the instruction list before I.
886  template<typename IT>
887  void insert(iterator I, IT S, IT E) {
888  assert((I == end() || I->getParent() == this) &&
889  "iterator points outside of basic block");
890  Insts.insert(I.getInstrIterator(), S, E);
891  }
892 
893  /// Insert MI into the instruction list before I.
895  assert((I == end() || I->getParent() == this) &&
896  "iterator points outside of basic block");
897  assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
898  "Cannot insert instruction with bundle flags");
899  return Insts.insert(I.getInstrIterator(), MI);
900  }
901 
902  /// Insert MI into the instruction list after I.
904  assert((I == end() || I->getParent() == this) &&
905  "iterator points outside of basic block");
906  assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
907  "Cannot insert instruction with bundle flags");
908  return Insts.insertAfter(I.getInstrIterator(), MI);
909  }
910 
911  /// If I is bundled then insert MI into the instruction list after the end of
912  /// the bundle, otherwise insert MI immediately after I.
914  assert((I == instr_end() || I->getParent() == this) &&
915  "iterator points outside of basic block");
916  assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
917  "Cannot insert instruction with bundle flags");
918  while (I->isBundledWithSucc())
919  ++I;
920  return Insts.insertAfter(I, MI);
921  }
922 
923  /// Remove an instruction from the instruction list and delete it.
924  ///
925  /// If the instruction is part of a bundle, the other instructions in the
926  /// bundle will still be bundled after removing the single instruction.
928 
929  /// Remove an instruction from the instruction list and delete it.
930  ///
931  /// If the instruction is part of a bundle, the other instructions in the
932  /// bundle will still be bundled after removing the single instruction.
934  return erase(instr_iterator(I));
935  }
936 
937  /// Remove a range of instructions from the instruction list and delete them.
939  return Insts.erase(I.getInstrIterator(), E.getInstrIterator());
940  }
941 
942  /// Remove an instruction or bundle from the instruction list and delete it.
943  ///
944  /// If I points to a bundle of instructions, they are all erased.
946  return erase(I, std::next(I));
947  }
948 
949  /// Remove an instruction from the instruction list and delete it.
950  ///
951  /// If I is the head of a bundle of instructions, the whole bundle will be
952  /// erased.
954  return erase(iterator(I));
955  }
956 
957  /// Remove the unbundled instruction from the instruction list without
958  /// deleting it.
959  ///
960  /// This function can not be used to remove bundled instructions, use
961  /// remove_instr to remove individual instructions from a bundle.
963  assert(!I->isBundled() && "Cannot remove bundled instructions");
964  return Insts.remove(instr_iterator(I));
965  }
966 
967  /// Remove the possibly bundled instruction from the instruction list
968  /// without deleting it.
969  ///
970  /// If the instruction is part of a bundle, the other instructions in the
971  /// bundle will still be bundled after removing the single instruction.
973 
974  void clear() {
975  Insts.clear();
976  }
977 
978  /// Take an instruction from MBB 'Other' at the position From, and insert it
979  /// into this MBB right before 'Where'.
980  ///
981  /// If From points to a bundle of instructions, the whole bundle is moved.
983  // The range splice() doesn't allow noop moves, but this one does.
984  if (Where != From)
985  splice(Where, Other, From, std::next(From));
986  }
987 
988  /// Take a block of instructions from MBB 'Other' in the range [From, To),
989  /// and insert them into this MBB right before 'Where'.
990  ///
991  /// The instruction at 'Where' must not be included in the range of
992  /// instructions to move.
993  void splice(iterator Where, MachineBasicBlock *Other,
994  iterator From, iterator To) {
995  Insts.splice(Where.getInstrIterator(), Other->Insts,
996  From.getInstrIterator(), To.getInstrIterator());
997  }
998 
999  /// This method unlinks 'this' from the containing function, and returns it,
1000  /// but does not delete it.
1002 
1003  /// This method unlinks 'this' from the containing function and deletes it.
1004  void eraseFromParent();
1005 
1006  /// Given a machine basic block that branched to 'Old', change the code and
1007  /// CFG so that it branches to 'New' instead.
1009 
1010  /// Update all phi nodes in this basic block to refer to basic block \p New
1011  /// instead of basic block \p Old.
1013 
1014  /// Find the next valid DebugLoc starting at MBBI, skipping any DBG_VALUE
1015  /// and DBG_LABEL instructions. Return UnknownLoc if there is none.
1018  return findDebugLoc(MBBI.getInstrIterator());
1019  }
1020 
1021  /// Has exact same behavior as @ref findDebugLoc (it also
1022  /// searches from the first to the last MI of this MBB) except
1023  /// that this takes reverse iterator.
1026  return rfindDebugLoc(MBBI.getInstrIterator());
1027  }
1028 
1029  /// Find the previous valid DebugLoc preceding MBBI, skipping and DBG_VALUE
1030  /// instructions. Return UnknownLoc if there is none.
1033  return findPrevDebugLoc(MBBI.getInstrIterator());
1034  }
1035 
1036  /// Has exact same behavior as @ref findPrevDebugLoc (it also
1037  /// searches from the last to the first MI of this MBB) except
1038  /// that this takes reverse iterator.
1041  return rfindPrevDebugLoc(MBBI.getInstrIterator());
1042  }
1043 
1044  /// Find and return the merged DebugLoc of the branch instructions of the
1045  /// block. Return UnknownLoc if there is none.
1047 
1048  /// Possible outcome of a register liveness query to computeRegisterLiveness()
1050  LQR_Live, ///< Register is known to be (at least partially) live.
1051  LQR_Dead, ///< Register is known to be fully dead.
1052  LQR_Unknown ///< Register liveness not decidable from local neighborhood.
1053  };
1054 
1055  /// Return whether (physical) register \p Reg has been defined and not
1056  /// killed as of just before \p Before.
1057  ///
1058  /// Search is localised to a neighborhood of \p Neighborhood instructions
1059  /// before (searching for defs or kills) and \p Neighborhood instructions
1060  /// after (searching just for defs) \p Before.
1061  ///
1062  /// \p Reg must be a physical register.
1064  MCRegister Reg,
1065  const_iterator Before,
1066  unsigned Neighborhood = 10) const;
1067 
1068  // Debugging methods.
1069  void dump() const;
1070  void print(raw_ostream &OS, const SlotIndexes * = nullptr,
1071  bool IsStandalone = true) const;
1072  void print(raw_ostream &OS, ModuleSlotTracker &MST,
1073  const SlotIndexes * = nullptr, bool IsStandalone = true) const;
1074 
1076  PrintNameIr = (1 << 0), ///< Add IR name where available
1077  PrintNameAttributes = (1 << 1), ///< Print attributes
1078  };
1079 
1080  void printName(raw_ostream &os, unsigned printNameFlags = PrintNameIr,
1081  ModuleSlotTracker *moduleSlotTracker = nullptr) const;
1082 
1083  // Printing method used by LoopInfo.
1084  void printAsOperand(raw_ostream &OS, bool PrintType = true) const;
1085 
1086  /// MachineBasicBlocks are uniquely numbered at the function level, unless
1087  /// they're not in a MachineFunction yet, in which case this will return -1.
1088  int getNumber() const { return Number; }
1089  void setNumber(int N) { Number = N; }
1090 
1091  /// Return the MCSymbol for this basic block.
1092  MCSymbol *getSymbol() const;
1093 
1094  /// Return the EHCatchret Symbol for this basic block.
1095  MCSymbol *getEHCatchretSymbol() const;
1096 
1098  return IrrLoopHeaderWeight;
1099  }
1100 
1102  IrrLoopHeaderWeight = Weight;
1103  }
1104 
1105  /// Return probability of the edge from this block to MBB. This method should
1106  /// NOT be called directly, but by using getEdgeProbability method from
1107  /// MachineBranchProbabilityInfo class.
1109 
1110 private:
1111  /// Return probability iterator corresponding to the I successor iterator.
1112  probability_iterator getProbabilityIterator(succ_iterator I);
1113  const_probability_iterator
1114  getProbabilityIterator(const_succ_iterator I) const;
1115 
1117  friend class MIPrinter;
1118 
1119  // Methods used to maintain doubly linked list of blocks...
1121 
1122  // Machine-CFG mutators
1123 
1124  /// Add Pred as a predecessor of this MachineBasicBlock. Don't do this
1125  /// unless you know what you're doing, because it doesn't update Pred's
1126  /// successors list. Use Pred->addSuccessor instead.
1127  void addPredecessor(MachineBasicBlock *Pred);
1128 
1129  /// Remove Pred as a predecessor of this MachineBasicBlock. Don't do this
1130  /// unless you know what you're doing, because it doesn't update Pred's
1131  /// successors list. Use Pred->removeSuccessor instead.
1132  void removePredecessor(MachineBasicBlock *Pred);
1133 };
1134 
1136 
1137 /// Prints a machine basic block reference.
1138 ///
1139 /// The format is:
1140 /// %bb.5 - a machine basic block with MBB.getNumber() == 5.
1141 ///
1142 /// Usage: OS << printMBBReference(MBB) << '\n';
1144 
1145 // This is useful when building IndexedMaps keyed on basic block pointers.
1148  unsigned operator()(const MachineBasicBlock *MBB) const {
1149  return MBB->getNumber();
1150  }
1151 };
1152 
1153 //===--------------------------------------------------------------------===//
1154 // GraphTraits specializations for machine basic block graphs (machine-CFGs)
1155 //===--------------------------------------------------------------------===//
1156 
1157 // Provide specializations of GraphTraits to be able to treat a
1158 // MachineFunction as a graph of MachineBasicBlocks.
1159 //
1160 
1161 template <> struct GraphTraits<MachineBasicBlock *> {
1164 
1166  static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); }
1167  static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
1168 };
1169 
1170 template <> struct GraphTraits<const MachineBasicBlock *> {
1171  using NodeRef = const MachineBasicBlock *;
1173 
1174  static NodeRef getEntryNode(const MachineBasicBlock *BB) { return BB; }
1175  static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); }
1176  static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
1177 };
1178 
1179 // Provide specializations of GraphTraits to be able to treat a
1180 // MachineFunction as a graph of MachineBasicBlocks and to walk it
1181 // in inverse order. Inverse order for a function is considered
1182 // to be when traversing the predecessor edges of a MBB
1183 // instead of the successor edges.
1184 //
1185 template <> struct GraphTraits<Inverse<MachineBasicBlock*>> {
1188 
1190  return G.Graph;
1191  }
1192 
1193  static ChildIteratorType child_begin(NodeRef N) { return N->pred_begin(); }
1194  static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
1195 };
1196 
1198  using NodeRef = const MachineBasicBlock *;
1200 
1202  return G.Graph;
1203  }
1204 
1205  static ChildIteratorType child_begin(NodeRef N) { return N->pred_begin(); }
1206  static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
1207 };
1208 
1209 /// MachineInstrSpan provides an interface to get an iteration range
1210 /// containing the instruction it was initialized with, along with all
1211 /// those instructions inserted prior to or following that instruction
1212 /// at some point after the MachineInstrSpan is constructed.
1214  MachineBasicBlock &MBB;
1216 
1217 public:
1219  : MBB(*BB), I(I), B(I == MBB.begin() ? MBB.end() : std::prev(I)),
1220  E(std::next(I)) {
1221  assert(I == BB->end() || I->getParent() == BB);
1222  }
1223 
1225  return B == MBB.end() ? MBB.begin() : std::next(B);
1226  }
1228  bool empty() { return begin() == end(); }
1229 
1231 };
1232 
1233 /// Increment \p It until it points to a non-debug instruction or to \p End
1234 /// and return the resulting iterator. This function should only be used
1235 /// MachineBasicBlock::{iterator, const_iterator, instr_iterator,
1236 /// const_instr_iterator} and the respective reverse iterators.
1237 template <typename IterT>
1238 inline IterT skipDebugInstructionsForward(IterT It, IterT End,
1239  bool SkipPseudoOp = true) {
1240  while (It != End &&
1241  (It->isDebugInstr() || (SkipPseudoOp && It->isPseudoProbe())))
1242  ++It;
1243  return It;
1244 }
1245 
1246 /// Decrement \p It until it points to a non-debug instruction or to \p Begin
1247 /// and return the resulting iterator. This function should only be used
1248 /// MachineBasicBlock::{iterator, const_iterator, instr_iterator,
1249 /// const_instr_iterator} and the respective reverse iterators.
1250 template <class IterT>
1251 inline IterT skipDebugInstructionsBackward(IterT It, IterT Begin,
1252  bool SkipPseudoOp = true) {
1253  while (It != Begin &&
1254  (It->isDebugInstr() || (SkipPseudoOp && It->isPseudoProbe())))
1255  --It;
1256  return It;
1257 }
1258 
1259 /// Increment \p It, then continue incrementing it while it points to a debug
1260 /// instruction. A replacement for std::next.
1261 template <typename IterT>
1262 inline IterT next_nodbg(IterT It, IterT End, bool SkipPseudoOp = true) {
1263  return skipDebugInstructionsForward(std::next(It), End, SkipPseudoOp);
1264 }
1265 
1266 /// Decrement \p It, then continue decrementing it while it points to a debug
1267 /// instruction. A replacement for std::prev.
1268 template <typename IterT>
1269 inline IterT prev_nodbg(IterT It, IterT Begin, bool SkipPseudoOp = true) {
1270  return skipDebugInstructionsBackward(std::prev(It), Begin, SkipPseudoOp);
1271 }
1272 
1273 /// Construct a range iterator which begins at \p It and moves forwards until
1274 /// \p End is reached, skipping any debug instructions.
1275 template <typename IterT>
1276 inline auto instructionsWithoutDebug(IterT It, IterT End,
1277  bool SkipPseudoOp = true) {
1278  return make_filter_range(make_range(It, End), [=](const MachineInstr &MI) {
1279  return !MI.isDebugInstr() && !(SkipPseudoOp && MI.isPseudoProbe());
1280  });
1281 }
1282 
1283 } // end namespace llvm
1284 
1285 #endif // LLVM_CODEGEN_MACHINEBASICBLOCK_H
llvm::LaneBitmask
Definition: LaneBitmask.h:40
llvm::SuccIterator
Definition: CFG.h:138
llvm::next_nodbg
IterT next_nodbg(IterT It, IterT End, bool SkipPseudoOp=true)
Increment It, then continue incrementing it while it points to a debug instruction.
Definition: MachineBasicBlock.h:1262
llvm::MachineBasicBlock::RegisterMaskPair::PhysReg
MCPhysReg PhysReg
Definition: MachineBasicBlock.h:102
llvm::MBBSectionID::operator==
bool operator==(const MBBSectionID &Other) const
Definition: MachineBasicBlock.h:66
llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition: MachineBasicBlock.h:1206
const_iterator
llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::getEntryNode
static NodeRef getEntryNode(Inverse< const MachineBasicBlock * > G)
Definition: MachineBasicBlock.h:1201
llvm::MachineBasicBlock::succ_size
unsigned succ_size() const
Definition: MachineBasicBlock.h:354
llvm::MachineBasicBlock::terminators
iterator_range< const_iterator > terminators() const
Definition: MachineBasicBlock.h:301
llvm::MachineBasicBlock::pred_begin
pred_iterator pred_begin()
Definition: MachineBasicBlock.h:326
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:104
MachineInstr.h
llvm::MachineBasicBlock::setIrrLoopHeaderWeight
void setIrrLoopHeaderWeight(uint64_t Weight)
Definition: MachineBasicBlock.h:1101
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::MachineBasicBlock::rend
const_reverse_iterator rend() const
Definition: MachineBasicBlock.h:289
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::MachineBasicBlock::splice
void splice(iterator Where, MachineBasicBlock *Other, iterator From, iterator To)
Take a block of instructions from MBB 'Other' in the range [From, To), and insert them into this MBB ...
Definition: MachineBasicBlock.h:993
Pass
print lazy value Lazy Value Info Printer Pass
Definition: LazyValueInfo.cpp:1979
llvm::make_range
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Definition: iterator_range.h:53
llvm::MachineBasicBlock::isLiveIn
bool isLiveIn(MCPhysReg Reg, LaneBitmask LaneMask=LaneBitmask::getAll()) const
Return true if the specified register is in the live in set.
Definition: MachineBasicBlock.cpp:576
llvm::MachineBasicBlock::setIsCleanupFuncletEntry
void setIsCleanupFuncletEntry(bool V=true)
Indicates if this is the entry block of a cleanup funclet.
Definition: MachineBasicBlock.h:584
llvm::MachineBasicBlock::LivenessQueryResult
LivenessQueryResult
Possible outcome of a register liveness query to computeRegisterLiveness()
Definition: MachineBasicBlock.h:1049
llvm::MachineBasicBlock::getBasicBlock
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
Definition: MachineBasicBlock.h:205
llvm::MBBSectionID::Exception
@ Exception
Definition: MachineBasicBlock.h:55
llvm::MachineBasicBlock::PrintNameFlag
PrintNameFlag
Definition: MachineBasicBlock.h:1075
llvm::MachineBasicBlock::erase
iterator erase(iterator I)
Remove an instruction or bundle from the instruction list and delete it.
Definition: MachineBasicBlock.h:945
llvm::MachineBasicBlock::ReplaceUsesOfBlockWith
void ReplaceUsesOfBlockWith(MachineBasicBlock *Old, MachineBasicBlock *New)
Given a machine basic block that branched to 'Old', change the code and CFG so that it branches to 'N...
Definition: MachineBasicBlock.cpp:1339
llvm::MachineInstrSpan
MachineInstrSpan provides an interface to get an iteration range containing the instruction it was in...
Definition: MachineBasicBlock.h:1213
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::MachineBasicBlock::instrs
instr_range instrs()
Definition: MachineBasicBlock.h:273
llvm::MachineBasicBlock::clear
void clear()
Definition: MachineBasicBlock.h:974
llvm::MachineInstr::isEHScopeReturn
bool isEHScopeReturn(QueryType Type=AnyInBundle) const
Return true if this is an instruction that marks the end of an EH scope, i.e., a catchpad or a cleanu...
Definition: MachineInstr.h:826
llvm::MachineBasicBlock::isEHFuncletEntry
bool isEHFuncletEntry() const
Returns true if this is the entry block of an EH funclet.
Definition: MachineBasicBlock.h:575
ilist.h
llvm::MachineBasicBlock::erase
iterator erase(iterator I, iterator E)
Remove a range of instructions from the instruction list and delete them.
Definition: MachineBasicBlock.h:938
llvm::MachineBasicBlock::instrs
const_instr_range instrs() const
Definition: MachineBasicBlock.h:274
llvm::MachineBasicBlock::insertAfterBundle
instr_iterator insertAfterBundle(instr_iterator I, MachineInstr *MI)
If I is bundled then insert MI into the instruction list after the end of the bundle,...
Definition: MachineBasicBlock.h:913
llvm::printMBBReference
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
Definition: MachineBasicBlock.cpp:116
llvm::MachineBasicBlock::setIsEHCatchretTarget
void setIsEHCatchretTarget(bool V=true)
Indicates if this is a target block of a catchret.
Definition: MachineBasicBlock.h:572
llvm::ilist_node_with_parent
An ilist node that can access its parent list.
Definition: ilist_node.h:257
llvm::MachineBasicBlock::sizeWithoutDebugLargerThan
bool sizeWithoutDebugLargerThan(unsigned Limit) const
Definition: MachineBasicBlock.cpp:1624
llvm::X86Disassembler::Reg
Reg
All possible values of the reg field in the ModR/M byte.
Definition: X86DisassemblerDecoder.h:462
llvm::MachineBasicBlock::isEntryBlock
bool isEntryBlock() const
Returns true if this is the entry block of the function.
Definition: MachineBasicBlock.cpp:286
llvm::MachineBasicBlock::setSuccProbability
void setSuccProbability(succ_iterator I, BranchProbability Prob)
Set successor probability of a given iterator.
Definition: MachineBasicBlock.cpp:1451
llvm::MachineBasicBlock::getEHCatchretSymbol
MCSymbol * getEHCatchretSymbol() const
Return the EHCatchret Symbol for this basic block.
Definition: MachineBasicBlock.cpp:88
llvm::MachineBasicBlock::isReturnBlock
bool isReturnBlock() const
Convenience function that returns true if the block ends in a return instruction.
Definition: MachineBasicBlock.h:837
llvm::iplist_impl< simple_ilist< T, Options... >, ilist_traits< T > >::const_reverse_iterator
base_list_type::const_reverse_iterator const_reverse_iterator
Definition: ilist.h:182
llvm::MachineBasicBlock::const_pred_iterator
std::vector< MachineBasicBlock * >::const_iterator const_pred_iterator
Definition: MachineBasicBlock.h:315
IT
static cl::opt< ITMode > IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT), cl::values(clEnumValN(DefaultIT, "arm-default-it", "Generate any type of IT block"), clEnumValN(RestrictedIT, "arm-restrict-it", "Disallow complex IT blocks")))
llvm::ilist_callback_traits
Callbacks do nothing by default in iplist and ilist.
Definition: ilist.h:65
llvm::MachineBasicBlock::findDebugLoc
DebugLoc findDebugLoc(instr_iterator MBBI)
Find the next valid DebugLoc starting at MBBI, skipping any DBG_VALUE and DBG_LABEL instructions.
Definition: MachineBasicBlock.cpp:1373
llvm::TargetRegisterInfo
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Definition: TargetRegisterInfo.h:234
llvm::MachineBasicBlock::livein_iterator
LiveInVector::const_iterator livein_iterator
Definition: MachineBasicBlock.h:408
llvm::MachineBasicBlock::succ_rend
const_succ_reverse_iterator succ_rend() const
Definition: MachineBasicBlock.h:352
llvm::GraphTraits< const MachineBasicBlock * >::getEntryNode
static NodeRef getEntryNode(const MachineBasicBlock *BB)
Definition: MachineBasicBlock.h:1174
llvm::MachineBasicBlock::moveBefore
void moveBefore(MachineBasicBlock *NewAfter)
Move 'this' block before or after the specified block.
Definition: MachineBasicBlock.cpp:634
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::MachineBasicBlock::liveins
iterator_range< livein_iterator > liveins() const
Definition: MachineBasicBlock.h:422
llvm::MachineBasicBlock::liveout_iterator::operator*
reference operator*() const
Definition: MachineBasicBlock.h:471
llvm::MBBSectionID::Number
unsigned Number
Definition: MachineBasicBlock.h:58
llvm::Optional< uint64_t >
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::MachineBasicBlock::getIrrLoopHeaderWeight
Optional< uint64_t > getIrrLoopHeaderWeight() const
Definition: MachineBasicBlock.h:1097
llvm::GraphTraits< const MachineBasicBlock * >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition: MachineBasicBlock.h:1176
llvm::MachineBasicBlock::front
const MachineInstr & front() const
Definition: MachineBasicBlock.h:259
llvm::MachineBasicBlock::back
MachineInstr & back()
Definition: MachineBasicBlock.h:258
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition: MachineBasicBlock.h:1193
RHS
Value * RHS
Definition: X86PartialReduction.cpp:76
llvm::MachineBasicBlock::addSuccessorWithoutProb
void addSuccessorWithoutProb(MachineBasicBlock *Succ)
Add Succ as a successor of this MachineBasicBlock.
Definition: MachineBasicBlock.cpp:757
llvm::MachineBasicBlock::successors
iterator_range< const_succ_iterator > successors() const
Definition: MachineBasicBlock.h:368
llvm::MachineBasicBlock::terminators
iterator_range< iterator > terminators()
Definition: MachineBasicBlock.h:298
llvm::MBBSectionID
Definition: MachineBasicBlock.h:51
llvm::MachineBasicBlock::clearBasicBlock
void clearBasicBlock()
Remove the reference to the underlying IR BasicBlock.
Definition: MachineBasicBlock.h:209
llvm::MachineBasicBlock::rfindPrevDebugLoc
DebugLoc rfindPrevDebugLoc(reverse_iterator MBBI)
Definition: MachineBasicBlock.h:1040
llvm::MachineBasicBlock::copySuccessor
void copySuccessor(MachineBasicBlock *Orig, succ_iterator I)
Copy a successor (and any probability info) from original block to this block's.
Definition: MachineBasicBlock.cpp:848
llvm::MachineBasicBlock::insert
iterator insert(iterator I, MachineInstr *MI)
Insert MI into the instruction list before I.
Definition: MachineBasicBlock.h:894
llvm::MachineBasicBlock::succ_reverse_iterator
std::vector< MachineBasicBlock * >::reverse_iterator succ_reverse_iterator
Definition: MachineBasicBlock.h:323
llvm::ModuleSlotTracker
Manage lifetime of a slot tracker for printing IR.
Definition: ModuleSlotTracker.h:44
TRI
unsigned const TargetRegisterInfo * TRI
Definition: MachineSink.cpp:1628
llvm::GraphTraits< const MachineBasicBlock * >::ChildIteratorType
MachineBasicBlock::const_succ_iterator ChildIteratorType
Definition: MachineBasicBlock.h:1172
llvm::GraphTraits< MachineBasicBlock * >::getEntryNode
static NodeRef getEntryNode(MachineBasicBlock *BB)
Definition: MachineBasicBlock.h:1165
llvm::iplist
An intrusive list with ownership and callbacks specified/controlled by ilist_traits,...
Definition: ilist.h:391
llvm::MachineBasicBlock::succ_rbegin
succ_reverse_iterator succ_rbegin()
Definition: MachineBasicBlock.h:346
llvm::MachineBasicBlock::const_instr_iterator
Instructions::const_iterator const_instr_iterator
Definition: MachineBasicBlock.h:238
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:55
llvm::MachineBasicBlock::pop_back
void pop_back()
Definition: MachineBasicBlock.h:874
llvm::MachineBasicBlock::dump
void dump() const
Definition: MachineBasicBlock.cpp:291
llvm::MachineBasicBlock::const_instr_range
iterator_range< const_instr_iterator > const_instr_range
Definition: MachineBasicBlock.h:272
llvm::MachineBasicBlock::erase
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
Definition: MachineBasicBlock.cpp:1299
llvm::MachineBasicBlock::isBeginSection
bool isBeginSection() const
Returns true if this block begins any section.
Definition: MachineBasicBlock.h:587
llvm::MachineBasicBlock::succ_rbegin
const_succ_reverse_iterator succ_rbegin() const
Definition: MachineBasicBlock.h:348
llvm::MachineBasicBlock::printName
void printName(raw_ostream &os, unsigned printNameFlags=PrintNameIr, ModuleSlotTracker *moduleSlotTracker=nullptr) const
Print the basic block's name as:
Definition: MachineBasicBlock.cpp:474
GraphTraits.h
llvm::MachineBasicBlock::liveout_iterator::operator++
liveout_iterator & operator++()
Definition: MachineBasicBlock.h:454
SparseBitVector.h
llvm::MachineBasicBlock::setSectionID
void setSectionID(MBBSectionID V)
Sets the section ID for this basic block.
Definition: MachineBasicBlock.h:606
llvm::MachineBasicBlock::addSuccessor
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
Definition: MachineBasicBlock.cpp:747
llvm::MachineBasicBlock::getSymbol
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Definition: MachineBasicBlock.cpp:57
llvm::MachineBasicBlock::reverse_iterator
MachineInstrBundleIterator< MachineInstr, true > reverse_iterator
Definition: MachineBasicBlock.h:244
llvm::MachineBasicBlock::instr_end
const_instr_iterator instr_end() const
Definition: MachineBasicBlock.h:265
llvm::MachineBasicBlock::push_back
void push_back(MachineInstr *MI)
Definition: MachineBasicBlock.h:875
llvm::MachineBasicBlock::pred_size
unsigned pred_size() const
Definition: MachineBasicBlock.h:338
llvm::MachineBasicBlock::liveouts
iterator_range< liveout_iterator > liveouts() const
Definition: MachineBasicBlock.h:516
llvm::SparseBitVector
Definition: SparseBitVector.h:256
llvm::MachineBasicBlock::setIsInlineAsmBrIndirectTarget
void setIsInlineAsmBrIndirectTarget(bool V=true)
Indicates if this is the indirect dest of an INLINEASM_BR.
Definition: MachineBasicBlock.h:622
llvm::MachineBasicBlock::getFirstInstrTerminator
instr_iterator getFirstInstrTerminator()
Same getFirstTerminator but it ignores bundles and return an instr_iterator instead.
Definition: MachineBasicBlock.cpp:247
llvm::MachineBasicBlock::getSingleSuccessor
MachineBasicBlock * getSingleSuccessor()
Definition: MachineBasicBlock.h:744
llvm::MachineBasicBlock::insertAfter
iterator insertAfter(iterator I, MachineInstr *MI)
Insert MI into the instruction list after I.
Definition: MachineBasicBlock.h:903
llvm::MachineBasicBlock::removeFromParent
MachineBasicBlock * removeFromParent()
This method unlinks 'this' from the containing function, and returns it, but does not delete it.
Definition: MachineBasicBlock.cpp:1325
llvm::MachineBasicBlock::remove
MachineInstr * remove(MachineInstr *I)
Remove the unbundled instruction from the instruction list without deleting it.
Definition: MachineBasicBlock.h:962
llvm::MachineBranchProbabilityInfo
Definition: MachineBranchProbabilityInfo.h:22
llvm::MachineBasicBlock::liveout_iterator::operator++
liveout_iterator operator++(int)
Definition: MachineBasicBlock.h:465
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::MachineBasicBlock::succ_end
succ_iterator succ_end()
Definition: MachineBasicBlock.h:344
llvm::MBBSectionID::SectionType
SectionType
Definition: MachineBasicBlock.h:52
llvm::MachineBasicBlock::MachineFunction
friend class MachineFunction
Definition: MachineBasicBlock.h:199
llvm::MachineBasicBlock::getMaxBytesForAlignment
unsigned getMaxBytesForAlignment() const
Return the maximum amount of padding allowed for aligning the basic block.
Definition: MachineBasicBlock.h:540
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition: MachineBasicBlock.h:1194
llvm::MachineBasicBlock::isSuccessor
bool isSuccessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB is a successor of this block.
Definition: MachineBasicBlock.cpp:909
llvm::MachineBasicBlock::eraseFromParent
void eraseFromParent()
This method unlinks 'this' from the containing function and deletes it.
Definition: MachineBasicBlock.cpp:1332
llvm::TargetRegisterClass
Definition: TargetRegisterInfo.h:45
llvm::MBBSectionID::Default
@ Default
Definition: MachineBasicBlock.h:53
llvm::MachineBasicBlock::setMaxBytesForAlignment
void setMaxBytesForAlignment(unsigned MaxBytes)
Set the maximum amount of padding allowed for aligning the basic block.
Definition: MachineBasicBlock.h:543
llvm::MachineBasicBlock::pred_begin
const_pred_iterator pred_begin() const
Definition: MachineBasicBlock.h:327
First
into llvm powi allowing the code generator to produce balanced multiplication trees First
Definition: README.txt:54
llvm::MachineBasicBlock::isLegalToHoistInto
bool isLegalToHoistInto() const
Returns true if it is legal to hoist instructions into this block.
Definition: MachineBasicBlock.cpp:304
llvm::MachineBasicBlock::RegisterMaskPair
Pair of physical register and lane mask.
Definition: MachineBasicBlock.h:100
llvm::MBBSectionID::Cold
@ Cold
Definition: MachineBasicBlock.h:56
llvm::MachineBasicBlock::rend
reverse_iterator rend()
Definition: MachineBasicBlock.h:288
llvm::MachineBasicBlock::const_succ_reverse_iterator
std::vector< MachineBasicBlock * >::const_reverse_iterator const_succ_reverse_iterator
Definition: MachineBasicBlock.h:325
llvm::MachineBasicBlock::pred_rbegin
pred_reverse_iterator pred_rbegin()
Definition: MachineBasicBlock.h:330
llvm::MachineBasicBlock::splitAt
MachineBasicBlock * splitAt(MachineInstr &SplitInst, bool UpdateLiveIns=true, LiveIntervals *LIS=nullptr)
Split a basic block into 2 pieces at SplitPoint.
Definition: MachineBasicBlock.cpp:970
llvm::MachineBasicBlock::isEHCatchretTarget
bool isEHCatchretTarget() const
Returns true if this is a target block of a catchret.
Definition: MachineBasicBlock.h:569
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
llvm::MachineBasicBlock::instr_back
MachineInstr & instr_back()
Definition: MachineBasicBlock.h:253
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:230
llvm::SlotIndexes
SlotIndexes pass.
Definition: SlotIndexes.h:313
llvm::MachineInstrSpan::begin
MachineBasicBlock::iterator begin()
Definition: MachineBasicBlock.h:1224
DebugLoc.h
llvm::MachineBasicBlock::isCleanupFuncletEntry
bool isCleanupFuncletEntry() const
Returns true if this is the entry block of a cleanup funclet.
Definition: MachineBasicBlock.h:581
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::MachineInstrSpan::end
MachineBasicBlock::iterator end()
Definition: MachineBasicBlock.h:1227
llvm::BranchProbability::getUnknown
static BranchProbability getUnknown()
Definition: BranchProbability.h:51
llvm::MachineBasicBlock::getLastNonDebugInstr
const_iterator getLastNonDebugInstr(bool SkipPseudoOp=true) const
Definition: MachineBasicBlock.h:830
llvm::iplist_impl< simple_ilist< T, Options... >, ilist_traits< T > >::reverse_iterator
base_list_type::reverse_iterator reverse_iterator
Definition: ilist.h:180
BranchProbability.h
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:94
llvm::MachineBasicBlock::isEHScopeReturnBlock
bool isEHScopeReturnBlock() const
Convenience function that returns true if the bock ends in a EH scope return instruction.
Definition: MachineBasicBlock.h:843
llvm::MachineBasicBlock::findPrevDebugLoc
DebugLoc findPrevDebugLoc(instr_iterator MBBI)
Find the previous valid DebugLoc preceding MBBI, skipping and DBG_VALUE instructions.
Definition: MachineBasicBlock.cpp:1391
llvm::GraphTraits< MachineBasicBlock * >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition: MachineBasicBlock.h:1166
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::ChildIteratorType
MachineBasicBlock::pred_iterator ChildIteratorType
Definition: MachineBasicBlock.h:1187
llvm::MachineBasicBlock::getSectionIDNum
unsigned getSectionIDNum() const
Returns the unique section ID number of this basic block.
Definition: MachineBasicBlock.h:600
llvm::MachineBasicBlock::setAlignment
void setAlignment(Align A)
Set alignment of the basic block.
Definition: MachineBasicBlock.h:532
llvm::ilist_traits
Template traits for intrusive list.
Definition: ilist.h:90
llvm::MachineBasicBlock::back
const MachineInstr & back() const
Definition: MachineBasicBlock.h:260
llvm::MachineInstrBundleIterator::getInstrIterator
instr_iterator getInstrIterator() const
Definition: MachineInstrBundleIterator.h:274
G
const DataFlowGraph & G
Definition: RDFGraph.cpp:200
llvm::MachineInstrSpan::getInitial
MachineBasicBlock::iterator getInitial()
Definition: MachineBasicBlock.h:1230
llvm::MachineBasicBlock::succ_iterator
std::vector< MachineBasicBlock * >::iterator succ_iterator
Definition: MachineBasicBlock.h:316
llvm::MachineBasicBlock::getSuccProbability
BranchProbability getSuccProbability(const_succ_iterator Succ) const
Return probability of the edge from this block to MBB.
Definition: MachineBasicBlock.cpp:1429
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::getEntryNode
static NodeRef getEntryNode(Inverse< MachineBasicBlock * > G)
Definition: MachineBasicBlock.h:1189
llvm::MachineInstrSpan::empty
bool empty()
Definition: MachineBasicBlock.h:1228
llvm::MachineBasicBlock::hasSuccessorProbabilities
bool hasSuccessorProbabilities() const
Return true if any of the successors have probabilities attached to them.
Definition: MachineBasicBlock.h:725
llvm::MachineBasicBlock::mayHaveInlineAsmBr
bool mayHaveInlineAsmBr() const
Returns true if this block may have an INLINEASM_BR (overestimate, by checking if any of the successo...
Definition: MachineBasicBlock.cpp:296
llvm::MachineBasicBlock::printAsOperand
void printAsOperand(raw_ostream &OS, bool PrintType=true) const
Definition: MachineBasicBlock.cpp:552
llvm::MachineBasicBlock::instr_back
const MachineInstr & instr_back() const
Definition: MachineBasicBlock.h:255
llvm::MachineBasicBlock::liveout_iterator::operator==
bool operator==(const liveout_iterator &RHS) const
Definition: MachineBasicBlock.h:479
llvm::MachineBasicBlock::setAlignment
void setAlignment(Align A, unsigned MaxBytes)
Definition: MachineBasicBlock.h:534
llvm::MachineBasicBlock::pred_end
pred_iterator pred_end()
Definition: MachineBasicBlock.h:328
llvm::MachineBasicBlock::instr_rend
reverse_instr_iterator instr_rend()
Definition: MachineBasicBlock.h:268
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:66
uint64_t
llvm::MachineBasicBlock::hasAddressTaken
bool hasAddressTaken() const
Test whether this block is potentially the target of an indirect branch.
Definition: MachineBasicBlock.h:220
const
aarch64 promote const
Definition: AArch64PromoteConstant.cpp:232
llvm::MachineBasicBlock::setIsEHPad
void setIsEHPad(bool V=true)
Indicates the block is a landing pad.
Definition: MachineBasicBlock.h:553
llvm::MachineBasicBlock::getSingleSuccessor
const MachineBasicBlock * getSingleSuccessor() const
Return the successor of this block if it has a single successor.
Definition: MachineBasicBlock.cpp:918
llvm::iplist_impl< simple_ilist< T, Options... >, ilist_traits< T > >::iterator
base_list_type::iterator iterator
Definition: ilist.h:178
llvm::MachineInstrBundleIterator::getAtBundleBegin
static MachineInstrBundleIterator getAtBundleBegin(instr_iterator MI)
Get the bundle iterator for the given instruction's bundle.
Definition: MachineInstrBundleIterator.h:174
llvm::MachineBasicBlock::end
const_iterator end() const
Definition: MachineBasicBlock.h:281
llvm::MachineBasicBlock::SkipPHIsAndLabels
iterator SkipPHIsAndLabels(iterator I)
Return the first instruction in MBB after I that is not a PHI or a label.
Definition: MachineBasicBlock.cpp:206
llvm::MachineBasicBlock::instr_rbegin
reverse_instr_iterator instr_rbegin()
Definition: MachineBasicBlock.h:266
llvm::MachineBasicBlock::LQR_Live
@ LQR_Live
Register is known to be (at least partially) live.
Definition: MachineBasicBlock.h:1050
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::MCPhysReg
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
Definition: MCRegister.h:21
llvm::MachineBasicBlock::getFirstTerminator
const_iterator getFirstTerminator() const
Definition: MachineBasicBlock.h:783
llvm::GraphTraits< const MachineBasicBlock * >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition: MachineBasicBlock.h:1175
llvm::MachineBasicBlock::getFirstNonPHI
iterator getFirstNonPHI()
Returns a pointer to the first instruction in this block that is not a PHINode instruction.
Definition: MachineBasicBlock.cpp:196
llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::ChildIteratorType
MachineBasicBlock::const_pred_iterator ChildIteratorType
Definition: MachineBasicBlock.h:1199
llvm::MachineBasicBlock::liveout_end
liveout_iterator liveout_end() const
Definition: MachineBasicBlock.h:513
llvm::prev_nodbg
IterT prev_nodbg(IterT It, IterT Begin, bool SkipPseudoOp=true)
Decrement It, then continue decrementing it while it points to a debug instruction.
Definition: MachineBasicBlock.h:1269
llvm::MachineBasicBlock::succ_end
const_succ_iterator succ_end() const
Definition: MachineBasicBlock.h:345
llvm::MachineBasicBlock::getLastNonDebugInstr
iterator getLastNonDebugInstr(bool SkipPseudoOp=true)
Returns an iterator to the last non-debug instruction in the basic block, or end().
Definition: MachineBasicBlock.cpp:263
llvm::MachineBasicBlock::getAlignment
Align getAlignment() const
Return alignment of the basic block.
Definition: MachineBasicBlock.h:529
llvm::MachineBasicBlock::liveout_iterator::iterator_category
std::input_iterator_tag iterator_category
Definition: MachineBasicBlock.h:431
llvm::MachineBasicBlock::pred_iterator
std::vector< MachineBasicBlock * >::iterator pred_iterator
Definition: MachineBasicBlock.h:314
llvm::MachineBasicBlock::setIsEndSection
void setIsEndSection(bool V=true)
Definition: MachineBasicBlock.h:594
llvm::MBBSectionID::ExceptionSectionID
const static MBBSectionID ExceptionSectionID
Definition: MachineBasicBlock.h:64
llvm::MIPrinter
This class prints out the machine instructions using the MIR serialization format.
Definition: MIRPrinter.cpp:135
llvm::MachineBasicBlock::instr_front
const MachineInstr & instr_front() const
Definition: MachineBasicBlock.h:254
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MachineBasicBlock::canFallThrough
bool canFallThrough()
Return true if the block can implicitly transfer control to the block after it by falling off the end...
Definition: MachineBasicBlock.cpp:966
llvm::MachineBasicBlock::size
unsigned size() const
Definition: MachineBasicBlock.h:248
llvm::MachineBasicBlock::succ_rend
succ_reverse_iterator succ_rend()
Definition: MachineBasicBlock.h:350
llvm::MachineBasicBlock::succ_begin
succ_iterator succ_begin()
Definition: MachineBasicBlock.h:342
llvm::MachineBasicBlock::setHasAddressTaken
void setHasAddressTaken()
Set this block to reflect that it potentially is the target of an indirect branch.
Definition: MachineBasicBlock.h:224
llvm::MachineBasicBlock::getParent
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
Definition: MachineBasicBlock.h:234
llvm::MBBSectionID::MBBSectionID
MBBSectionID(unsigned N)
Definition: MachineBasicBlock.h:60
llvm::MachineBasicBlock::liveout_iterator::operator!=
bool operator!=(const liveout_iterator &RHS) const
Definition: MachineBasicBlock.h:485
iterator_range.h
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition: ISDOpcodes.h:71
llvm::MBB2NumberFunctor::operator()
unsigned operator()(const MachineBasicBlock *MBB) const
Definition: MachineBasicBlock.h:1148
llvm::MachineBasicBlock::instr_rend
const_reverse_instr_iterator instr_rend() const
Definition: MachineBasicBlock.h:269
B
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional ldr LCPI1_0 ldr ldr tst movne lsr ldr LCPI1_1 and r0 bx lr it saves an instruction and a register It might be profitable to cse MOVi16 if there are lots of bit immediates with the same bottom half Robert Muth started working on an alternate jump table implementation that does not put the tables in line in the text This is more like the llvm default jump table implementation This might be useful sometime Several revisions of patches are on the mailing beginning while CMP sets them like a subtract Therefore to be able to use CMN for comparisons other than the Z we ll need additional logic to reverse the conditionals associated with the comparison Perhaps a pseudo instruction for the with a post codegen pass to clean up and handle the condition codes See PR5694 for testcase Given the following on int B
Definition: README.txt:592
llvm::MachineBasicBlock::livein_end
livein_iterator livein_end() const
Definition: MachineBasicBlock.h:420
llvm::MachineBasicBlock::pred_rbegin
const_pred_reverse_iterator pred_rbegin() const
Definition: MachineBasicBlock.h:332
llvm::MachineBasicBlock::predecessors
iterator_range< pred_iterator > predecessors()
Definition: MachineBasicBlock.h:359
llvm::MachineBasicBlock::reverse_instr_iterator
Instructions::reverse_iterator reverse_instr_iterator
Definition: MachineBasicBlock.h:239
llvm::MachineBasicBlock::LQR_Dead
@ LQR_Dead
Register is known to be fully dead.
Definition: MachineBasicBlock.h:1051
llvm::MachineInstr::isReturn
bool isReturn(QueryType Type=AnyInBundle) const
Definition: MachineInstr.h:820
llvm::MachineBasicBlock::instr_begin
instr_iterator instr_begin()
Definition: MachineBasicBlock.h:262
llvm::MachineBasicBlock::pred_empty
bool pred_empty() const
Definition: MachineBasicBlock.h:341
llvm::GraphTraits< MachineBasicBlock * >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition: MachineBasicBlock.h:1167
llvm::MachineBasicBlock::setIsEHFuncletEntry
void setIsEHFuncletEntry(bool V=true)
Indicates if this is the entry block of an EH funclet.
Definition: MachineBasicBlock.h:578
llvm::MachineBasicBlock::instr_end
instr_iterator instr_end()
Definition: MachineBasicBlock.h:264
llvm::MachineFunction
Definition: MachineFunction.h:257
llvm::MachineBasicBlock::moveAfter
void moveAfter(MachineBasicBlock *NewBefore)
Definition: MachineBasicBlock.cpp:638
llvm::MachineBasicBlock::succ_empty
bool succ_empty() const
Definition: MachineBasicBlock.h:357
llvm::MachineBasicBlock::PrintNameIr
@ PrintNameIr
Add IR name where available.
Definition: MachineBasicBlock.h:1076
llvm::MachineBasicBlock::hasLabelMustBeEmitted
bool hasLabelMustBeEmitted() const
Test whether this block must have its label emitted.
Definition: MachineBasicBlock.h:227
llvm::MachineBasicBlock::getFirstTerminator
iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
Definition: MachineBasicBlock.cpp:238
llvm::skipDebugInstructionsForward
IterT skipDebugInstructionsForward(IterT It, IterT End, bool SkipPseudoOp=true)
Increment It until it points to a non-debug instruction or to End and return the resulting iterator.
Definition: MachineBasicBlock.h:1238
llvm::MachineBasicBlock::getBeginClobberMask
const uint32_t * getBeginClobberMask(const TargetRegisterInfo *TRI) const
Get the clobber mask for the start of this basic block.
Definition: MachineBasicBlock.cpp:1583
llvm::MachineBasicBlock::phis
iterator_range< iterator > phis()
Returns a range that iterates over the phis in the basic block.
Definition: MachineBasicBlock.h:306
llvm::MachineBasicBlock::iterator
MachineInstrBundleIterator< MachineInstr > iterator
Definition: MachineBasicBlock.h:242
llvm::MachineBasicBlock::getNumber
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
Definition: MachineBasicBlock.h:1088
llvm::MachineBasicBlock::isEHScopeEntry
bool isEHScopeEntry() const
Returns true if this is the entry block of an EH scope, i.e., the block that used to have a catchpad ...
Definition: MachineBasicBlock.h:562
llvm::MachineBasicBlock::PrintNameAttributes
@ PrintNameAttributes
Print attributes.
Definition: MachineBasicBlock.h:1077
llvm::MachineBasicBlock::getFirstNonDebugInstr
iterator getFirstNonDebugInstr(bool SkipPseudoOp=true)
Returns an iterator to the first non-debug instruction in the basic block, or end().
Definition: MachineBasicBlock.cpp:257
llvm::MachineBasicBlock::successors
iterator_range< succ_iterator > successors()
Definition: MachineBasicBlock.h:365
llvm::MachineBasicBlock::isEHPad
bool isEHPad() const
Returns true if the block is a landing pad.
Definition: MachineBasicBlock.h:549
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::MachineBasicBlock::getFirstNonDebugInstr
const_iterator getFirstNonDebugInstr(bool SkipPseudoOp=true) const
Definition: MachineBasicBlock.h:808
llvm::MachineBasicBlock::rbegin
reverse_iterator rbegin()
Definition: MachineBasicBlock.h:282
llvm::MachineBasicBlock::splice
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
Definition: MachineBasicBlock.h:982
llvm::MachineBasicBlock::hasEHPadSuccessor
bool hasEHPadSuccessor() const
Definition: MachineBasicBlock.cpp:279
MBBI
MachineBasicBlock MachineBasicBlock::iterator MBBI
Definition: AArch64SLSHardening.cpp:75
llvm::MachineBasicBlock::getFullName
std::string getFullName() const
Return a formatted string to identify this block and its parent function.
Definition: MachineBasicBlock.cpp:318
llvm::MachineBasicBlock::liveins_dbg
iterator_range< livein_iterator > liveins_dbg() const
Definition: MachineBasicBlock.h:415
llvm::MachineBasicBlock::findBranchDebugLoc
DebugLoc findBranchDebugLoc()
Find and return the merged DebugLoc of the branch instructions of the block.
Definition: MachineBasicBlock.cpp:1412
llvm::MachineBasicBlock::removeLiveIn
void removeLiveIn(MCPhysReg Reg, LaneBitmask LaneMask=LaneBitmask::getAll())
Remove the specified register from the live in set.
Definition: MachineBasicBlock.cpp:558
llvm::MBBSectionID::Type
enum llvm::MBBSectionID::SectionType Type
llvm::MachineBasicBlock::rfindDebugLoc
DebugLoc rfindDebugLoc(reverse_instr_iterator MBBI)
Has exact same behavior as findDebugLoc (it also searches from the first to the last MI of this MBB) ...
Definition: MachineBasicBlock.cpp:1381
Number
uint32_t Number
Definition: Profile.cpp:47
llvm::ilist_callback_traits::addNodeToList
void addNodeToList(NodeTy *)
When an MBB is added to an MF, we need to update the parent pointer of the MBB, the MBB numbering,...
Definition: ilist.h:66
MachineInstrBundleIterator.h
uint32_t
llvm::BranchProbability
Definition: BranchProbability.h:30
llvm::MachineBasicBlock::livein_begin_dbg
livein_iterator livein_begin_dbg() const
Unlike livein_begin, this method does not check that the liveness information is accurate.
Definition: MachineBasicBlock.h:414
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MachineInstrSpan::MachineInstrSpan
MachineInstrSpan(MachineBasicBlock::iterator I, MachineBasicBlock *BB)
Definition: MachineBasicBlock.h:1218
llvm::MachineBasicBlock::splitSuccessor
void splitSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New, bool NormalizeSuccProbs=false)
Split the old successor into old plus new and updates the probability info.
Definition: MachineBasicBlock.cpp:766
llvm::MachineBasicBlock::liveout_begin
liveout_iterator liveout_begin() const
Iterator scanning successor basic blocks' liveins to determine the registers potentially live at the ...
Definition: MachineBasicBlock.cpp:1607
llvm::MachineBasicBlock::transferSuccessors
void transferSuccessors(MachineBasicBlock *FromMBB)
Transfers all the successors from MBB to this machine basic block (i.e., copies all the successors Fr...
Definition: MachineBasicBlock.cpp:866
llvm::make_filter_range
iterator_range< filter_iterator< detail::IterOfRange< RangeT >, PredicateT > > make_filter_range(RangeT &&Range, PredicateT Pred)
Convenience function that takes a range of elements and a predicate, and return a new filter_iterator...
Definition: STLExtras.h:534
llvm::MachineBasicBlock::setLabelMustBeEmitted
void setLabelMustBeEmitted()
Set this block to reflect that, regardless how we flow to it, we need its label be emitted.
Definition: MachineBasicBlock.h:231
llvm::MachineBasicBlock::getSectionID
MBBSectionID getSectionID() const
Returns the section ID of this basic block.
Definition: MachineBasicBlock.h:597
llvm::MachineBasicBlock::pred_end
const_pred_iterator pred_end() const
Definition: MachineBasicBlock.h:329
llvm::MachineBasicBlock::instr_front
MachineInstr & instr_front()
Definition: MachineBasicBlock.h:252
llvm::MachineBasicBlock::addLiveIn
void addLiveIn(const RegisterMaskPair &RegMaskPair)
Definition: MachineBasicBlock.h:381
llvm::MachineBasicBlock::setIsEHScopeEntry
void setIsEHScopeEntry(bool V=true)
Indicates if this is the entry block of an EH scope, i.e., the block that that used to have a catchpa...
Definition: MachineBasicBlock.h:566
llvm::MachineBasicBlock::RegisterMaskPair::RegisterMaskPair
RegisterMaskPair(MCPhysReg PhysReg, LaneBitmask LaneMask)
Definition: MachineBasicBlock.h:105
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::MachineBasicBlock::addLiveIn
void addLiveIn(MCRegister PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll())
Adds the specified register as a live in.
Definition: MachineBasicBlock.h:377
llvm::MachineBasicBlock::isPredecessor
bool isPredecessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB is a predecessor of this block.
Definition: MachineBasicBlock.cpp:905
llvm::MachineBasicBlock::phis
iterator_range< const_iterator > phis() const
Definition: MachineBasicBlock.h:309
llvm::MachineBasicBlock::succ_begin
const_succ_iterator succ_begin() const
Definition: MachineBasicBlock.h:343
llvm::MachineBasicBlock::getEndSymbol
MCSymbol * getEndSymbol() const
Returns the MCSymbol marking the end of this basic block.
Definition: MachineBasicBlock.cpp:99
llvm::MachineBasicBlock::setNumber
void setNumber(int N)
Definition: MachineBasicBlock.h:1089
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::MachineBasicBlock::RegisterMaskPair::LaneMask
LaneBitmask LaneMask
Definition: MachineBasicBlock.h:103
llvm::MachineBasicBlock::canSplitCriticalEdge
bool canSplitCriticalEdge(const MachineBasicBlock *Succ) const
Check if the edge between this block and the given successor Succ, can be split.
Definition: MachineBasicBlock.cpp:1245
llvm::MachineBasicBlock::const_reverse_iterator
MachineInstrBundleIterator< const MachineInstr, true > const_reverse_iterator
Definition: MachineBasicBlock.h:246
llvm::MachineBasicBlock::replaceSuccessor
void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New)
Replace successor OLD with NEW and update probability info.
Definition: MachineBasicBlock.cpp:808
std
Definition: BitVector.h:851
llvm::MachineBasicBlock::replacePhiUsesWith
void replacePhiUsesWith(MachineBasicBlock *Old, MachineBasicBlock *New)
Update all phi nodes in this basic block to refer to basic block New instead of basic block Old.
Definition: MachineBasicBlock.cpp:1360
llvm::MachineBasicBlock::sortUniqueLiveIns
void sortUniqueLiveIns()
Sorts and uniques the LiveIns vector.
Definition: MachineBasicBlock.cpp:582
uint16_t
llvm::MachineBasicBlock::removeSuccessor
void removeSuccessor(MachineBasicBlock *Succ, bool NormalizeSuccProbs=false)
Remove successor from the successors list of this MachineBasicBlock.
Definition: MachineBasicBlock.cpp:785
llvm::MachineBasicBlock::isEndSection
bool isEndSection() const
Returns true if this block ends any section.
Definition: MachineBasicBlock.h:590
llvm::GraphTraits< MachineBasicBlock * >::ChildIteratorType
MachineBasicBlock::succ_iterator ChildIteratorType
Definition: MachineBasicBlock.h:1163
llvm::MachineBasicBlock::erase
iterator erase(MachineInstr *I)
Remove an instruction from the instruction list and delete it.
Definition: MachineBasicBlock.h:953
llvm::MBBSectionID::ColdSectionID
const static MBBSectionID ColdSectionID
Definition: MachineBasicBlock.h:63
llvm::MachineBasicBlock::insert
instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
Definition: MachineBasicBlock.cpp:1312
llvm::ilist_iterator
Iterator for intrusive lists based on ilist_node.
Definition: ilist_iterator.h:57
llvm::MachineBasicBlock::computeRegisterLiveness
LivenessQueryResult computeRegisterLiveness(const TargetRegisterInfo *TRI, MCRegister Reg, const_iterator Before, unsigned Neighborhood=10) const
Return whether (physical) register Reg has been defined and not killed as of just before Before.
Definition: MachineBasicBlock.cpp:1485
llvm::MBBSectionID::operator!=
bool operator!=(const MBBSectionID &Other) const
Definition: MachineBasicBlock.h:70
llvm::MachineBasicBlock::liveout_iterator
Definition: MachineBasicBlock.h:429
llvm::MachineBasicBlock::instr_iterator
Instructions::iterator instr_iterator
Definition: MachineBasicBlock.h:237
llvm::MachineBasicBlock::setIsBeginSection
void setIsBeginSection(bool V=true)
Definition: MachineBasicBlock.h:592
llvm::MachineBasicBlock::pred_reverse_iterator
std::vector< MachineBasicBlock * >::reverse_iterator pred_reverse_iterator
Definition: MachineBasicBlock.h:319
llvm::ilist_callback_traits::removeNodeFromList
void removeNodeFromList(NodeTy *)
Definition: ilist.h:67
llvm::MachineBasicBlock::front
MachineInstr & front()
Definition: MachineBasicBlock.h:257
llvm::MachineBasicBlock::liveout_iterator::operator->
pointer operator->() const
Definition: MachineBasicBlock.h:475
llvm::MBB2NumberFunctor
Definition: MachineBasicBlock.h:1146
llvm::MachineBasicBlock::livein_begin
livein_iterator livein_begin() const
Definition: MachineBasicBlock.cpp:1600
llvm::LiveIntervals
Definition: LiveIntervals.h:54
llvm::MachineBasicBlock::isLayoutSuccessor
bool isLayoutSuccessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB will be emitted immediately after this block, such that if this bloc...
Definition: MachineBasicBlock.cpp:913
llvm::MachineBasicBlock::rfindPrevDebugLoc
DebugLoc rfindPrevDebugLoc(reverse_instr_iterator MBBI)
Has exact same behavior as findPrevDebugLoc (it also searches from the last to the first MI of this M...
Definition: MachineBasicBlock.cpp:1399
llvm::MachineBasicBlock::getParent
MachineFunction * getParent()
Definition: MachineBasicBlock.h:235
llvm::Inverse
Definition: GraphTraits.h:97
llvm::MachineBasicBlock::normalizeSuccProbs
void normalizeSuccProbs()
Normalize probabilities of all successors so that the sum of them becomes one.
Definition: MachineBasicBlock.h:677
llvm::MachineBasicBlock::livein_empty
bool livein_empty() const
Definition: MachineBasicBlock.h:421
llvm::MachineBasicBlock::findPrevDebugLoc
DebugLoc findPrevDebugLoc(iterator MBBI)
Definition: MachineBasicBlock.h:1032
llvm::MachineBasicBlock::getFallThrough
MachineBasicBlock * getFallThrough()
Return the fallthrough block if the block can implicitly transfer control to the block after it by fa...
Definition: MachineBasicBlock.cpp:922
llvm::MachineBasicBlock::pop_front
void pop_front()
Definition: MachineBasicBlock.h:873
llvm::MachineBasicBlock::validateSuccProbs
void validateSuccProbs() const
Validate successors' probabilities and check if the sum of them is approximate one.
Definition: MachineBasicBlock.cpp:733
llvm::MachineBasicBlock::getEndClobberMask
const uint32_t * getEndClobberMask(const TargetRegisterInfo *TRI) const
Get the clobber mask for the end of the basic block.
Definition: MachineBasicBlock.cpp:1589
llvm::MachineBasicBlock::instr_begin
const_instr_iterator instr_begin() const
Definition: MachineBasicBlock.h:263
llvm::Pass
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:91
llvm::skipDebugInstructionsBackward
IterT skipDebugInstructionsBackward(IterT It, IterT Begin, bool SkipPseudoOp=true)
Decrement It until it points to a non-debug instruction or to Begin and return the resulting iterator...
Definition: MachineBasicBlock.h:1251
llvm::BranchProbability::normalizeProbabilities
static void normalizeProbabilities(ProbabilityIter Begin, ProbabilityIter End)
Definition: BranchProbability.h:205
llvm::MachineBasicBlock::begin
iterator begin()
Definition: MachineBasicBlock.h:278
llvm::MachineBasicBlock::isInlineAsmBrIndirectTarget
bool isInlineAsmBrIndirectTarget() const
Returns true if this is the indirect dest of an INLINEASM_BR.
Definition: MachineBasicBlock.h:617
llvm::ilist_alloc_traits::deleteNode
static void deleteNode(NodeTy *V)
Definition: ilist.h:42
llvm::Printable
Simple wrapper around std::function<void(raw_ostream&)>.
Definition: Printable.h:38
N
#define N
llvm::iplist_impl< simple_ilist< T, Options... >, ilist_traits< T > >::const_iterator
base_list_type::const_iterator const_iterator
Definition: ilist.h:179
llvm::MachineBasicBlock::findDebugLoc
DebugLoc findDebugLoc(iterator MBBI)
Definition: MachineBasicBlock.h:1017
LaneBitmask.h
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::MachineBasicBlock::const_succ_iterator
std::vector< MachineBasicBlock * >::const_iterator const_succ_iterator
Definition: MachineBasicBlock.h:317
llvm::MachineBasicBlock::empty
bool empty() const
Definition: MachineBasicBlock.h:250
llvm::MachineBasicBlock::clearLiveIns
void clearLiveIns()
Clear live in list.
Definition: MachineBasicBlock.cpp:1596
llvm::simple_ilist
A simple intrusive list implementation.
Definition: simple_ilist.h:78
llvm::MachineBasicBlock::begin
const_iterator begin() const
Definition: MachineBasicBlock.h:279
llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition: MachineBasicBlock.h:1205
llvm::MachineBasicBlock::erase_instr
instr_iterator erase_instr(MachineInstr *I)
Remove an instruction from the instruction list and delete it.
Definition: MachineBasicBlock.h:933
llvm::MachineBasicBlock::insert
void insert(iterator I, IT S, IT E)
Insert a range of instructions into the instruction list before I.
Definition: MachineBasicBlock.h:887
llvm::MachineBasicBlock::transferSuccessorsAndUpdatePHIs
void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB)
Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor bloc...
Definition: MachineBasicBlock.cpp:886
BB
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
Definition: README.txt:39
llvm::MachineBasicBlock::pred_rend
pred_reverse_iterator pred_rend()
Definition: MachineBasicBlock.h:334
llvm::MachineBasicBlock::const_pred_reverse_iterator
std::vector< MachineBasicBlock * >::const_reverse_iterator const_pred_reverse_iterator
Definition: MachineBasicBlock.h:321
llvm::MachineBasicBlock::LQR_Unknown
@ LQR_Unknown
Register liveness not decidable from local neighborhood.
Definition: MachineBasicBlock.h:1052
llvm::GraphTraits
Definition: GraphTraits.h:37
llvm::MachineBasicBlock::SkipPHIsLabelsAndDebug
iterator SkipPHIsLabelsAndDebug(iterator I, bool SkipPseudoOp=true)
Return the first instruction in MBB after I that is not a PHI, label or debug.
Definition: MachineBasicBlock.cpp:221
From
BlockVerifier::State From
Definition: BlockVerifier.cpp:55
llvm::MachineBasicBlock::print
void print(raw_ostream &OS, const SlotIndexes *=nullptr, bool IsStandalone=true) const
Definition: MachineBasicBlock.cpp:329
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::ilist_callback_traits::transferNodesFromList
void transferNodesFromList(ilist_callback_traits &OldList, Iterator, Iterator)
Callback before transferring nodes to this list.
Definition: ilist.h:72
llvm::MachineBasicBlock::rbegin
const_reverse_iterator rbegin() const
Definition: MachineBasicBlock.h:285
llvm::MachineBasicBlock::updateTerminator
void updateTerminator(MachineBasicBlock *PreviousLayoutSuccessor)
Update the terminator instructions in block to account for changes to block layout which may have bee...
Definition: MachineBasicBlock.cpp:642
llvm::MachineBasicBlock::instr_range
iterator_range< instr_iterator > instr_range
Definition: MachineBasicBlock.h:271
llvm::MachineBasicBlock::rfindDebugLoc
DebugLoc rfindDebugLoc(reverse_iterator MBBI)
Definition: MachineBasicBlock.h:1025
llvm::MachineBasicBlock::pred_rend
const_pred_reverse_iterator pred_rend() const
Definition: MachineBasicBlock.h:336
llvm::MachineBasicBlock::liveout_iterator::difference_type
std::ptrdiff_t difference_type
Definition: MachineBasicBlock.h:432
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::MachineBasicBlock::getSublistAccess
static Instructions MachineBasicBlock::* getSublistAccess(MachineInstr *)
Support for MachineInstr::getNextNode().
Definition: MachineBasicBlock.h:294
llvm::MachineBasicBlock::liveout_iterator::liveout_iterator
liveout_iterator(const MachineBasicBlock &MBB, MCPhysReg ExceptionPointer, MCPhysReg ExceptionSelector, bool End)
Definition: MachineBasicBlock.h:437
llvm::MachineBasicBlock::SplitCriticalEdge
MachineBasicBlock * SplitCriticalEdge(MachineBasicBlock *Succ, Pass &P, std::vector< SparseBitVector<>> *LiveInSets=nullptr)
Split the critical edge from this block to the given successor block, and return the newly created bl...
Definition: MachineBasicBlock.cpp:1011
llvm::MachineBasicBlock::remove_instr
MachineInstr * remove_instr(MachineInstr *I)
Remove the possibly bundled instruction from the instruction list without deleting it.
Definition: MachineBasicBlock.cpp:1304
llvm::MachineBasicBlock::getName
StringRef getName() const
Return the name of the corresponding LLVM basic block, or an empty string.
Definition: MachineBasicBlock.cpp:310
llvm::MachineBasicBlock::end
iterator end()
Definition: MachineBasicBlock.h:280
llvm::LaneBitmask::getAll
static constexpr LaneBitmask getAll()
Definition: LaneBitmask.h:84
llvm::ISD::MCSymbol
@ MCSymbol
Definition: ISDOpcodes.h:172
llvm::instructionsWithoutDebug
auto instructionsWithoutDebug(IterT It, IterT End, bool SkipPseudoOp=true)
Construct a range iterator which begins at It and moves forwards until End is reached,...
Definition: MachineBasicBlock.h:1276
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1236
llvm::CallingConv::Cold
@ Cold
Definition: CallingConv.h:48
llvm::MCRegister
Wrapper class representing physical registers. Should be passed by value.
Definition: MCRegister.h:24
llvm::MachineBasicBlock::sameSection
bool sameSection(const MachineBasicBlock *MBB) const
Returns true if this and MBB belong to the same section.
Definition: MachineBasicBlock.h:638
llvm::MachineBasicBlock::predecessors
iterator_range< const_pred_iterator > predecessors() const
Definition: MachineBasicBlock.h:362
llvm::MachineBasicBlock::instr_rbegin
const_reverse_instr_iterator instr_rbegin() const
Definition: MachineBasicBlock.h:267