LLVM  16.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 MachineBasicBlock is referenced somewhere other than
147  /// as predecessor/successor, a terminator MachineInstr, or a jump table.
148  bool MachineBlockAddressTaken = false;
149 
150  /// If this MachineBasicBlock corresponds to an IR-level "blockaddress"
151  /// constant, this contains a pointer to that block.
152  BasicBlock *AddressTakenIRBlock = nullptr;
153 
154  /// Indicate that this basic block needs its symbol be emitted regardless of
155  /// whether the flow just falls-through to it.
156  bool LabelMustBeEmitted = false;
157 
158  /// Indicate that this basic block is the entry block of an EH scope, i.e.,
159  /// the block that used to have a catchpad or cleanuppad instruction in the
160  /// LLVM IR.
161  bool IsEHScopeEntry = false;
162 
163  /// Indicates if this is a target block of a catchret.
164  bool IsEHCatchretTarget = false;
165 
166  /// Indicate that this basic block is the entry block of an EH funclet.
167  bool IsEHFuncletEntry = false;
168 
169  /// Indicate that this basic block is the entry block of a cleanup funclet.
170  bool IsCleanupFuncletEntry = false;
171 
172  /// With basic block sections, this stores the Section ID of the basic block.
173  MBBSectionID SectionID{0};
174 
175  // Indicate that this basic block begins a section.
176  bool IsBeginSection = false;
177 
178  // Indicate that this basic block ends a section.
179  bool IsEndSection = false;
180 
181  /// Indicate that this basic block is the indirect dest of an INLINEASM_BR.
182  bool IsInlineAsmBrIndirectTarget = false;
183 
184  /// since getSymbol is a relatively heavy-weight operation, the symbol
185  /// is only computed once and is cached.
186  mutable MCSymbol *CachedMCSymbol = nullptr;
187 
188  /// Cached MCSymbol for this block (used if IsEHCatchRetTarget).
189  mutable MCSymbol *CachedEHCatchretMCSymbol = nullptr;
190 
191  /// Marks the end of the basic block. Used during basic block sections to
192  /// calculate the size of the basic block, or the BB section ending with it.
193  mutable MCSymbol *CachedEndMCSymbol = nullptr;
194 
195  // Intrusive list support
196  MachineBasicBlock() = default;
197 
198  explicit MachineBasicBlock(MachineFunction &MF, const BasicBlock *BB);
199 
200  ~MachineBasicBlock();
201 
202  // MachineBasicBlocks are allocated and owned by MachineFunction.
203  friend class MachineFunction;
204 
205 public:
206  /// Return the LLVM basic block that this instance corresponded to originally.
207  /// Note that this may be NULL if this instance does not correspond directly
208  /// to an LLVM basic block.
209  const BasicBlock *getBasicBlock() const { return BB; }
210 
211  /// Remove the reference to the underlying IR BasicBlock. This is for
212  /// reduction tools and should generally not be used.
214  BB = nullptr;
215  }
216 
217  /// Return the name of the corresponding LLVM basic block, or an empty string.
218  StringRef getName() const;
219 
220  /// Return a formatted string to identify this block and its parent function.
221  std::string getFullName() const;
222 
223  /// Test whether this block is used as as something other than the target
224  /// of a terminator, exception-handling target, or jump table. This is
225  /// either the result of an IR-level "blockaddress", or some form
226  /// of target-specific branch lowering.
227  bool hasAddressTaken() const {
228  return MachineBlockAddressTaken || AddressTakenIRBlock;
229  }
230 
231  /// Test whether this block is used as something other than the target of a
232  /// terminator, exception-handling target, jump table, or IR blockaddress.
233  /// For example, its address might be loaded into a register, or
234  /// stored in some branch table that isn't part of MachineJumpTableInfo.
235  bool isMachineBlockAddressTaken() const { return MachineBlockAddressTaken; }
236 
237  /// Test whether this block is the target of an IR BlockAddress. (There can
238  /// more than one MBB associated with an IR BB where the address is taken.)
239  bool isIRBlockAddressTaken() const { return AddressTakenIRBlock; }
240 
241  /// Retrieves the BasicBlock which corresponds to this MachineBasicBlock.
242  BasicBlock *getAddressTakenIRBlock() const { return AddressTakenIRBlock; }
243 
244  /// Set this block to indicate that its address is used as something other
245  /// than the target of a terminator, exception-handling target, jump table,
246  /// or IR-level "blockaddress".
247  void setMachineBlockAddressTaken() { MachineBlockAddressTaken = true; }
248 
249  /// Set this block to reflect that it corresponds to an IR-level basic block
250  /// with a BlockAddress.
251  void setAddressTakenIRBlock(BasicBlock *BB) { AddressTakenIRBlock = BB; }
252 
253  /// Test whether this block must have its label emitted.
254  bool hasLabelMustBeEmitted() const { return LabelMustBeEmitted; }
255 
256  /// Set this block to reflect that, regardless how we flow to it, we need
257  /// its label be emitted.
258  void setLabelMustBeEmitted() { LabelMustBeEmitted = true; }
259 
260  /// Return the MachineFunction containing this basic block.
261  const MachineFunction *getParent() const { return xParent; }
262  MachineFunction *getParent() { return xParent; }
263 
268 
272  using const_reverse_iterator =
274 
275  unsigned size() const { return (unsigned)Insts.size(); }
276  bool sizeWithoutDebugLargerThan(unsigned Limit) const;
277  bool empty() const { return Insts.empty(); }
278 
279  MachineInstr &instr_front() { return Insts.front(); }
280  MachineInstr &instr_back() { return Insts.back(); }
281  const MachineInstr &instr_front() const { return Insts.front(); }
282  const MachineInstr &instr_back() const { return Insts.back(); }
283 
284  MachineInstr &front() { return Insts.front(); }
285  MachineInstr &back() { return *--end(); }
286  const MachineInstr &front() const { return Insts.front(); }
287  const MachineInstr &back() const { return *--end(); }
288 
289  instr_iterator instr_begin() { return Insts.begin(); }
290  const_instr_iterator instr_begin() const { return Insts.begin(); }
291  instr_iterator instr_end() { return Insts.end(); }
292  const_instr_iterator instr_end() const { return Insts.end(); }
293  reverse_instr_iterator instr_rbegin() { return Insts.rbegin(); }
294  const_reverse_instr_iterator instr_rbegin() const { return Insts.rbegin(); }
295  reverse_instr_iterator instr_rend () { return Insts.rend(); }
296  const_reverse_instr_iterator instr_rend () const { return Insts.rend(); }
297 
303  }
304 
305  iterator begin() { return instr_begin(); }
306  const_iterator begin() const { return instr_begin(); }
307  iterator end () { return instr_end(); }
308  const_iterator end () const { return instr_end(); }
311  }
314  }
318  }
319 
320  /// Support for MachineInstr::getNextNode().
322  return &MachineBasicBlock::Insts;
323  }
324 
326  return make_range(getFirstTerminator(), end());
327  }
329  return make_range(getFirstTerminator(), end());
330  }
331 
332  /// Returns a range that iterates over the phis in the basic block.
334  return make_range(begin(), getFirstNonPHI());
335  }
337  return const_cast<MachineBasicBlock *>(this)->phis();
338  }
339 
340  // Machine-CFG iterators
341  using pred_iterator = std::vector<MachineBasicBlock *>::iterator;
342  using const_pred_iterator = std::vector<MachineBasicBlock *>::const_iterator;
343  using succ_iterator = std::vector<MachineBasicBlock *>::iterator;
344  using const_succ_iterator = std::vector<MachineBasicBlock *>::const_iterator;
345  using pred_reverse_iterator =
346  std::vector<MachineBasicBlock *>::reverse_iterator;
348  std::vector<MachineBasicBlock *>::const_reverse_iterator;
349  using succ_reverse_iterator =
350  std::vector<MachineBasicBlock *>::reverse_iterator;
352  std::vector<MachineBasicBlock *>::const_reverse_iterator;
353  pred_iterator pred_begin() { return Predecessors.begin(); }
354  const_pred_iterator pred_begin() const { return Predecessors.begin(); }
355  pred_iterator pred_end() { return Predecessors.end(); }
356  const_pred_iterator pred_end() const { return Predecessors.end(); }
358  { return Predecessors.rbegin();}
360  { return Predecessors.rbegin();}
362  { return Predecessors.rend(); }
364  { return Predecessors.rend(); }
365  unsigned pred_size() const {
366  return (unsigned)Predecessors.size();
367  }
368  bool pred_empty() const { return Predecessors.empty(); }
369  succ_iterator succ_begin() { return Successors.begin(); }
370  const_succ_iterator succ_begin() const { return Successors.begin(); }
371  succ_iterator succ_end() { return Successors.end(); }
372  const_succ_iterator succ_end() const { return Successors.end(); }
374  { return Successors.rbegin(); }
376  { return Successors.rbegin(); }
378  { return Successors.rend(); }
380  { return Successors.rend(); }
381  unsigned succ_size() const {
382  return (unsigned)Successors.size();
383  }
384  bool succ_empty() const { return Successors.empty(); }
385 
387  return make_range(pred_begin(), pred_end());
388  }
390  return make_range(pred_begin(), pred_end());
391  }
393  return make_range(succ_begin(), succ_end());
394  }
396  return make_range(succ_begin(), succ_end());
397  }
398 
399  // LiveIn management methods.
400 
401  /// Adds the specified register as a live in. Note that it is an error to add
402  /// the same register to the same set more than once unless the intention is
403  /// to call sortUniqueLiveIns after all registers are added.
404  void addLiveIn(MCRegister PhysReg,
405  LaneBitmask LaneMask = LaneBitmask::getAll()) {
406  LiveIns.push_back(RegisterMaskPair(PhysReg, LaneMask));
407  }
408  void addLiveIn(const RegisterMaskPair &RegMaskPair) {
409  LiveIns.push_back(RegMaskPair);
410  }
411 
412  /// Sorts and uniques the LiveIns vector. It can be significantly faster to do
413  /// this than repeatedly calling isLiveIn before calling addLiveIn for every
414  /// LiveIn insertion.
415  void sortUniqueLiveIns();
416 
417  /// Clear live in list.
418  void clearLiveIns();
419 
420  /// Add PhysReg as live in to this block, and ensure that there is a copy of
421  /// PhysReg to a virtual register of class RC. Return the virtual register
422  /// that is a copy of the live in PhysReg.
423  Register addLiveIn(MCRegister PhysReg, const TargetRegisterClass *RC);
424 
425  /// Remove the specified register from the live in set.
427  LaneBitmask LaneMask = LaneBitmask::getAll());
428 
429  /// Return true if the specified register is in the live in set.
430  bool isLiveIn(MCPhysReg Reg,
431  LaneBitmask LaneMask = LaneBitmask::getAll()) const;
432 
433  // Iteration support for live in sets. These sets are kept in sorted
434  // order by their register number.
435  using livein_iterator = LiveInVector::const_iterator;
436 
437  /// Unlike livein_begin, this method does not check that the liveness
438  /// information is accurate. Still for debug purposes it may be useful
439  /// to have iterators that won't assert if the liveness information
440  /// is not current.
441  livein_iterator livein_begin_dbg() const { return LiveIns.begin(); }
444  }
445 
447  livein_iterator livein_end() const { return LiveIns.end(); }
448  bool livein_empty() const { return LiveIns.empty(); }
450  return make_range(livein_begin(), livein_end());
451  }
452 
453  /// Remove entry from the livein set and return iterator to the next.
455 
457  public:
458  using iterator_category = std::input_iterator_tag;
459  using difference_type = std::ptrdiff_t;
461  using pointer = const RegisterMaskPair *;
462  using reference = const RegisterMaskPair &;
463 
465  MCPhysReg ExceptionSelector, bool End)
466  : ExceptionPointer(ExceptionPointer),
467  ExceptionSelector(ExceptionSelector), BlockI(MBB.succ_begin()),
468  BlockEnd(MBB.succ_end()) {
469  if (End)
470  BlockI = BlockEnd;
471  else if (BlockI != BlockEnd) {
472  LiveRegI = (*BlockI)->livein_begin();
473  if (!advanceToValidPosition())
474  return;
475  if (LiveRegI->PhysReg == ExceptionPointer ||
476  LiveRegI->PhysReg == ExceptionSelector)
477  ++(*this);
478  }
479  }
480 
482  do {
483  ++LiveRegI;
484  if (!advanceToValidPosition())
485  return *this;
486  } while ((*BlockI)->isEHPad() &&
487  (LiveRegI->PhysReg == ExceptionPointer ||
488  LiveRegI->PhysReg == ExceptionSelector));
489  return *this;
490  }
491 
493  liveout_iterator Tmp = *this;
494  ++(*this);
495  return Tmp;
496  }
497 
499  return *LiveRegI;
500  }
501 
502  pointer operator->() const {
503  return &*LiveRegI;
504  }
505 
506  bool operator==(const liveout_iterator &RHS) const {
507  if (BlockI != BlockEnd)
508  return BlockI == RHS.BlockI && LiveRegI == RHS.LiveRegI;
509  return RHS.BlockI == BlockEnd;
510  }
511 
512  bool operator!=(const liveout_iterator &RHS) const {
513  return !(*this == RHS);
514  }
515  private:
516  bool advanceToValidPosition() {
517  if (LiveRegI != (*BlockI)->livein_end())
518  return true;
519 
520  do {
521  ++BlockI;
522  } while (BlockI != BlockEnd && (*BlockI)->livein_empty());
523  if (BlockI == BlockEnd)
524  return false;
525 
526  LiveRegI = (*BlockI)->livein_begin();
527  return true;
528  }
529 
530  MCPhysReg ExceptionPointer, ExceptionSelector;
531  const_succ_iterator BlockI;
532  const_succ_iterator BlockEnd;
533  livein_iterator LiveRegI;
534  };
535 
536  /// Iterator scanning successor basic blocks' liveins to determine the
537  /// registers potentially live at the end of this block. There may be
538  /// duplicates or overlapping registers in the list returned.
539  liveout_iterator liveout_begin() const;
541  return liveout_iterator(*this, 0, 0, true);
542  }
544  return make_range(liveout_begin(), liveout_end());
545  }
546 
547  /// Get the clobber mask for the start of this basic block. Funclets use this
548  /// to prevent register allocation across funclet transitions.
549  const uint32_t *getBeginClobberMask(const TargetRegisterInfo *TRI) const;
550 
551  /// Get the clobber mask for the end of the basic block.
552  /// \see getBeginClobberMask()
553  const uint32_t *getEndClobberMask(const TargetRegisterInfo *TRI) const;
554 
555  /// Return alignment of the basic block.
556  Align getAlignment() const { return Alignment; }
557 
558  /// Set alignment of the basic block.
559  void setAlignment(Align A) { Alignment = A; }
560 
561  void setAlignment(Align A, unsigned MaxBytes) {
562  setAlignment(A);
563  setMaxBytesForAlignment(MaxBytes);
564  }
565 
566  /// Return the maximum amount of padding allowed for aligning the basic block.
567  unsigned getMaxBytesForAlignment() const { return MaxBytesForAlignment; }
568 
569  /// Set the maximum amount of padding allowed for aligning the basic block
570  void setMaxBytesForAlignment(unsigned MaxBytes) {
571  MaxBytesForAlignment = MaxBytes;
572  }
573 
574  /// Returns true if the block is a landing pad. That is this basic block is
575  /// entered via an exception handler.
576  bool isEHPad() const { return IsEHPad; }
577 
578  /// Indicates the block is a landing pad. That is this basic block is entered
579  /// via an exception handler.
580  void setIsEHPad(bool V = true) { IsEHPad = V; }
581 
582  bool hasEHPadSuccessor() const;
583 
584  /// Returns true if this is the entry block of the function.
585  bool isEntryBlock() const;
586 
587  /// Returns true if this is the entry block of an EH scope, i.e., the block
588  /// that used to have a catchpad or cleanuppad instruction in the LLVM IR.
589  bool isEHScopeEntry() const { return IsEHScopeEntry; }
590 
591  /// Indicates if this is the entry block of an EH scope, i.e., the block that
592  /// that used to have a catchpad or cleanuppad instruction in the LLVM IR.
593  void setIsEHScopeEntry(bool V = true) { IsEHScopeEntry = V; }
594 
595  /// Returns true if this is a target block of a catchret.
596  bool isEHCatchretTarget() const { return IsEHCatchretTarget; }
597 
598  /// Indicates if this is a target block of a catchret.
599  void setIsEHCatchretTarget(bool V = true) { IsEHCatchretTarget = V; }
600 
601  /// Returns true if this is the entry block of an EH funclet.
602  bool isEHFuncletEntry() const { return IsEHFuncletEntry; }
603 
604  /// Indicates if this is the entry block of an EH funclet.
605  void setIsEHFuncletEntry(bool V = true) { IsEHFuncletEntry = V; }
606 
607  /// Returns true if this is the entry block of a cleanup funclet.
608  bool isCleanupFuncletEntry() const { return IsCleanupFuncletEntry; }
609 
610  /// Indicates if this is the entry block of a cleanup funclet.
611  void setIsCleanupFuncletEntry(bool V = true) { IsCleanupFuncletEntry = V; }
612 
613  /// Returns true if this block begins any section.
614  bool isBeginSection() const { return IsBeginSection; }
615 
616  /// Returns true if this block ends any section.
617  bool isEndSection() const { return IsEndSection; }
618 
619  void setIsBeginSection(bool V = true) { IsBeginSection = V; }
620 
621  void setIsEndSection(bool V = true) { IsEndSection = V; }
622 
623  /// Returns the section ID of this basic block.
624  MBBSectionID getSectionID() const { return SectionID; }
625 
626  /// Returns the unique section ID number of this basic block.
627  unsigned getSectionIDNum() const {
628  return ((unsigned)MBBSectionID::SectionType::Cold) -
629  ((unsigned)SectionID.Type) + SectionID.Number;
630  }
631 
632  /// Sets the section ID for this basic block.
633  void setSectionID(MBBSectionID V) { SectionID = V; }
634 
635  /// Returns the MCSymbol marking the end of this basic block.
636  MCSymbol *getEndSymbol() const;
637 
638  /// Returns true if this block may have an INLINEASM_BR (overestimate, by
639  /// checking if any of the successors are indirect targets of any inlineasm_br
640  /// in the function).
641  bool mayHaveInlineAsmBr() const;
642 
643  /// Returns true if this is the indirect dest of an INLINEASM_BR.
645  return IsInlineAsmBrIndirectTarget;
646  }
647 
648  /// Indicates if this is the indirect dest of an INLINEASM_BR.
649  void setIsInlineAsmBrIndirectTarget(bool V = true) {
650  IsInlineAsmBrIndirectTarget = V;
651  }
652 
653  /// Returns true if it is legal to hoist instructions into this block.
654  bool isLegalToHoistInto() const;
655 
656  // Code Layout methods.
657 
658  /// Move 'this' block before or after the specified block. This only moves
659  /// the block, it does not modify the CFG or adjust potential fall-throughs at
660  /// the end of the block.
661  void moveBefore(MachineBasicBlock *NewAfter);
662  void moveAfter(MachineBasicBlock *NewBefore);
663 
664  /// Returns true if this and MBB belong to the same section.
665  bool sameSection(const MachineBasicBlock *MBB) const {
666  return getSectionID() == MBB->getSectionID();
667  }
668 
669  /// Update the terminator instructions in block to account for changes to
670  /// block layout which may have been made. PreviousLayoutSuccessor should be
671  /// set to the block which may have been used as fallthrough before the block
672  /// layout was modified. If the block previously fell through to that block,
673  /// it may now need a branch. If it previously branched to another block, it
674  /// may now be able to fallthrough to the current layout successor.
675  void updateTerminator(MachineBasicBlock *PreviousLayoutSuccessor);
676 
677  // Machine-CFG mutators
678 
679  /// Add Succ as a successor of this MachineBasicBlock. The Predecessors list
680  /// of Succ is automatically updated. PROB parameter is stored in
681  /// Probabilities list. The default probability is set as unknown. Mixing
682  /// known and unknown probabilities in successor list is not allowed. When all
683  /// successors have unknown probabilities, 1 / N is returned as the
684  /// probability for each successor, where N is the number of successors.
685  ///
686  /// Note that duplicate Machine CFG edges are not allowed.
687  void addSuccessor(MachineBasicBlock *Succ,
689 
690  /// Add Succ as a successor of this MachineBasicBlock. The Predecessors list
691  /// of Succ is automatically updated. The probability is not provided because
692  /// BPI is not available (e.g. -O0 is used), in which case edge probabilities
693  /// won't be used. Using this interface can save some space.
695 
696  /// Set successor probability of a given iterator.
698 
699  /// Normalize probabilities of all successors so that the sum of them becomes
700  /// one. This is usually done when the current update on this MBB is done, and
701  /// the sum of its successors' probabilities is not guaranteed to be one. The
702  /// user is responsible for the correct use of this function.
703  /// MBB::removeSuccessor() has an option to do this automatically.
705  BranchProbability::normalizeProbabilities(Probs.begin(), Probs.end());
706  }
707 
708  /// Validate successors' probabilities and check if the sum of them is
709  /// approximate one. This only works in DEBUG mode.
710  void validateSuccProbs() const;
711 
712  /// Remove successor from the successors list of this MachineBasicBlock. The
713  /// Predecessors list of Succ is automatically updated.
714  /// If NormalizeSuccProbs is true, then normalize successors' probabilities
715  /// after the successor is removed.
717  bool NormalizeSuccProbs = false);
718 
719  /// Remove specified successor from the successors list of this
720  /// MachineBasicBlock. The Predecessors list of Succ is automatically updated.
721  /// If NormalizeSuccProbs is true, then normalize successors' probabilities
722  /// after the successor is removed.
723  /// Return the iterator to the element after the one removed.
725  bool NormalizeSuccProbs = false);
726 
727  /// Replace successor OLD with NEW and update probability info.
729 
730  /// Copy a successor (and any probability info) from original block to this
731  /// block's. Uses an iterator into the original blocks successors.
732  ///
733  /// This is useful when doing a partial clone of successors. Afterward, the
734  /// probabilities may need to be normalized.
736 
737  /// Split the old successor into old plus new and updates the probability
738  /// info.
740  bool NormalizeSuccProbs = false);
741 
742  /// Transfers all the successors from MBB to this machine basic block (i.e.,
743  /// copies all the successors FromMBB and remove all the successors from
744  /// FromMBB).
745  void transferSuccessors(MachineBasicBlock *FromMBB);
746 
747  /// Transfers all the successors, as in transferSuccessors, and update PHI
748  /// operands in the successor blocks which refer to FromMBB to refer to this.
750 
751  /// Return true if any of the successors have probabilities attached to them.
752  bool hasSuccessorProbabilities() const { return !Probs.empty(); }
753 
754  /// Return true if the specified MBB is a predecessor of this block.
755  bool isPredecessor(const MachineBasicBlock *MBB) const;
756 
757  /// Return true if the specified MBB is a successor of this block.
758  bool isSuccessor(const MachineBasicBlock *MBB) const;
759 
760  /// Return true if the specified MBB will be emitted immediately after this
761  /// block, such that if this block exits by falling through, control will
762  /// transfer to the specified MBB. Note that MBB need not be a successor at
763  /// all, for example if this block ends with an unconditional branch to some
764  /// other block.
765  bool isLayoutSuccessor(const MachineBasicBlock *MBB) const;
766 
767  /// Return the successor of this block if it has a single successor.
768  /// Otherwise return a null pointer.
769  ///
770  const MachineBasicBlock *getSingleSuccessor() const;
772  return const_cast<MachineBasicBlock *>(
773  static_cast<const MachineBasicBlock *>(this)->getSingleSuccessor());
774  }
775 
776  /// Return the fallthrough block if the block can implicitly
777  /// transfer control to the block after it by falling off the end of
778  /// it. This should return null if it can reach the block after
779  /// it, but it uses an explicit branch to do so (e.g., a table
780  /// jump). Non-null return is a conservative answer.
782 
783  /// Return true if the block can implicitly transfer control to the
784  /// block after it by falling off the end of it. This should return
785  /// false if it can reach the block after it, but it uses an
786  /// explicit branch to do so (e.g., a table jump). True is a
787  /// conservative answer.
788  bool canFallThrough();
789 
790  /// Returns a pointer to the first instruction in this block that is not a
791  /// PHINode instruction. When adding instructions to the beginning of the
792  /// basic block, they should be added before the returned value, not before
793  /// the first instruction, which might be PHI.
794  /// Returns end() is there's no non-PHI instruction.
796 
797  /// Return the first instruction in MBB after I that is not a PHI or a label.
798  /// This is the correct point to insert lowered copies at the beginning of a
799  /// basic block that must be before any debugging information.
801 
802  /// Return the first instruction in MBB after I that is not a PHI, label or
803  /// debug. This is the correct point to insert copies at the beginning of a
804  /// basic block.
805  iterator SkipPHIsLabelsAndDebug(iterator I, bool SkipPseudoOp = true);
806 
807  /// Returns an iterator to the first terminator instruction of this basic
808  /// block. If a terminator does not exist, it returns end().
811  return const_cast<MachineBasicBlock *>(this)->getFirstTerminator();
812  }
813 
814  /// Same getFirstTerminator but it ignores bundles and return an
815  /// instr_iterator instead.
817 
818  /// Returns an iterator to the first non-debug instruction in the basic block,
819  /// or end(). Skip any pseudo probe operation if \c SkipPseudoOp is true.
820  /// Pseudo probes are like debug instructions which do not turn into real
821  /// machine code. We try to use the function to skip both debug instructions
822  /// and pseudo probe operations to avoid API proliferation. This should work
823  /// most of the time when considering optimizing the rest of code in the
824  /// block, except for certain cases where pseudo probes are designed to block
825  /// the optimizations. For example, code merge like optimizations are supposed
826  /// to be blocked by pseudo probes for better AutoFDO profile quality.
827  /// Therefore, they should be considered as a valid instruction when this
828  /// function is called in a context of such optimizations. On the other hand,
829  /// \c SkipPseudoOp should be true when it's used in optimizations that
830  /// unlikely hurt profile quality, e.g., without block merging. The default
831  /// value of \c SkipPseudoOp is set to true to maximize code quality in
832  /// general, with an explict false value passed in in a few places like branch
833  /// folding and if-conversion to favor profile quality.
834  iterator getFirstNonDebugInstr(bool SkipPseudoOp = true);
835  const_iterator getFirstNonDebugInstr(bool SkipPseudoOp = true) const {
836  return const_cast<MachineBasicBlock *>(this)->getFirstNonDebugInstr(
837  SkipPseudoOp);
838  }
839 
840  /// Returns an iterator to the last non-debug instruction in the basic block,
841  /// or end(). Skip any pseudo operation if \c SkipPseudoOp is true.
842  /// Pseudo probes are like debug instructions which do not turn into real
843  /// machine code. We try to use the function to skip both debug instructions
844  /// and pseudo probe operations to avoid API proliferation. This should work
845  /// most of the time when considering optimizing the rest of code in the
846  /// block, except for certain cases where pseudo probes are designed to block
847  /// the optimizations. For example, code merge like optimizations are supposed
848  /// to be blocked by pseudo probes for better AutoFDO profile quality.
849  /// Therefore, they should be considered as a valid instruction when this
850  /// function is called in a context of such optimizations. On the other hand,
851  /// \c SkipPseudoOp should be true when it's used in optimizations that
852  /// unlikely hurt profile quality, e.g., without block merging. The default
853  /// value of \c SkipPseudoOp is set to true to maximize code quality in
854  /// general, with an explict false value passed in in a few places like branch
855  /// folding and if-conversion to favor profile quality.
856  iterator getLastNonDebugInstr(bool SkipPseudoOp = true);
857  const_iterator getLastNonDebugInstr(bool SkipPseudoOp = true) const {
858  return const_cast<MachineBasicBlock *>(this)->getLastNonDebugInstr(
859  SkipPseudoOp);
860  }
861 
862  /// Convenience function that returns true if the block ends in a return
863  /// instruction.
864  bool isReturnBlock() const {
865  return !empty() && back().isReturn();
866  }
867 
868  /// Convenience function that returns true if the bock ends in a EH scope
869  /// return instruction.
870  bool isEHScopeReturnBlock() const {
871  return !empty() && back().isEHScopeReturn();
872  }
873 
874  /// Split a basic block into 2 pieces at \p SplitPoint. A new block will be
875  /// inserted after this block, and all instructions after \p SplitInst moved
876  /// to it (\p SplitInst will be in the original block). If \p LIS is provided,
877  /// LiveIntervals will be appropriately updated. \return the newly inserted
878  /// block.
879  ///
880  /// If \p UpdateLiveIns is true, this will ensure the live ins list is
881  /// accurate, including for physreg uses/defs in the original block.
882  MachineBasicBlock *splitAt(MachineInstr &SplitInst, bool UpdateLiveIns = true,
883  LiveIntervals *LIS = nullptr);
884 
885  /// Split the critical edge from this block to the given successor block, and
886  /// return the newly created block, or null if splitting is not possible.
887  ///
888  /// This function updates LiveVariables, MachineDominatorTree, and
889  /// MachineLoopInfo, as applicable.
892  std::vector<SparseBitVector<>> *LiveInSets = nullptr);
893 
894  /// Check if the edge between this block and the given successor \p
895  /// Succ, can be split. If this returns true a subsequent call to
896  /// SplitCriticalEdge is guaranteed to return a valid basic block if
897  /// no changes occurred in the meantime.
898  bool canSplitCriticalEdge(const MachineBasicBlock *Succ) const;
899 
900  void pop_front() { Insts.pop_front(); }
901  void pop_back() { Insts.pop_back(); }
902  void push_back(MachineInstr *MI) { Insts.push_back(MI); }
903 
904  /// Insert MI into the instruction list before I, possibly inside a bundle.
905  ///
906  /// If the insertion point is inside a bundle, MI will be added to the bundle,
907  /// otherwise MI will not be added to any bundle. That means this function
908  /// alone can't be used to prepend or append instructions to bundles. See
909  /// MIBundleBuilder::insert() for a more reliable way of doing that.
911 
912  /// Insert a range of instructions into the instruction list before I.
913  template<typename IT>
914  void insert(iterator I, IT S, IT E) {
915  assert((I == end() || I->getParent() == this) &&
916  "iterator points outside of basic block");
917  Insts.insert(I.getInstrIterator(), S, E);
918  }
919 
920  /// Insert MI into the instruction list before I.
922  assert((I == end() || I->getParent() == this) &&
923  "iterator points outside of basic block");
924  assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
925  "Cannot insert instruction with bundle flags");
926  return Insts.insert(I.getInstrIterator(), MI);
927  }
928 
929  /// Insert MI into the instruction list after I.
931  assert((I == end() || I->getParent() == this) &&
932  "iterator points outside of basic block");
933  assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
934  "Cannot insert instruction with bundle flags");
935  return Insts.insertAfter(I.getInstrIterator(), MI);
936  }
937 
938  /// If I is bundled then insert MI into the instruction list after the end of
939  /// the bundle, otherwise insert MI immediately after I.
941  assert((I == instr_end() || I->getParent() == this) &&
942  "iterator points outside of basic block");
943  assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
944  "Cannot insert instruction with bundle flags");
945  while (I->isBundledWithSucc())
946  ++I;
947  return Insts.insertAfter(I, MI);
948  }
949 
950  /// Remove an instruction from the instruction list and delete it.
951  ///
952  /// If the instruction is part of a bundle, the other instructions in the
953  /// bundle will still be bundled after removing the single instruction.
955 
956  /// Remove an instruction from the instruction list and delete it.
957  ///
958  /// If the instruction is part of a bundle, the other instructions in the
959  /// bundle will still be bundled after removing the single instruction.
961  return erase(instr_iterator(I));
962  }
963 
964  /// Remove a range of instructions from the instruction list and delete them.
966  return Insts.erase(I.getInstrIterator(), E.getInstrIterator());
967  }
968 
969  /// Remove an instruction or bundle from the instruction list and delete it.
970  ///
971  /// If I points to a bundle of instructions, they are all erased.
973  return erase(I, std::next(I));
974  }
975 
976  /// Remove an instruction from the instruction list and delete it.
977  ///
978  /// If I is the head of a bundle of instructions, the whole bundle will be
979  /// erased.
981  return erase(iterator(I));
982  }
983 
984  /// Remove the unbundled instruction from the instruction list without
985  /// deleting it.
986  ///
987  /// This function can not be used to remove bundled instructions, use
988  /// remove_instr to remove individual instructions from a bundle.
990  assert(!I->isBundled() && "Cannot remove bundled instructions");
991  return Insts.remove(instr_iterator(I));
992  }
993 
994  /// Remove the possibly bundled instruction from the instruction list
995  /// without deleting it.
996  ///
997  /// If the instruction is part of a bundle, the other instructions in the
998  /// bundle will still be bundled after removing the single instruction.
1000 
1001  void clear() {
1002  Insts.clear();
1003  }
1004 
1005  /// Take an instruction from MBB 'Other' at the position From, and insert it
1006  /// into this MBB right before 'Where'.
1007  ///
1008  /// If From points to a bundle of instructions, the whole bundle is moved.
1010  // The range splice() doesn't allow noop moves, but this one does.
1011  if (Where != From)
1012  splice(Where, Other, From, std::next(From));
1013  }
1014 
1015  /// Take a block of instructions from MBB 'Other' in the range [From, To),
1016  /// and insert them into this MBB right before 'Where'.
1017  ///
1018  /// The instruction at 'Where' must not be included in the range of
1019  /// instructions to move.
1020  void splice(iterator Where, MachineBasicBlock *Other,
1021  iterator From, iterator To) {
1022  Insts.splice(Where.getInstrIterator(), Other->Insts,
1023  From.getInstrIterator(), To.getInstrIterator());
1024  }
1025 
1026  /// This method unlinks 'this' from the containing function, and returns it,
1027  /// but does not delete it.
1029 
1030  /// This method unlinks 'this' from the containing function and deletes it.
1031  void eraseFromParent();
1032 
1033  /// Given a machine basic block that branched to 'Old', change the code and
1034  /// CFG so that it branches to 'New' instead.
1036 
1037  /// Update all phi nodes in this basic block to refer to basic block \p New
1038  /// instead of basic block \p Old.
1040 
1041  /// Find the next valid DebugLoc starting at MBBI, skipping any DBG_VALUE
1042  /// and DBG_LABEL instructions. Return UnknownLoc if there is none.
1045  return findDebugLoc(MBBI.getInstrIterator());
1046  }
1047 
1048  /// Has exact same behavior as @ref findDebugLoc (it also
1049  /// searches from the first to the last MI of this MBB) except
1050  /// that this takes reverse iterator.
1053  return rfindDebugLoc(MBBI.getInstrIterator());
1054  }
1055 
1056  /// Find the previous valid DebugLoc preceding MBBI, skipping and DBG_VALUE
1057  /// instructions. Return UnknownLoc if there is none.
1060  return findPrevDebugLoc(MBBI.getInstrIterator());
1061  }
1062 
1063  /// Has exact same behavior as @ref findPrevDebugLoc (it also
1064  /// searches from the last to the first MI of this MBB) except
1065  /// that this takes reverse iterator.
1068  return rfindPrevDebugLoc(MBBI.getInstrIterator());
1069  }
1070 
1071  /// Find and return the merged DebugLoc of the branch instructions of the
1072  /// block. Return UnknownLoc if there is none.
1074 
1075  /// Possible outcome of a register liveness query to computeRegisterLiveness()
1077  LQR_Live, ///< Register is known to be (at least partially) live.
1078  LQR_Dead, ///< Register is known to be fully dead.
1079  LQR_Unknown ///< Register liveness not decidable from local neighborhood.
1080  };
1081 
1082  /// Return whether (physical) register \p Reg has been defined and not
1083  /// killed as of just before \p Before.
1084  ///
1085  /// Search is localised to a neighborhood of \p Neighborhood instructions
1086  /// before (searching for defs or kills) and \p Neighborhood instructions
1087  /// after (searching just for defs) \p Before.
1088  ///
1089  /// \p Reg must be a physical register.
1091  MCRegister Reg,
1092  const_iterator Before,
1093  unsigned Neighborhood = 10) const;
1094 
1095  // Debugging methods.
1096  void dump() const;
1097  void print(raw_ostream &OS, const SlotIndexes * = nullptr,
1098  bool IsStandalone = true) const;
1099  void print(raw_ostream &OS, ModuleSlotTracker &MST,
1100  const SlotIndexes * = nullptr, bool IsStandalone = true) const;
1101 
1103  PrintNameIr = (1 << 0), ///< Add IR name where available
1104  PrintNameAttributes = (1 << 1), ///< Print attributes
1105  };
1106 
1107  void printName(raw_ostream &os, unsigned printNameFlags = PrintNameIr,
1108  ModuleSlotTracker *moduleSlotTracker = nullptr) const;
1109 
1110  // Printing method used by LoopInfo.
1111  void printAsOperand(raw_ostream &OS, bool PrintType = true) const;
1112 
1113  /// MachineBasicBlocks are uniquely numbered at the function level, unless
1114  /// they're not in a MachineFunction yet, in which case this will return -1.
1115  int getNumber() const { return Number; }
1116  void setNumber(int N) { Number = N; }
1117 
1118  /// Return the MCSymbol for this basic block.
1119  MCSymbol *getSymbol() const;
1120 
1121  /// Return the EHCatchret Symbol for this basic block.
1122  MCSymbol *getEHCatchretSymbol() const;
1123 
1125  return IrrLoopHeaderWeight;
1126  }
1127 
1129  IrrLoopHeaderWeight = Weight;
1130  }
1131 
1132  /// Return probability of the edge from this block to MBB. This method should
1133  /// NOT be called directly, but by using getEdgeProbability method from
1134  /// MachineBranchProbabilityInfo class.
1136 
1137 private:
1138  /// Return probability iterator corresponding to the I successor iterator.
1139  probability_iterator getProbabilityIterator(succ_iterator I);
1140  const_probability_iterator
1141  getProbabilityIterator(const_succ_iterator I) const;
1142 
1144  friend class MIPrinter;
1145 
1146  // Methods used to maintain doubly linked list of blocks...
1148 
1149  // Machine-CFG mutators
1150 
1151  /// Add Pred as a predecessor of this MachineBasicBlock. Don't do this
1152  /// unless you know what you're doing, because it doesn't update Pred's
1153  /// successors list. Use Pred->addSuccessor instead.
1154  void addPredecessor(MachineBasicBlock *Pred);
1155 
1156  /// Remove Pred as a predecessor of this MachineBasicBlock. Don't do this
1157  /// unless you know what you're doing, because it doesn't update Pred's
1158  /// successors list. Use Pred->removeSuccessor instead.
1159  void removePredecessor(MachineBasicBlock *Pred);
1160 };
1161 
1163 
1164 /// Prints a machine basic block reference.
1165 ///
1166 /// The format is:
1167 /// %bb.5 - a machine basic block with MBB.getNumber() == 5.
1168 ///
1169 /// Usage: OS << printMBBReference(MBB) << '\n';
1171 
1172 // This is useful when building IndexedMaps keyed on basic block pointers.
1175  unsigned operator()(const MachineBasicBlock *MBB) const {
1176  return MBB->getNumber();
1177  }
1178 };
1179 
1180 //===--------------------------------------------------------------------===//
1181 // GraphTraits specializations for machine basic block graphs (machine-CFGs)
1182 //===--------------------------------------------------------------------===//
1183 
1184 // Provide specializations of GraphTraits to be able to treat a
1185 // MachineFunction as a graph of MachineBasicBlocks.
1186 //
1187 
1188 template <> struct GraphTraits<MachineBasicBlock *> {
1191 
1193  static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); }
1194  static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
1195 };
1196 
1197 template <> struct GraphTraits<const MachineBasicBlock *> {
1198  using NodeRef = const MachineBasicBlock *;
1200 
1201  static NodeRef getEntryNode(const MachineBasicBlock *BB) { return BB; }
1202  static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); }
1203  static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
1204 };
1205 
1206 // Provide specializations of GraphTraits to be able to treat a
1207 // MachineFunction as a graph of MachineBasicBlocks and to walk it
1208 // in inverse order. Inverse order for a function is considered
1209 // to be when traversing the predecessor edges of a MBB
1210 // instead of the successor edges.
1211 //
1212 template <> struct GraphTraits<Inverse<MachineBasicBlock*>> {
1215 
1217  return G.Graph;
1218  }
1219 
1220  static ChildIteratorType child_begin(NodeRef N) { return N->pred_begin(); }
1221  static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
1222 };
1223 
1225  using NodeRef = const MachineBasicBlock *;
1227 
1229  return G.Graph;
1230  }
1231 
1232  static ChildIteratorType child_begin(NodeRef N) { return N->pred_begin(); }
1233  static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
1234 };
1235 
1236 /// MachineInstrSpan provides an interface to get an iteration range
1237 /// containing the instruction it was initialized with, along with all
1238 /// those instructions inserted prior to or following that instruction
1239 /// at some point after the MachineInstrSpan is constructed.
1241  MachineBasicBlock &MBB;
1243 
1244 public:
1246  : MBB(*BB), I(I), B(I == MBB.begin() ? MBB.end() : std::prev(I)),
1247  E(std::next(I)) {
1248  assert(I == BB->end() || I->getParent() == BB);
1249  }
1250 
1252  return B == MBB.end() ? MBB.begin() : std::next(B);
1253  }
1255  bool empty() { return begin() == end(); }
1256 
1258 };
1259 
1260 /// Increment \p It until it points to a non-debug instruction or to \p End
1261 /// and return the resulting iterator. This function should only be used
1262 /// MachineBasicBlock::{iterator, const_iterator, instr_iterator,
1263 /// const_instr_iterator} and the respective reverse iterators.
1264 template <typename IterT>
1265 inline IterT skipDebugInstructionsForward(IterT It, IterT End,
1266  bool SkipPseudoOp = true) {
1267  while (It != End &&
1268  (It->isDebugInstr() || (SkipPseudoOp && It->isPseudoProbe())))
1269  ++It;
1270  return It;
1271 }
1272 
1273 /// Decrement \p It until it points to a non-debug instruction or to \p Begin
1274 /// and return the resulting iterator. This function should only be used
1275 /// MachineBasicBlock::{iterator, const_iterator, instr_iterator,
1276 /// const_instr_iterator} and the respective reverse iterators.
1277 template <class IterT>
1278 inline IterT skipDebugInstructionsBackward(IterT It, IterT Begin,
1279  bool SkipPseudoOp = true) {
1280  while (It != Begin &&
1281  (It->isDebugInstr() || (SkipPseudoOp && It->isPseudoProbe())))
1282  --It;
1283  return It;
1284 }
1285 
1286 /// Increment \p It, then continue incrementing it while it points to a debug
1287 /// instruction. A replacement for std::next.
1288 template <typename IterT>
1289 inline IterT next_nodbg(IterT It, IterT End, bool SkipPseudoOp = true) {
1290  return skipDebugInstructionsForward(std::next(It), End, SkipPseudoOp);
1291 }
1292 
1293 /// Decrement \p It, then continue decrementing it while it points to a debug
1294 /// instruction. A replacement for std::prev.
1295 template <typename IterT>
1296 inline IterT prev_nodbg(IterT It, IterT Begin, bool SkipPseudoOp = true) {
1297  return skipDebugInstructionsBackward(std::prev(It), Begin, SkipPseudoOp);
1298 }
1299 
1300 /// Construct a range iterator which begins at \p It and moves forwards until
1301 /// \p End is reached, skipping any debug instructions.
1302 template <typename IterT>
1303 inline auto instructionsWithoutDebug(IterT It, IterT End,
1304  bool SkipPseudoOp = true) {
1305  return make_filter_range(make_range(It, End), [=](const MachineInstr &MI) {
1306  return !MI.isDebugInstr() && !(SkipPseudoOp && MI.isPseudoProbe());
1307  });
1308 }
1309 
1310 } // end namespace llvm
1311 
1312 #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:1289
llvm::MachineBasicBlock::RegisterMaskPair::PhysReg
MCPhysReg PhysReg
Definition: MachineBasicBlock.h:102
llvm::MachineBasicBlock::isMachineBlockAddressTaken
bool isMachineBlockAddressTaken() const
Test whether this block is used as something other than the target of a terminator,...
Definition: MachineBasicBlock.h:235
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:1233
const_iterator
llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::getEntryNode
static NodeRef getEntryNode(Inverse< const MachineBasicBlock * > G)
Definition: MachineBasicBlock.h:1228
llvm::MachineBasicBlock::succ_size
unsigned succ_size() const
Definition: MachineBasicBlock.h:381
llvm::MachineBasicBlock::terminators
iterator_range< const_iterator > terminators() const
Definition: MachineBasicBlock.h:328
llvm::MachineBasicBlock::pred_begin
pred_iterator pred_begin()
Definition: MachineBasicBlock.h:353
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:108
MachineInstr.h
llvm::MachineBasicBlock::setIrrLoopHeaderWeight
void setIrrLoopHeaderWeight(uint64_t Weight)
Definition: MachineBasicBlock.h:1128
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::MachineBasicBlock::rend
const_reverse_iterator rend() const
Definition: MachineBasicBlock.h:316
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:1020
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:590
llvm::MachineBasicBlock::setIsCleanupFuncletEntry
void setIsCleanupFuncletEntry(bool V=true)
Indicates if this is the entry block of a cleanup funclet.
Definition: MachineBasicBlock.h:611
llvm::MachineBasicBlock::LivenessQueryResult
LivenessQueryResult
Possible outcome of a register liveness query to computeRegisterLiveness()
Definition: MachineBasicBlock.h:1076
llvm::MachineBasicBlock::getBasicBlock
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
Definition: MachineBasicBlock.h:209
llvm::MBBSectionID::Exception
@ Exception
Definition: MachineBasicBlock.h:55
llvm::MachineBasicBlock::PrintNameFlag
PrintNameFlag
Definition: MachineBasicBlock.h:1102
llvm::MachineBasicBlock::erase
iterator erase(iterator I)
Remove an instruction or bundle from the instruction list and delete it.
Definition: MachineBasicBlock.h:972
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:1353
llvm::MachineInstrSpan
MachineInstrSpan provides an interface to get an iteration range containing the instruction it was in...
Definition: MachineBasicBlock.h:1240
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:300
llvm::MachineBasicBlock::clear
void clear()
Definition: MachineBasicBlock.h:1001
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:868
llvm::MachineBasicBlock::isEHFuncletEntry
bool isEHFuncletEntry() const
Returns true if this is the entry block of an EH funclet.
Definition: MachineBasicBlock.h:602
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:965
llvm::MachineBasicBlock::instrs
const_instr_range instrs() const
Definition: MachineBasicBlock.h:301
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:940
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:599
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:1638
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:1465
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:864
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:342
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::isIRBlockAddressTaken
bool isIRBlockAddressTaken() const
Test whether this block is the target of an IR BlockAddress.
Definition: MachineBasicBlock.h:239
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:1387
llvm::TargetRegisterInfo
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Definition: TargetRegisterInfo.h:237
llvm::MachineBasicBlock::livein_iterator
LiveInVector::const_iterator livein_iterator
Definition: MachineBasicBlock.h:435
llvm::MachineBasicBlock::succ_rend
const_succ_reverse_iterator succ_rend() const
Definition: MachineBasicBlock.h:379
llvm::GraphTraits< const MachineBasicBlock * >::getEntryNode
static NodeRef getEntryNode(const MachineBasicBlock *BB)
Definition: MachineBasicBlock.h:1201
llvm::MachineBasicBlock::moveBefore
void moveBefore(MachineBasicBlock *NewAfter)
Move 'this' block before or after the specified block.
Definition: MachineBasicBlock.cpp:648
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:449
llvm::MachineBasicBlock::liveout_iterator::operator*
reference operator*() const
Definition: MachineBasicBlock.h:498
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:1124
llvm::GraphTraits< const MachineBasicBlock * >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition: MachineBasicBlock.h:1203
llvm::MachineBasicBlock::front
const MachineInstr & front() const
Definition: MachineBasicBlock.h:286
llvm::MachineBasicBlock::back
MachineInstr & back()
Definition: MachineBasicBlock.h:285
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition: MachineBasicBlock.h:1220
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:771
llvm::MachineBasicBlock::successors
iterator_range< const_succ_iterator > successors() const
Definition: MachineBasicBlock.h:395
llvm::MachineBasicBlock::terminators
iterator_range< iterator > terminators()
Definition: MachineBasicBlock.h:325
llvm::MBBSectionID
Definition: MachineBasicBlock.h:51
llvm::MachineBasicBlock::clearBasicBlock
void clearBasicBlock()
Remove the reference to the underlying IR BasicBlock.
Definition: MachineBasicBlock.h:213
llvm::MachineBasicBlock::rfindPrevDebugLoc
DebugLoc rfindPrevDebugLoc(reverse_iterator MBBI)
Definition: MachineBasicBlock.h:1067
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:862
llvm::MachineBasicBlock::insert
iterator insert(iterator I, MachineInstr *MI)
Insert MI into the instruction list before I.
Definition: MachineBasicBlock.h:921
llvm::MachineBasicBlock::succ_reverse_iterator
std::vector< MachineBasicBlock * >::reverse_iterator succ_reverse_iterator
Definition: MachineBasicBlock.h:350
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:1199
llvm::GraphTraits< MachineBasicBlock * >::getEntryNode
static NodeRef getEntryNode(MachineBasicBlock *BB)
Definition: MachineBasicBlock.h:1192
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:373
llvm::MachineBasicBlock::const_instr_iterator
Instructions::const_iterator const_instr_iterator
Definition: MachineBasicBlock.h:265
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:55
llvm::MachineBasicBlock::pop_back
void pop_back()
Definition: MachineBasicBlock.h:901
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:299
llvm::MachineBasicBlock::erase
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
Definition: MachineBasicBlock.cpp:1313
llvm::MachineBasicBlock::isBeginSection
bool isBeginSection() const
Returns true if this block begins any section.
Definition: MachineBasicBlock.h:614
llvm::MachineBasicBlock::succ_rbegin
const_succ_reverse_iterator succ_rbegin() const
Definition: MachineBasicBlock.h:375
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:481
SparseBitVector.h
llvm::MachineBasicBlock::setSectionID
void setSectionID(MBBSectionID V)
Sets the section ID for this basic block.
Definition: MachineBasicBlock.h:633
llvm::MachineBasicBlock::addSuccessor
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
Definition: MachineBasicBlock.cpp:761
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:271
llvm::MachineBasicBlock::instr_end
const_instr_iterator instr_end() const
Definition: MachineBasicBlock.h:292
llvm::MachineBasicBlock::push_back
void push_back(MachineInstr *MI)
Definition: MachineBasicBlock.h:902
llvm::MachineBasicBlock::pred_size
unsigned pred_size() const
Definition: MachineBasicBlock.h:365
llvm::MachineBasicBlock::liveouts
iterator_range< liveout_iterator > liveouts() const
Definition: MachineBasicBlock.h:543
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:649
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:771
llvm::MachineBasicBlock::insertAfter
iterator insertAfter(iterator I, MachineInstr *MI)
Insert MI into the instruction list after I.
Definition: MachineBasicBlock.h:930
llvm::MachineBasicBlock::removeFromParent
MachineBasicBlock * removeFromParent()
This method unlinks 'this' from the containing function, and returns it, but does not delete it.
Definition: MachineBasicBlock.cpp:1339
llvm::MachineBasicBlock::remove
MachineInstr * remove(MachineInstr *I)
Remove the unbundled instruction from the instruction list without deleting it.
Definition: MachineBasicBlock.h:989
llvm::MachineBranchProbabilityInfo
Definition: MachineBranchProbabilityInfo.h:22
llvm::MachineBasicBlock::liveout_iterator::operator++
liveout_iterator operator++(int)
Definition: MachineBasicBlock.h:492
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::MachineBasicBlock::succ_end
succ_iterator succ_end()
Definition: MachineBasicBlock.h:371
llvm::MBBSectionID::SectionType
SectionType
Definition: MachineBasicBlock.h:52
llvm::MachineBasicBlock::MachineFunction
friend class MachineFunction
Definition: MachineBasicBlock.h:203
llvm::MachineBasicBlock::getMaxBytesForAlignment
unsigned getMaxBytesForAlignment() const
Return the maximum amount of padding allowed for aligning the basic block.
Definition: MachineBasicBlock.h:567
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition: MachineBasicBlock.h:1221
llvm::MachineBasicBlock::isSuccessor
bool isSuccessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB is a successor of this block.
Definition: MachineBasicBlock.cpp:923
llvm::MachineBasicBlock::eraseFromParent
void eraseFromParent()
This method unlinks 'this' from the containing function and deletes it.
Definition: MachineBasicBlock.cpp:1346
llvm::TargetRegisterClass
Definition: TargetRegisterInfo.h:46
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:570
llvm::MachineBasicBlock::pred_begin
const_pred_iterator pred_begin() const
Definition: MachineBasicBlock.h:354
llvm::MachineBasicBlock::getAddressTakenIRBlock
BasicBlock * getAddressTakenIRBlock() const
Retrieves the BasicBlock which corresponds to this MachineBasicBlock.
Definition: MachineBasicBlock.h:242
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:315
llvm::MachineBasicBlock::const_succ_reverse_iterator
std::vector< MachineBasicBlock * >::const_reverse_iterator const_succ_reverse_iterator
Definition: MachineBasicBlock.h:352
llvm::MachineBasicBlock::pred_rbegin
pred_reverse_iterator pred_rbegin()
Definition: MachineBasicBlock.h:357
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:984
llvm::MachineBasicBlock::isEHCatchretTarget
bool isEHCatchretTarget() const
Returns true if this is a target block of a catchret.
Definition: MachineBasicBlock.h:596
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
llvm::MachineBasicBlock::instr_back
MachineInstr & instr_back()
Definition: MachineBasicBlock.h:280
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:230
llvm::SlotIndexes
SlotIndexes pass.
Definition: SlotIndexes.h:319
llvm::MachineInstrSpan::begin
MachineBasicBlock::iterator begin()
Definition: MachineBasicBlock.h:1251
DebugLoc.h
llvm::MachineBasicBlock::isCleanupFuncletEntry
bool isCleanupFuncletEntry() const
Returns true if this is the entry block of a cleanup funclet.
Definition: MachineBasicBlock.h:608
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:1254
llvm::BranchProbability::getUnknown
static BranchProbability getUnknown()
Definition: BranchProbability.h:51
llvm::MachineBasicBlock::getLastNonDebugInstr
const_iterator getLastNonDebugInstr(bool SkipPseudoOp=true) const
Definition: MachineBasicBlock.h:857
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:870
llvm::MachineBasicBlock::findPrevDebugLoc
DebugLoc findPrevDebugLoc(instr_iterator MBBI)
Find the previous valid DebugLoc preceding MBBI, skipping and DBG_VALUE instructions.
Definition: MachineBasicBlock.cpp:1405
llvm::GraphTraits< MachineBasicBlock * >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition: MachineBasicBlock.h:1193
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::ChildIteratorType
MachineBasicBlock::pred_iterator ChildIteratorType
Definition: MachineBasicBlock.h:1214
llvm::MachineBasicBlock::getSectionIDNum
unsigned getSectionIDNum() const
Returns the unique section ID number of this basic block.
Definition: MachineBasicBlock.h:627
llvm::MachineBasicBlock::setAlignment
void setAlignment(Align A)
Set alignment of the basic block.
Definition: MachineBasicBlock.h:559
llvm::ilist_traits
Template traits for intrusive list.
Definition: ilist.h:90
llvm::MachineBasicBlock::back
const MachineInstr & back() const
Definition: MachineBasicBlock.h:287
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:1257
llvm::MachineBasicBlock::succ_iterator
std::vector< MachineBasicBlock * >::iterator succ_iterator
Definition: MachineBasicBlock.h:343
llvm::MachineBasicBlock::getSuccProbability
BranchProbability getSuccProbability(const_succ_iterator Succ) const
Return probability of the edge from this block to MBB.
Definition: MachineBasicBlock.cpp:1443
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::getEntryNode
static NodeRef getEntryNode(Inverse< MachineBasicBlock * > G)
Definition: MachineBasicBlock.h:1216
llvm::MachineInstrSpan::empty
bool empty()
Definition: MachineBasicBlock.h:1255
llvm::MachineBasicBlock::hasSuccessorProbabilities
bool hasSuccessorProbabilities() const
Return true if any of the successors have probabilities attached to them.
Definition: MachineBasicBlock.h:752
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:566
llvm::MachineBasicBlock::setAddressTakenIRBlock
void setAddressTakenIRBlock(BasicBlock *BB)
Set this block to reflect that it corresponds to an IR-level basic block with a BlockAddress.
Definition: MachineBasicBlock.h:251
llvm::MachineBasicBlock::instr_back
const MachineInstr & instr_back() const
Definition: MachineBasicBlock.h:282
llvm::MachineBasicBlock::liveout_iterator::operator==
bool operator==(const liveout_iterator &RHS) const
Definition: MachineBasicBlock.h:506
llvm::MachineBasicBlock::setAlignment
void setAlignment(Align A, unsigned MaxBytes)
Definition: MachineBasicBlock.h:561
llvm::MachineBasicBlock::pred_end
pred_iterator pred_end()
Definition: MachineBasicBlock.h:355
llvm::MachineBasicBlock::instr_rend
reverse_instr_iterator instr_rend()
Definition: MachineBasicBlock.h:295
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:66
uint64_t
llvm::MachineBasicBlock::hasAddressTaken
bool hasAddressTaken() const
Test whether this block is used as as something other than the target of a terminator,...
Definition: MachineBasicBlock.h:227
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:580
llvm::MachineBasicBlock::getSingleSuccessor
const MachineBasicBlock * getSingleSuccessor() const
Return the successor of this block if it has a single successor.
Definition: MachineBasicBlock.cpp:932
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:308
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:293
llvm::MachineBasicBlock::LQR_Live
@ LQR_Live
Register is known to be (at least partially) live.
Definition: MachineBasicBlock.h:1077
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:810
llvm::GraphTraits< const MachineBasicBlock * >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition: MachineBasicBlock.h:1202
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:1226
llvm::MachineBasicBlock::liveout_end
liveout_iterator liveout_end() const
Definition: MachineBasicBlock.h:540
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:1296
llvm::MachineBasicBlock::succ_end
const_succ_iterator succ_end() const
Definition: MachineBasicBlock.h:372
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:556
llvm::MachineBasicBlock::liveout_iterator::iterator_category
std::input_iterator_tag iterator_category
Definition: MachineBasicBlock.h:458
llvm::MachineBasicBlock::pred_iterator
std::vector< MachineBasicBlock * >::iterator pred_iterator
Definition: MachineBasicBlock.h:341
llvm::MachineBasicBlock::setIsEndSection
void setIsEndSection(bool V=true)
Definition: MachineBasicBlock.h:621
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:281
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:980
llvm::MachineBasicBlock::size
unsigned size() const
Definition: MachineBasicBlock.h:275
llvm::MachineBasicBlock::succ_rend
succ_reverse_iterator succ_rend()
Definition: MachineBasicBlock.h:377
llvm::MachineBasicBlock::succ_begin
succ_iterator succ_begin()
Definition: MachineBasicBlock.h:369
llvm::MachineBasicBlock::getParent
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
Definition: MachineBasicBlock.h:261
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:512
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:1175
llvm::MachineBasicBlock::instr_rend
const_reverse_instr_iterator instr_rend() const
Definition: MachineBasicBlock.h:296
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:447
llvm::MachineBasicBlock::pred_rbegin
const_pred_reverse_iterator pred_rbegin() const
Definition: MachineBasicBlock.h:359
llvm::MachineBasicBlock::predecessors
iterator_range< pred_iterator > predecessors()
Definition: MachineBasicBlock.h:386
llvm::MachineBasicBlock::reverse_instr_iterator
Instructions::reverse_iterator reverse_instr_iterator
Definition: MachineBasicBlock.h:266
llvm::MachineBasicBlock::LQR_Dead
@ LQR_Dead
Register is known to be fully dead.
Definition: MachineBasicBlock.h:1078
llvm::MachineInstr::isReturn
bool isReturn(QueryType Type=AnyInBundle) const
Definition: MachineInstr.h:862
llvm::MachineBasicBlock::instr_begin
instr_iterator instr_begin()
Definition: MachineBasicBlock.h:289
llvm::MachineBasicBlock::pred_empty
bool pred_empty() const
Definition: MachineBasicBlock.h:368
llvm::GraphTraits< MachineBasicBlock * >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition: MachineBasicBlock.h:1194
llvm::MachineBasicBlock::setIsEHFuncletEntry
void setIsEHFuncletEntry(bool V=true)
Indicates if this is the entry block of an EH funclet.
Definition: MachineBasicBlock.h:605
llvm::MachineBasicBlock::instr_end
instr_iterator instr_end()
Definition: MachineBasicBlock.h:291
llvm::MachineFunction
Definition: MachineFunction.h:257
llvm::MachineBasicBlock::moveAfter
void moveAfter(MachineBasicBlock *NewBefore)
Definition: MachineBasicBlock.cpp:652
llvm::MachineBasicBlock::succ_empty
bool succ_empty() const
Definition: MachineBasicBlock.h:384
llvm::MachineBasicBlock::PrintNameIr
@ PrintNameIr
Add IR name where available.
Definition: MachineBasicBlock.h:1103
llvm::MachineBasicBlock::hasLabelMustBeEmitted
bool hasLabelMustBeEmitted() const
Test whether this block must have its label emitted.
Definition: MachineBasicBlock.h:254
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:1265
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:1597
llvm::MachineBasicBlock::phis
iterator_range< iterator > phis()
Returns a range that iterates over the phis in the basic block.
Definition: MachineBasicBlock.h:333
llvm::MachineBasicBlock::iterator
MachineInstrBundleIterator< MachineInstr > iterator
Definition: MachineBasicBlock.h:269
llvm::MachineBasicBlock::setMachineBlockAddressTaken
void setMachineBlockAddressTaken()
Set this block to indicate that its address is used as something other than the target of a terminato...
Definition: MachineBasicBlock.h:247
llvm::MachineBasicBlock::getNumber
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
Definition: MachineBasicBlock.h:1115
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:589
llvm::MachineBasicBlock::PrintNameAttributes
@ PrintNameAttributes
Print attributes.
Definition: MachineBasicBlock.h:1104
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:392
llvm::MachineBasicBlock::isEHPad
bool isEHPad() const
Returns true if the block is a landing pad.
Definition: MachineBasicBlock.h:576
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm::MachineBasicBlock::getFirstNonDebugInstr
const_iterator getFirstNonDebugInstr(bool SkipPseudoOp=true) const
Definition: MachineBasicBlock.h:835
llvm::MachineBasicBlock::rbegin
reverse_iterator rbegin()
Definition: MachineBasicBlock.h:309
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:1009
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:442
llvm::MachineBasicBlock::findBranchDebugLoc
DebugLoc findBranchDebugLoc()
Find and return the merged DebugLoc of the branch instructions of the block.
Definition: MachineBasicBlock.cpp:1426
llvm::MachineBasicBlock::removeLiveIn
void removeLiveIn(MCPhysReg Reg, LaneBitmask LaneMask=LaneBitmask::getAll())
Remove the specified register from the live in set.
Definition: MachineBasicBlock.cpp:572
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:1395
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:441
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:1245
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:780
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:1621
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:880
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:512
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:258
llvm::MachineBasicBlock::getSectionID
MBBSectionID getSectionID() const
Returns the section ID of this basic block.
Definition: MachineBasicBlock.h:624
llvm::MachineBasicBlock::pred_end
const_pred_iterator pred_end() const
Definition: MachineBasicBlock.h:356
llvm::MachineBasicBlock::instr_front
MachineInstr & instr_front()
Definition: MachineBasicBlock.h:279
llvm::MachineBasicBlock::addLiveIn
void addLiveIn(const RegisterMaskPair &RegMaskPair)
Definition: MachineBasicBlock.h:408
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:593
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:404
llvm::MachineBasicBlock::isPredecessor
bool isPredecessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB is a predecessor of this block.
Definition: MachineBasicBlock.cpp:919
llvm::MachineBasicBlock::phis
iterator_range< const_iterator > phis() const
Definition: MachineBasicBlock.h:336
llvm::MachineBasicBlock::succ_begin
const_succ_iterator succ_begin() const
Definition: MachineBasicBlock.h:370
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:1116
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:1259
llvm::MachineBasicBlock::const_reverse_iterator
MachineInstrBundleIterator< const MachineInstr, true > const_reverse_iterator
Definition: MachineBasicBlock.h:273
llvm::MachineBasicBlock::replaceSuccessor
void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New)
Replace successor OLD with NEW and update probability info.
Definition: MachineBasicBlock.cpp:822
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:1374
llvm::MachineBasicBlock::sortUniqueLiveIns
void sortUniqueLiveIns()
Sorts and uniques the LiveIns vector.
Definition: MachineBasicBlock.cpp:596
uint16_t
llvm::MachineBasicBlock::removeSuccessor
void removeSuccessor(MachineBasicBlock *Succ, bool NormalizeSuccProbs=false)
Remove successor from the successors list of this MachineBasicBlock.
Definition: MachineBasicBlock.cpp:799
llvm::MachineBasicBlock::isEndSection
bool isEndSection() const
Returns true if this block ends any section.
Definition: MachineBasicBlock.h:617
llvm::GraphTraits< MachineBasicBlock * >::ChildIteratorType
MachineBasicBlock::succ_iterator ChildIteratorType
Definition: MachineBasicBlock.h:1190
llvm::MachineBasicBlock::erase
iterator erase(MachineInstr *I)
Remove an instruction from the instruction list and delete it.
Definition: MachineBasicBlock.h:980
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:1326
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:1499
llvm::MBBSectionID::operator!=
bool operator!=(const MBBSectionID &Other) const
Definition: MachineBasicBlock.h:70
llvm::MachineBasicBlock::liveout_iterator
Definition: MachineBasicBlock.h:456
llvm::MachineBasicBlock::instr_iterator
Instructions::iterator instr_iterator
Definition: MachineBasicBlock.h:264
llvm::MachineBasicBlock::setIsBeginSection
void setIsBeginSection(bool V=true)
Definition: MachineBasicBlock.h:619
llvm::MachineBasicBlock::pred_reverse_iterator
std::vector< MachineBasicBlock * >::reverse_iterator pred_reverse_iterator
Definition: MachineBasicBlock.h:346
llvm::ilist_callback_traits::removeNodeFromList
void removeNodeFromList(NodeTy *)
Definition: ilist.h:67
llvm::MachineBasicBlock::front
MachineInstr & front()
Definition: MachineBasicBlock.h:284
llvm::MachineBasicBlock::liveout_iterator::operator->
pointer operator->() const
Definition: MachineBasicBlock.h:502
llvm::MBB2NumberFunctor
Definition: MachineBasicBlock.h:1173
llvm::MachineBasicBlock::livein_begin
livein_iterator livein_begin() const
Definition: MachineBasicBlock.cpp:1614
llvm::LiveIntervals
Definition: LiveIntervals.h:53
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:927
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:1413
llvm::MachineBasicBlock::getParent
MachineFunction * getParent()
Definition: MachineBasicBlock.h:262
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:704
llvm::MachineBasicBlock::livein_empty
bool livein_empty() const
Definition: MachineBasicBlock.h:448
llvm::MachineBasicBlock::findPrevDebugLoc
DebugLoc findPrevDebugLoc(iterator MBBI)
Definition: MachineBasicBlock.h:1059
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:936
llvm::MachineBasicBlock::pop_front
void pop_front()
Definition: MachineBasicBlock.h:900
llvm::MachineBasicBlock::validateSuccProbs
void validateSuccProbs() const
Validate successors' probabilities and check if the sum of them is approximate one.
Definition: MachineBasicBlock.cpp:747
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:1603
llvm::MachineBasicBlock::instr_begin
const_instr_iterator instr_begin() const
Definition: MachineBasicBlock.h:290
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:1278
llvm::BranchProbability::normalizeProbabilities
static void normalizeProbabilities(ProbabilityIter Begin, ProbabilityIter End)
Definition: BranchProbability.h:205
llvm::MachineBasicBlock::begin
iterator begin()
Definition: MachineBasicBlock.h:305
llvm::MachineBasicBlock::isInlineAsmBrIndirectTarget
bool isInlineAsmBrIndirectTarget() const
Returns true if this is the indirect dest of an INLINEASM_BR.
Definition: MachineBasicBlock.h:644
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:1044
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:344
llvm::MachineBasicBlock::empty
bool empty() const
Definition: MachineBasicBlock.h:277
llvm::MachineBasicBlock::clearLiveIns
void clearLiveIns()
Clear live in list.
Definition: MachineBasicBlock.cpp:1610
llvm::simple_ilist
A simple intrusive list implementation.
Definition: simple_ilist.h:78
llvm::MachineBasicBlock::begin
const_iterator begin() const
Definition: MachineBasicBlock.h:306
llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition: MachineBasicBlock.h:1232
llvm::MachineBasicBlock::erase_instr
instr_iterator erase_instr(MachineInstr *I)
Remove an instruction from the instruction list and delete it.
Definition: MachineBasicBlock.h:960
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:914
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:900
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:361
llvm::MachineBasicBlock::const_pred_reverse_iterator
std::vector< MachineBasicBlock * >::const_reverse_iterator const_pred_reverse_iterator
Definition: MachineBasicBlock.h:348
llvm::MachineBasicBlock::LQR_Unknown
@ LQR_Unknown
Register liveness not decidable from local neighborhood.
Definition: MachineBasicBlock.h:1079
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:312
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:656
llvm::MachineBasicBlock::instr_range
iterator_range< instr_iterator > instr_range
Definition: MachineBasicBlock.h:298
llvm::MachineBasicBlock::rfindDebugLoc
DebugLoc rfindDebugLoc(reverse_iterator MBBI)
Definition: MachineBasicBlock.h:1052
llvm::MachineBasicBlock::pred_rend
const_pred_reverse_iterator pred_rend() const
Definition: MachineBasicBlock.h:363
llvm::CallingConv::Cold
@ Cold
Attempts to make code in the caller as efficient as possible under the assumption that the call is no...
Definition: CallingConv.h:47
llvm::MachineBasicBlock::liveout_iterator::difference_type
std::ptrdiff_t difference_type
Definition: MachineBasicBlock.h:459
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::MachineBasicBlock::getSublistAccess
static Instructions MachineBasicBlock::* getSublistAccess(MachineInstr *)
Support for MachineInstr::getNextNode().
Definition: MachineBasicBlock.h:321
llvm::MachineBasicBlock::liveout_iterator::liveout_iterator
liveout_iterator(const MachineBasicBlock &MBB, MCPhysReg ExceptionPointer, MCPhysReg ExceptionSelector, bool End)
Definition: MachineBasicBlock.h:464
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:1025
llvm::MachineBasicBlock::remove_instr
MachineInstr * remove_instr(MachineInstr *I)
Remove the possibly bundled instruction from the instruction list without deleting it.
Definition: MachineBasicBlock.cpp:1318
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:307
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:1303
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1247
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:665
llvm::MachineBasicBlock::predecessors
iterator_range< const_pred_iterator > predecessors() const
Definition: MachineBasicBlock.h:389
llvm::MachineBasicBlock::instr_rbegin
const_reverse_instr_iterator instr_rbegin() const
Definition: MachineBasicBlock.h:294