Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.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/DenseMapInfo.h"
17#include "llvm/ADT/GraphTraits.h"
18#include "llvm/ADT/SparseBitVector.h"
19#include "llvm/ADT/ilist.h"
20#include "llvm/ADT/iterator_range.h"
21#include "llvm/CodeGen/MachineInstr.h"
22#include "llvm/CodeGen/MachineInstrBundleIterator.h"
23#include "llvm/IR/DebugLoc.h"
24#include "llvm/MC/LaneBitmask.h"
25#include "llvm/Support/BranchProbability.h"
26#include <cassert>
27#include <cstdint>
28#include <iterator>
29#include <string>
30#include <vector>
31
32namespacellvm {
33
34classBasicBlock;
35classMachineDomTreeUpdater;
36classMachineFunction;
37classMCSymbol;
38classModuleSlotTracker;
39classPass;
40classPrintable;
41classSlotIndexes;
42classStringRef;
43classraw_ostream;
44classLiveIntervals;
45classTargetRegisterClass;
46classTargetRegisterInfo;
47template <typename IRUnitT,typename... ExtraArgTs>classAnalysisManager;
48usingMachineFunctionAnalysisManager =AnalysisManager<MachineFunction>;
49
50// This structure uniquely identifies a basic block section.
51// Possible values are
52// {Type: Default, Number: (unsigned)} (These are regular section IDs)
53// {Type: Exception, Number: 0} (ExceptionSectionID)
54// {Type: Cold, Number: 0} (ColdSectionID)
55structMBBSectionID {
56enumSectionType {
57Default = 0,// Regular section (these sections are distinguished by the
58// Number field).
59Exception,// Special section type for exception handling blocks
60Cold,// Special section type for cold blocks
61 }Type;
62unsignedNumber;
63
64MBBSectionID(unsignedN) :Type(Default),Number(N) {}
65
66// Special unique sections for cold and exception blocks.
67conststaticMBBSectionIDColdSectionID;
68conststaticMBBSectionIDExceptionSectionID;
69
70booloperator==(constMBBSectionID &Other) const{
71returnType ==Other.Type &&Number ==Other.Number;
72 }
73
74booloperator!=(constMBBSectionID &Other) const{return !(*this ==Other); }
75
76private:
77// This is only used to construct the special cold and exception sections.
78MBBSectionID(SectionTypeT) :Type(T),Number(0) {}
79};
80
81template <>structDenseMapInfo<MBBSectionID> {
82usingTypeInfo =DenseMapInfo<MBBSectionID::SectionType>;
83usingNumberInfo =DenseMapInfo<unsigned>;
84
85staticinlineMBBSectionIDgetEmptyKey() {
86returnMBBSectionID(NumberInfo::getEmptyKey());
87 }
88staticinlineMBBSectionIDgetTombstoneKey() {
89returnMBBSectionID(NumberInfo::getTombstoneKey());
90 }
91staticunsignedgetHashValue(constMBBSectionID &SecID) {
92returndetail::combineHashValue(TypeInfo::getHashValue(SecID.Type),
93 NumberInfo::getHashValue(SecID.Number));
94 }
95staticboolisEqual(constMBBSectionID &LHS,constMBBSectionID &RHS) {
96returnLHS ==RHS;
97 }
98};
99
100// This structure represents the information for a basic block pertaining to
101// the basic block sections profile.
102structUniqueBBID {
103unsignedBaseID;
104unsignedCloneID;
105};
106
107template <>structilist_traits<MachineInstr> {
108private:
109friendclassMachineBasicBlock;// Set by the owning MachineBasicBlock.
110
111MachineBasicBlock *Parent;
112
113usinginstr_iterator =
114simple_ilist<MachineInstr, ilist_sentinel_tracking<true>>::iterator;
115
116public:
117voidaddNodeToList(MachineInstr *N);
118voidremoveNodeFromList(MachineInstr *N);
119voidtransferNodesFromList(ilist_traits &FromList, instr_iteratorFirst,
120 instr_iteratorLast);
121voiddeleteNode(MachineInstr *MI);
122};
123
124classMachineBasicBlock
125 :publicilist_node_with_parent<MachineBasicBlock, MachineFunction> {
126public:
127 /// Pair of physical register and lane mask.
128 /// This is not simply a std::pair typedef because the members should be named
129 /// clearly as they both have an integer type.
130structRegisterMaskPair {
131public:
132MCRegisterPhysReg;
133LaneBitmaskLaneMask;
134
135RegisterMaskPair(MCPhysRegPhysReg,LaneBitmaskLaneMask)
136 :PhysReg(PhysReg),LaneMask(LaneMask) {}
137
138booloperator==(constRegisterMaskPair &other) const{
139returnPhysReg == other.PhysReg &&LaneMask == other.LaneMask;
140 }
141 };
142
143private:
144usingInstructions =ilist<MachineInstr, ilist_sentinel_tracking<true>>;
145
146constBasicBlock *BB;
147int Number;
148
149 /// The call frame size on entry to this basic block due to call frame setup
150 /// instructions in a predecessor. This is usually zero, unless basic blocks
151 /// are split in the middle of a call sequence.
152 ///
153 /// This information is only maintained until PrologEpilogInserter eliminates
154 /// call frame pseudos.
155unsigned CallFrameSize = 0;
156
157MachineFunction *xParent;
158 Instructions Insts;
159
160 /// Keep track of the predecessor / successor basic blocks.
161SmallVector<MachineBasicBlock *, 4> Predecessors;
162SmallVector<MachineBasicBlock *, 2> Successors;
163
164 /// Keep track of the probabilities to the successors. This vector has the
165 /// same order as Successors, or it is empty if we don't use it (disable
166 /// optimization).
167 std::vector<BranchProbability> Probs;
168usingprobability_iterator = std::vector<BranchProbability>::iterator;
169usingconst_probability_iterator =
170 std::vector<BranchProbability>::const_iterator;
171
172 std::optional<uint64_t> IrrLoopHeaderWeight;
173
174 /// Keep track of the physical registers that are livein of the basicblock.
175usingLiveInVector = std::vector<RegisterMaskPair>;
176 LiveInVector LiveIns;
177
178 /// Alignment of the basic block. One if the basic block does not need to be
179 /// aligned.
180Align Alignment;
181 /// Maximum amount of bytes that can be added to align the basic block. If the
182 /// alignment cannot be reached in this many bytes, no bytes are emitted.
183 /// Zero to represent no maximum.
184unsigned MaxBytesForAlignment = 0;
185
186 /// Indicate that this basic block is entered via an exception handler.
187bool IsEHPad =false;
188
189 /// Indicate that this MachineBasicBlock is referenced somewhere other than
190 /// as predecessor/successor, a terminator MachineInstr, or a jump table.
191bool MachineBlockAddressTaken =false;
192
193 /// If this MachineBasicBlock corresponds to an IR-level "blockaddress"
194 /// constant, this contains a pointer to that block.
195BasicBlock *AddressTakenIRBlock =nullptr;
196
197 /// Indicate that this basic block needs its symbol be emitted regardless of
198 /// whether the flow just falls-through to it.
199bool LabelMustBeEmitted =false;
200
201 /// Indicate that this basic block is the entry block of an EH scope, i.e.,
202 /// the block that used to have a catchpad or cleanuppad instruction in the
203 /// LLVM IR.
204bool IsEHScopeEntry =false;
205
206 /// Indicates if this is a target block of a catchret.
207bool IsEHCatchretTarget =false;
208
209 /// Indicate that this basic block is the entry block of an EH funclet.
210bool IsEHFuncletEntry =false;
211
212 /// Indicate that this basic block is the entry block of a cleanup funclet.
213bool IsCleanupFuncletEntry =false;
214
215 /// Fixed unique ID assigned to this basic block upon creation. Used with
216 /// basic block sections and basic block labels.
217 std::optional<UniqueBBID> BBID;
218
219 /// With basic block sections, this stores the Section ID of the basic block.
220MBBSectionID SectionID{0};
221
222// Indicate that this basic block begins a section.
223bool IsBeginSection =false;
224
225// Indicate that this basic block ends a section.
226bool IsEndSection =false;
227
228 /// Indicate that this basic block is the indirect dest of an INLINEASM_BR.
229bool IsInlineAsmBrIndirectTarget =false;
230
231 /// since getSymbol is a relatively heavy-weight operation, the symbol
232 /// is only computed once and is cached.
233mutable MCSymbol *CachedMCSymbol =nullptr;
234
235 /// Cached MCSymbol for this block (used if IsEHCatchRetTarget).
236mutable MCSymbol *CachedEHCatchretMCSymbol =nullptr;
237
238 /// Marks the end of the basic block. Used during basic block sections to
239 /// calculate the size of the basic block, or the BB section ending with it.
240mutable MCSymbol *CachedEndMCSymbol =nullptr;
241
242// Intrusive list support
243 MachineBasicBlock() =default;
244
245explicit MachineBasicBlock(MachineFunction &MF,const BasicBlock *BB);
246
247 ~MachineBasicBlock();
248
249// MachineBasicBlocks are allocated and owned by MachineFunction.
250friendclassMachineFunction;
251
252public:
253 /// Return the LLVM basic block that this instance corresponded to originally.
254 /// Note that this may be NULL if this instance does not correspond directly
255 /// to an LLVM basic block.
256constBasicBlock *getBasicBlock() const{return BB; }
257
258 /// Remove the reference to the underlying IR BasicBlock. This is for
259 /// reduction tools and should generally not be used.
260voidclearBasicBlock() {
261 BB =nullptr;
262 }
263
264 /// Check if there is a name of corresponding LLVM basic block.
265boolhasName()const;
266
267 /// Return the name of the corresponding LLVM basic block, or an empty string.
268StringRefgetName()const;
269
270 /// Return a formatted string to identify this block and its parent function.
271 std::stringgetFullName()const;
272
273 /// Test whether this block is used as something other than the target
274 /// of a terminator, exception-handling target, or jump table. This is
275 /// either the result of an IR-level "blockaddress", or some form
276 /// of target-specific branch lowering.
277boolhasAddressTaken() const{
278return MachineBlockAddressTaken || AddressTakenIRBlock;
279 }
280
281 /// Test whether this block is used as something other than the target of a
282 /// terminator, exception-handling target, jump table, or IR blockaddress.
283 /// For example, its address might be loaded into a register, or
284 /// stored in some branch table that isn't part of MachineJumpTableInfo.
285boolisMachineBlockAddressTaken() const{return MachineBlockAddressTaken; }
286
287 /// Test whether this block is the target of an IR BlockAddress. (There can
288 /// more than one MBB associated with an IR BB where the address is taken.)
289boolisIRBlockAddressTaken() const{return AddressTakenIRBlock; }
290
291 /// Retrieves the BasicBlock which corresponds to this MachineBasicBlock.
292BasicBlock *getAddressTakenIRBlock() const{return AddressTakenIRBlock; }
293
294 /// Set this block to indicate that its address is used as something other
295 /// than the target of a terminator, exception-handling target, jump table,
296 /// or IR-level "blockaddress".
297voidsetMachineBlockAddressTaken() { MachineBlockAddressTaken =true; }
298
299 /// Set this block to reflect that it corresponds to an IR-level basic block
300 /// with a BlockAddress.
301voidsetAddressTakenIRBlock(BasicBlock *BB) { AddressTakenIRBlock = BB; }
302
303 /// Test whether this block must have its label emitted.
304boolhasLabelMustBeEmitted() const{return LabelMustBeEmitted; }
305
306 /// Set this block to reflect that, regardless how we flow to it, we need
307 /// its label be emitted.
308voidsetLabelMustBeEmitted() { LabelMustBeEmitted =true; }
309
310 /// Return the MachineFunction containing this basic block.
311constMachineFunction *getParent() const{return xParent; }
312MachineFunction *getParent() {return xParent; }
313
314usinginstr_iterator =Instructions::iterator;
315usingconst_instr_iterator =Instructions::const_iterator;
316usingreverse_instr_iterator =Instructions::reverse_iterator;
317usingconst_reverse_instr_iterator =Instructions::const_reverse_iterator;
318
319usingiterator =MachineInstrBundleIterator<MachineInstr>;
320usingconst_iterator =MachineInstrBundleIterator<const MachineInstr>;
321usingreverse_iterator =MachineInstrBundleIterator<MachineInstr, true>;
322usingconst_reverse_iterator =
323MachineInstrBundleIterator<const MachineInstr, true>;
324
325unsignedsize() const{return (unsigned)Insts.size(); }
326boolsizeWithoutDebugLargerThan(unsigned Limit)const;
327boolempty() const{return Insts.empty(); }
328
329MachineInstr &instr_front() {return Insts.front(); }
330MachineInstr &instr_back() {return Insts.back(); }
331constMachineInstr &instr_front() const{return Insts.front(); }
332constMachineInstr &instr_back() const{return Insts.back(); }
333
334MachineInstr &front() {return Insts.front(); }
335MachineInstr &back() {return *--end(); }
336constMachineInstr &front() const{return Insts.front(); }
337constMachineInstr &back() const{return *--end(); }
338
339instr_iteratorinstr_begin() {return Insts.begin(); }
340const_instr_iteratorinstr_begin() const{return Insts.begin(); }
341instr_iteratorinstr_end() {return Insts.end(); }
342const_instr_iteratorinstr_end() const{return Insts.end(); }
343reverse_instr_iteratorinstr_rbegin() {return Insts.rbegin(); }
344const_reverse_instr_iteratorinstr_rbegin() const{return Insts.rbegin(); }
345reverse_instr_iteratorinstr_rend () {return Insts.rend(); }
346const_reverse_instr_iteratorinstr_rend () const{return Insts.rend(); }
347
348usinginstr_range =iterator_range<instr_iterator>;
349usingconst_instr_range =iterator_range<const_instr_iterator>;
350instr_rangeinstrs() {returninstr_range(instr_begin(),instr_end()); }
351const_instr_rangeinstrs() const{
352returnconst_instr_range(instr_begin(),instr_end());
353 }
354
355iteratorbegin() {returninstr_begin(); }
356const_iteratorbegin() const{returninstr_begin(); }
357iteratorend () {returninstr_end(); }
358const_iteratorend () const{returninstr_end(); }
359reverse_iteratorrbegin() {
360returnreverse_iterator::getAtBundleBegin(instr_rbegin());
361 }
362const_reverse_iteratorrbegin() const{
363returnconst_reverse_iterator::getAtBundleBegin(instr_rbegin());
364 }
365reverse_iteratorrend() {returnreverse_iterator(instr_rend()); }
366const_reverse_iteratorrend() const{
367returnconst_reverse_iterator(instr_rend());
368 }
369
370 /// Support for MachineInstr::getNextNode().
371staticInstructionsMachineBasicBlock::*getSublistAccess(MachineInstr *) {
372return &MachineBasicBlock::Insts;
373 }
374
375inlineiterator_range<iterator>terminators() {
376returnmake_range(getFirstTerminator(),end());
377 }
378inlineiterator_range<const_iterator>terminators() const{
379returnmake_range(getFirstTerminator(),end());
380 }
381
382 /// Returns a range that iterates over the phis in the basic block.
383inlineiterator_range<iterator>phis() {
384returnmake_range(begin(),getFirstNonPHI());
385 }
386inlineiterator_range<const_iterator>phis() const{
387returnconst_cast<MachineBasicBlock *>(this)->phis();
388 }
389
390// Machine-CFG iterators
391usingpred_iterator =SmallVectorImpl<MachineBasicBlock *>::iterator;
392usingconst_pred_iterator =
393SmallVectorImpl<MachineBasicBlock *>::const_iterator;
394usingsucc_iterator =SmallVectorImpl<MachineBasicBlock *>::iterator;
395usingconst_succ_iterator =
396SmallVectorImpl<MachineBasicBlock *>::const_iterator;
397usingpred_reverse_iterator =
398SmallVectorImpl<MachineBasicBlock *>::reverse_iterator;
399usingconst_pred_reverse_iterator =
400SmallVectorImpl<MachineBasicBlock *>::const_reverse_iterator;
401usingsucc_reverse_iterator =
402SmallVectorImpl<MachineBasicBlock *>::reverse_iterator;
403usingconst_succ_reverse_iterator =
404SmallVectorImpl<MachineBasicBlock *>::const_reverse_iterator;
405pred_iteratorpred_begin() {return Predecessors.begin(); }
406const_pred_iteratorpred_begin() const{return Predecessors.begin(); }
407pred_iteratorpred_end() {return Predecessors.end(); }
408const_pred_iteratorpred_end() const{return Predecessors.end(); }
409pred_reverse_iteratorpred_rbegin()
410 {return Predecessors.rbegin();}
411const_pred_reverse_iteratorpred_rbegin() const
412{return Predecessors.rbegin();}
413pred_reverse_iteratorpred_rend()
414 {return Predecessors.rend(); }
415const_pred_reverse_iteratorpred_rend() const
416{return Predecessors.rend(); }
417unsignedpred_size() const{
418return (unsigned)Predecessors.size();
419 }
420boolpred_empty() const{return Predecessors.empty(); }
421succ_iteratorsucc_begin() {return Successors.begin(); }
422const_succ_iteratorsucc_begin() const{return Successors.begin(); }
423succ_iteratorsucc_end() {return Successors.end(); }
424const_succ_iteratorsucc_end() const{return Successors.end(); }
425succ_reverse_iteratorsucc_rbegin()
426 {return Successors.rbegin(); }
427const_succ_reverse_iteratorsucc_rbegin() const
428{return Successors.rbegin(); }
429succ_reverse_iteratorsucc_rend()
430 {return Successors.rend(); }
431const_succ_reverse_iteratorsucc_rend() const
432{return Successors.rend(); }
433unsignedsucc_size() const{
434return (unsigned)Successors.size();
435 }
436boolsucc_empty() const{return Successors.empty(); }
437
438inlineiterator_range<pred_iterator>predecessors() {
439returnmake_range(pred_begin(),pred_end());
440 }
441inlineiterator_range<const_pred_iterator>predecessors() const{
442returnmake_range(pred_begin(),pred_end());
443 }
444inlineiterator_range<succ_iterator>successors() {
445returnmake_range(succ_begin(),succ_end());
446 }
447inlineiterator_range<const_succ_iterator>successors() const{
448returnmake_range(succ_begin(),succ_end());
449 }
450
451// LiveIn management methods.
452
453 /// Adds the specified register as a live in. Note that it is an error to add
454 /// the same register to the same set more than once unless the intention is
455 /// to call sortUniqueLiveIns after all registers are added.
456voidaddLiveIn(MCRegister PhysReg,
457LaneBitmask LaneMask =LaneBitmask::getAll()) {
458 LiveIns.push_back(RegisterMaskPair(PhysReg, LaneMask));
459 }
460voidaddLiveIn(constRegisterMaskPair &RegMaskPair) {
461 LiveIns.push_back(RegMaskPair);
462 }
463
464 /// Sorts and uniques the LiveIns vector. It can be significantly faster to do
465 /// this than repeatedly calling isLiveIn before calling addLiveIn for every
466 /// LiveIn insertion.
467voidsortUniqueLiveIns();
468
469 /// Clear live in list.
470voidclearLiveIns();
471
472 /// Clear the live in list, and return the removed live in's in \p OldLiveIns.
473 /// Requires that the vector \p OldLiveIns is empty.
474voidclearLiveIns(std::vector<RegisterMaskPair> &OldLiveIns);
475
476 /// Add PhysReg as live in to this block, and ensure that there is a copy of
477 /// PhysReg to a virtual register of class RC. Return the virtual register
478 /// that is a copy of the live in PhysReg.
479RegisteraddLiveIn(MCRegister PhysReg,constTargetRegisterClass *RC);
480
481 /// Remove the specified register from the live in set.
482voidremoveLiveIn(MCRegisterReg,
483LaneBitmask LaneMask =LaneBitmask::getAll());
484
485 /// Return true if the specified register is in the live in set.
486boolisLiveIn(MCRegisterReg,
487LaneBitmask LaneMask =LaneBitmask::getAll())const;
488
489// Iteration support for live in sets. These sets are kept in sorted
490// order by their register number.
491usinglivein_iterator = LiveInVector::const_iterator;
492
493 /// Unlike livein_begin, this method does not check that the liveness
494 /// information is accurate. Still for debug purposes it may be useful
495 /// to have iterators that won't assert if the liveness information
496 /// is not current.
497livein_iteratorlivein_begin_dbg() const{return LiveIns.begin(); }
498iterator_range<livein_iterator>liveins_dbg() const{
499returnmake_range(livein_begin_dbg(),livein_end());
500 }
501
502livein_iteratorlivein_begin()const;
503livein_iteratorlivein_end() const{return LiveIns.end(); }
504boollivein_empty() const{return LiveIns.empty(); }
505iterator_range<livein_iterator>liveins() const{
506returnmake_range(livein_begin(),livein_end());
507 }
508
509 /// Remove entry from the livein set and return iterator to the next.
510livein_iteratorremoveLiveIn(livein_iteratorI);
511
512const std::vector<RegisterMaskPair> &getLiveIns() const{return LiveIns; }
513
514classliveout_iterator {
515public:
516usingiterator_category = std::input_iterator_tag;
517usingdifference_type = std::ptrdiff_t;
518usingvalue_type =RegisterMaskPair;
519usingpointer =constRegisterMaskPair *;
520usingreference =constRegisterMaskPair &;
521
522liveout_iterator(constMachineBasicBlock &MBB,MCPhysReg ExceptionPointer,
523MCPhysReg ExceptionSelector,boolEnd)
524 : ExceptionPointer(ExceptionPointer),
525 ExceptionSelector(ExceptionSelector), BlockI(MBB.succ_begin()),
526 BlockEnd(MBB.succ_end()) {
527if (End)
528 BlockI = BlockEnd;
529elseif (BlockI != BlockEnd) {
530 LiveRegI = (*BlockI)->livein_begin();
531if (!advanceToValidPosition())
532return;
533if (LiveRegI->PhysReg == ExceptionPointer ||
534 LiveRegI->PhysReg == ExceptionSelector)
535 ++(*this);
536 }
537 }
538
539liveout_iterator &operator++() {
540do {
541 ++LiveRegI;
542if (!advanceToValidPosition())
543return *this;
544 }while ((*BlockI)->isEHPad() &&
545 (LiveRegI->PhysReg == ExceptionPointer ||
546 LiveRegI->PhysReg == ExceptionSelector));
547return *this;
548 }
549
550liveout_iteratoroperator++(int) {
551liveout_iterator Tmp = *this;
552 ++(*this);
553return Tmp;
554 }
555
556referenceoperator*() const{
557return *LiveRegI;
558 }
559
560pointeroperator->() const{
561return &*LiveRegI;
562 }
563
564booloperator==(constliveout_iterator &RHS) const{
565if (BlockI != BlockEnd)
566return BlockI ==RHS.BlockI && LiveRegI ==RHS.LiveRegI;
567returnRHS.BlockI == BlockEnd;
568 }
569
570booloperator!=(constliveout_iterator &RHS) const{
571return !(*this ==RHS);
572 }
573private:
574bool advanceToValidPosition() {
575if (LiveRegI != (*BlockI)->livein_end())
576returntrue;
577
578do {
579 ++BlockI;
580 }while (BlockI != BlockEnd && (*BlockI)->livein_empty());
581if (BlockI == BlockEnd)
582returnfalse;
583
584 LiveRegI = (*BlockI)->livein_begin();
585returntrue;
586 }
587
588MCPhysReg ExceptionPointer, ExceptionSelector;
589const_succ_iterator BlockI;
590const_succ_iterator BlockEnd;
591livein_iterator LiveRegI;
592 };
593
594 /// Iterator scanning successor basic blocks' liveins to determine the
595 /// registers potentially live at the end of this block. There may be
596 /// duplicates or overlapping registers in the list returned.
597 liveout_iteratorliveout_begin()const;
598liveout_iteratorliveout_end() const{
599returnliveout_iterator(*this, 0, 0,true);
600 }
601iterator_range<liveout_iterator>liveouts() const{
602returnmake_range(liveout_begin(),liveout_end());
603 }
604
605 /// Get the clobber mask for the start of this basic block. Funclets use this
606 /// to prevent register allocation across funclet transitions.
607constuint32_t *getBeginClobberMask(constTargetRegisterInfo *TRI)const;
608
609 /// Get the clobber mask for the end of the basic block.
610 /// \see getBeginClobberMask()
611constuint32_t *getEndClobberMask(constTargetRegisterInfo *TRI)const;
612
613 /// Return alignment of the basic block.
614AligngetAlignment() const{return Alignment; }
615
616 /// Set alignment of the basic block.
617voidsetAlignment(AlignA) { Alignment =A; }
618
619voidsetAlignment(AlignA,unsigned MaxBytes) {
620setAlignment(A);
621setMaxBytesForAlignment(MaxBytes);
622 }
623
624 /// Return the maximum amount of padding allowed for aligning the basic block.
625unsignedgetMaxBytesForAlignment() const{return MaxBytesForAlignment; }
626
627 /// Set the maximum amount of padding allowed for aligning the basic block
628voidsetMaxBytesForAlignment(unsigned MaxBytes) {
629 MaxBytesForAlignment = MaxBytes;
630 }
631
632 /// Returns true if the block is a landing pad. That is this basic block is
633 /// entered via an exception handler.
634boolisEHPad() const{return IsEHPad; }
635
636 /// Indicates the block is a landing pad. That is this basic block is entered
637 /// via an exception handler.
638voidsetIsEHPad(bool V =true) { IsEHPad = V; }
639
640boolhasEHPadSuccessor()const;
641
642 /// Returns true if this is the entry block of the function.
643boolisEntryBlock()const;
644
645 /// Returns true if this is the entry block of an EH scope, i.e., the block
646 /// that used to have a catchpad or cleanuppad instruction in the LLVM IR.
647boolisEHScopeEntry() const{return IsEHScopeEntry; }
648
649 /// Indicates if this is the entry block of an EH scope, i.e., the block that
650 /// that used to have a catchpad or cleanuppad instruction in the LLVM IR.
651voidsetIsEHScopeEntry(bool V =true) { IsEHScopeEntry = V; }
652
653 /// Returns true if this is a target block of a catchret.
654boolisEHCatchretTarget() const{return IsEHCatchretTarget; }
655
656 /// Indicates if this is a target block of a catchret.
657voidsetIsEHCatchretTarget(bool V =true) { IsEHCatchretTarget = V; }
658
659 /// Returns true if this is the entry block of an EH funclet.
660boolisEHFuncletEntry() const{return IsEHFuncletEntry; }
661
662 /// Indicates if this is the entry block of an EH funclet.
663voidsetIsEHFuncletEntry(bool V =true) { IsEHFuncletEntry = V; }
664
665 /// Returns true if this is the entry block of a cleanup funclet.
666boolisCleanupFuncletEntry() const{return IsCleanupFuncletEntry; }
667
668 /// Indicates if this is the entry block of a cleanup funclet.
669voidsetIsCleanupFuncletEntry(bool V =true) { IsCleanupFuncletEntry = V; }
670
671 /// Returns true if this block begins any section.
672boolisBeginSection() const{return IsBeginSection; }
673
674 /// Returns true if this block ends any section.
675boolisEndSection() const{return IsEndSection; }
676
677voidsetIsBeginSection(bool V =true) { IsBeginSection = V; }
678
679voidsetIsEndSection(bool V =true) { IsEndSection = V; }
680
681 std::optional<UniqueBBID>getBBID() const{return BBID; }
682
683 /// Returns the section ID of this basic block.
684MBBSectionIDgetSectionID() const{return SectionID; }
685
686 /// Sets the fixed BBID of this basic block.
687voidsetBBID(constUniqueBBID &V) {
688assert(!BBID.has_value() &&"Cannot change BBID.");
689 BBID = V;
690 }
691
692 /// Sets the section ID for this basic block.
693voidsetSectionID(MBBSectionID V) { SectionID = V; }
694
695 /// Returns the MCSymbol marking the end of this basic block.
696MCSymbol *getEndSymbol()const;
697
698 /// Returns true if this block may have an INLINEASM_BR (overestimate, by
699 /// checking if any of the successors are indirect targets of any inlineasm_br
700 /// in the function).
701boolmayHaveInlineAsmBr()const;
702
703 /// Returns true if this is the indirect dest of an INLINEASM_BR.
704boolisInlineAsmBrIndirectTarget() const{
705return IsInlineAsmBrIndirectTarget;
706 }
707
708 /// Indicates if this is the indirect dest of an INLINEASM_BR.
709voidsetIsInlineAsmBrIndirectTarget(bool V =true) {
710 IsInlineAsmBrIndirectTarget = V;
711 }
712
713 /// Returns true if it is legal to hoist instructions into this block.
714boolisLegalToHoistInto()const;
715
716// Code Layout methods.
717
718 /// Move 'this' block before or after the specified block. This only moves
719 /// the block, it does not modify the CFG or adjust potential fall-throughs at
720 /// the end of the block.
721voidmoveBefore(MachineBasicBlock *NewAfter);
722voidmoveAfter(MachineBasicBlock *NewBefore);
723
724 /// Returns true if this and MBB belong to the same section.
725boolsameSection(constMachineBasicBlock *MBB) const{
726returngetSectionID() ==MBB->getSectionID();
727 }
728
729 /// Update the terminator instructions in block to account for changes to
730 /// block layout which may have been made. PreviousLayoutSuccessor should be
731 /// set to the block which may have been used as fallthrough before the block
732 /// layout was modified. If the block previously fell through to that block,
733 /// it may now need a branch. If it previously branched to another block, it
734 /// may now be able to fallthrough to the current layout successor.
735voidupdateTerminator(MachineBasicBlock *PreviousLayoutSuccessor);
736
737// Machine-CFG mutators
738
739 /// Add Succ as a successor of this MachineBasicBlock. The Predecessors list
740 /// of Succ is automatically updated. PROB parameter is stored in
741 /// Probabilities list. The default probability is set as unknown. Mixing
742 /// known and unknown probabilities in successor list is not allowed. When all
743 /// successors have unknown probabilities, 1 / N is returned as the
744 /// probability for each successor, where N is the number of successors.
745 ///
746 /// Note that duplicate Machine CFG edges are not allowed.
747voidaddSuccessor(MachineBasicBlock *Succ,
748BranchProbability Prob =BranchProbability::getUnknown());
749
750 /// Add Succ as a successor of this MachineBasicBlock. The Predecessors list
751 /// of Succ is automatically updated. The probability is not provided because
752 /// BPI is not available (e.g. -O0 is used), in which case edge probabilities
753 /// won't be used. Using this interface can save some space.
754voidaddSuccessorWithoutProb(MachineBasicBlock *Succ);
755
756 /// Set successor probability of a given iterator.
757voidsetSuccProbability(succ_iteratorI,BranchProbability Prob);
758
759 /// Normalize probabilities of all successors so that the sum of them becomes
760 /// one. This is usually done when the current update on this MBB is done, and
761 /// the sum of its successors' probabilities is not guaranteed to be one. The
762 /// user is responsible for the correct use of this function.
763 /// MBB::removeSuccessor() has an option to do this automatically.
764voidnormalizeSuccProbs() {
765BranchProbability::normalizeProbabilities(Probs.begin(), Probs.end());
766 }
767
768 /// Validate successors' probabilities and check if the sum of them is
769 /// approximate one. This only works in DEBUG mode.
770voidvalidateSuccProbs()const;
771
772 /// Remove successor from the successors list of this MachineBasicBlock. The
773 /// Predecessors list of Succ is automatically updated.
774 /// If NormalizeSuccProbs is true, then normalize successors' probabilities
775 /// after the successor is removed.
776voidremoveSuccessor(MachineBasicBlock *Succ,
777bool NormalizeSuccProbs =false);
778
779 /// Remove specified successor from the successors list of this
780 /// MachineBasicBlock. The Predecessors list of Succ is automatically updated.
781 /// If NormalizeSuccProbs is true, then normalize successors' probabilities
782 /// after the successor is removed.
783 /// Return the iterator to the element after the one removed.
784succ_iteratorremoveSuccessor(succ_iteratorI,
785bool NormalizeSuccProbs =false);
786
787 /// Replace successor OLD with NEW and update probability info.
788voidreplaceSuccessor(MachineBasicBlock *Old,MachineBasicBlock *New);
789
790 /// Copy a successor (and any probability info) from original block to this
791 /// block's. Uses an iterator into the original blocks successors.
792 ///
793 /// This is useful when doing a partial clone of successors. Afterward, the
794 /// probabilities may need to be normalized.
795voidcopySuccessor(constMachineBasicBlock *Orig,succ_iteratorI);
796
797 /// Split the old successor into old plus new and updates the probability
798 /// info.
799voidsplitSuccessor(MachineBasicBlock *Old,MachineBasicBlock *New,
800bool NormalizeSuccProbs =false);
801
802 /// Transfers all the successors from MBB to this machine basic block (i.e.,
803 /// copies all the successors FromMBB and remove all the successors from
804 /// FromMBB).
805voidtransferSuccessors(MachineBasicBlock *FromMBB);
806
807 /// Transfers all the successors, as in transferSuccessors, and update PHI
808 /// operands in the successor blocks which refer to FromMBB to refer to this.
809voidtransferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB);
810
811 /// Return true if any of the successors have probabilities attached to them.
812boolhasSuccessorProbabilities() const{return !Probs.empty(); }
813
814 /// Return true if the specified MBB is a predecessor of this block.
815boolisPredecessor(constMachineBasicBlock *MBB)const;
816
817 /// Return true if the specified MBB is a successor of this block.
818boolisSuccessor(constMachineBasicBlock *MBB)const;
819
820 /// Return true if the specified MBB will be emitted immediately after this
821 /// block, such that if this block exits by falling through, control will
822 /// transfer to the specified MBB. Note that MBB need not be a successor at
823 /// all, for example if this block ends with an unconditional branch to some
824 /// other block.
825boolisLayoutSuccessor(constMachineBasicBlock *MBB)const;
826
827 /// Return the successor of this block if it has a single successor.
828 /// Otherwise return a null pointer.
829 ///
830constMachineBasicBlock *getSingleSuccessor()const;
831MachineBasicBlock *getSingleSuccessor() {
832returnconst_cast<MachineBasicBlock *>(
833static_cast<constMachineBasicBlock *>(this)->getSingleSuccessor());
834 }
835
836 /// Return the predecessor of this block if it has a single predecessor.
837 /// Otherwise return a null pointer.
838 ///
839constMachineBasicBlock *getSinglePredecessor()const;
840MachineBasicBlock *getSinglePredecessor() {
841returnconst_cast<MachineBasicBlock *>(
842static_cast<constMachineBasicBlock *>(this)->getSinglePredecessor());
843 }
844
845 /// Return the fallthrough block if the block can implicitly
846 /// transfer control to the block after it by falling off the end of
847 /// it. If an explicit branch to the fallthrough block is not allowed,
848 /// set JumpToFallThrough to be false. Non-null return is a conservative
849 /// answer.
850MachineBasicBlock *getFallThrough(bool JumpToFallThrough =true);
851
852 /// Return the fallthrough block if the block can implicitly
853 /// transfer control to it's successor, whether by a branch or
854 /// a fallthrough. Non-null return is a conservative answer.
855MachineBasicBlock *getLogicalFallThrough() {returngetFallThrough(false); }
856
857 /// Return true if the block can implicitly transfer control to the
858 /// block after it by falling off the end of it. This should return
859 /// false if it can reach the block after it, but it uses an
860 /// explicit branch to do so (e.g., a table jump). True is a
861 /// conservative answer.
862boolcanFallThrough();
863
864 /// Returns a pointer to the first instruction in this block that is not a
865 /// PHINode instruction. When adding instructions to the beginning of the
866 /// basic block, they should be added before the returned value, not before
867 /// the first instruction, which might be PHI.
868 /// Returns end() is there's no non-PHI instruction.
869iteratorgetFirstNonPHI();
870const_iteratorgetFirstNonPHI() const{
871returnconst_cast<MachineBasicBlock *>(this)->getFirstNonPHI();
872 }
873
874 /// Return the first instruction in MBB after I that is not a PHI or a label.
875 /// This is the correct point to insert lowered copies at the beginning of a
876 /// basic block that must be before any debugging information.
877iteratorSkipPHIsAndLabels(iteratorI);
878
879 /// Return the first instruction in MBB after I that is not a PHI, label or
880 /// debug. This is the correct point to insert copies at the beginning of a
881 /// basic block. \p Reg is the register being used by a spill or defined for a
882 /// restore/split during register allocation.
883iteratorSkipPHIsLabelsAndDebug(iteratorI,RegisterReg =Register(),
884bool SkipPseudoOp =true);
885
886 /// Returns an iterator to the first terminator instruction of this basic
887 /// block. If a terminator does not exist, it returns end().
888iteratorgetFirstTerminator();
889const_iteratorgetFirstTerminator() const{
890returnconst_cast<MachineBasicBlock *>(this)->getFirstTerminator();
891 }
892
893 /// Same getFirstTerminator but it ignores bundles and return an
894 /// instr_iterator instead.
895instr_iteratorgetFirstInstrTerminator();
896
897 /// Finds the first terminator in a block by scanning forward. This can handle
898 /// cases in GlobalISel where there may be non-terminator instructions between
899 /// terminators, for which getFirstTerminator() will not work correctly.
900iteratorgetFirstTerminatorForward();
901
902 /// Returns an iterator to the first non-debug instruction in the basic block,
903 /// or end(). Skip any pseudo probe operation if \c SkipPseudoOp is true.
904 /// Pseudo probes are like debug instructions which do not turn into real
905 /// machine code. We try to use the function to skip both debug instructions
906 /// and pseudo probe operations to avoid API proliferation. This should work
907 /// most of the time when considering optimizing the rest of code in the
908 /// block, except for certain cases where pseudo probes are designed to block
909 /// the optimizations. For example, code merge like optimizations are supposed
910 /// to be blocked by pseudo probes for better AutoFDO profile quality.
911 /// Therefore, they should be considered as a valid instruction when this
912 /// function is called in a context of such optimizations. On the other hand,
913 /// \c SkipPseudoOp should be true when it's used in optimizations that
914 /// unlikely hurt profile quality, e.g., without block merging. The default
915 /// value of \c SkipPseudoOp is set to true to maximize code quality in
916 /// general, with an explict false value passed in in a few places like branch
917 /// folding and if-conversion to favor profile quality.
918iteratorgetFirstNonDebugInstr(bool SkipPseudoOp =true);
919const_iteratorgetFirstNonDebugInstr(bool SkipPseudoOp =true) const{
920returnconst_cast<MachineBasicBlock *>(this)->getFirstNonDebugInstr(
921 SkipPseudoOp);
922 }
923
924 /// Returns an iterator to the last non-debug instruction in the basic block,
925 /// or end(). Skip any pseudo operation if \c SkipPseudoOp is true.
926 /// Pseudo probes are like debug instructions which do not turn into real
927 /// machine code. We try to use the function to skip both debug instructions
928 /// and pseudo probe operations to avoid API proliferation. This should work
929 /// most of the time when considering optimizing the rest of code in the
930 /// block, except for certain cases where pseudo probes are designed to block
931 /// the optimizations. For example, code merge like optimizations are supposed
932 /// to be blocked by pseudo probes for better AutoFDO profile quality.
933 /// Therefore, they should be considered as a valid instruction when this
934 /// function is called in a context of such optimizations. On the other hand,
935 /// \c SkipPseudoOp should be true when it's used in optimizations that
936 /// unlikely hurt profile quality, e.g., without block merging. The default
937 /// value of \c SkipPseudoOp is set to true to maximize code quality in
938 /// general, with an explict false value passed in in a few places like branch
939 /// folding and if-conversion to favor profile quality.
940iteratorgetLastNonDebugInstr(bool SkipPseudoOp =true);
941const_iteratorgetLastNonDebugInstr(bool SkipPseudoOp =true) const{
942returnconst_cast<MachineBasicBlock *>(this)->getLastNonDebugInstr(
943 SkipPseudoOp);
944 }
945
946 /// Convenience function that returns true if the block ends in a return
947 /// instruction.
948boolisReturnBlock() const{
949return !empty() &&back().isReturn();
950 }
951
952 /// Convenience function that returns true if the bock ends in a EH scope
953 /// return instruction.
954boolisEHScopeReturnBlock() const{
955return !empty() &&back().isEHScopeReturn();
956 }
957
958 /// Split a basic block into 2 pieces at \p SplitPoint. A new block will be
959 /// inserted after this block, and all instructions after \p SplitInst moved
960 /// to it (\p SplitInst will be in the original block). If \p LIS is provided,
961 /// LiveIntervals will be appropriately updated. \return the newly inserted
962 /// block.
963 ///
964 /// If \p UpdateLiveIns is true, this will ensure the live ins list is
965 /// accurate, including for physreg uses/defs in the original block.
966MachineBasicBlock *splitAt(MachineInstr &SplitInst,bool UpdateLiveIns =true,
967LiveIntervals *LIS =nullptr);
968
969 /// Split the critical edge from this block to the given successor block, and
970 /// return the newly created block, or null if splitting is not possible.
971 ///
972 /// This function updates LiveVariables, MachineDominatorTree, and
973 /// MachineLoopInfo, as applicable.
974MachineBasicBlock *
975SplitCriticalEdge(MachineBasicBlock *Succ,Pass &P,
976 std::vector<SparseBitVector<>> *LiveInSets =nullptr,
977MachineDomTreeUpdater *MDTU =nullptr) {
978returnSplitCriticalEdge(Succ, &P,nullptr, LiveInSets, MDTU);
979 }
980
981MachineBasicBlock *
982SplitCriticalEdge(MachineBasicBlock *Succ,
983MachineFunctionAnalysisManager &MFAM,
984 std::vector<SparseBitVector<>> *LiveInSets =nullptr,
985MachineDomTreeUpdater *MDTU =nullptr) {
986returnSplitCriticalEdge(Succ,nullptr, &MFAM, LiveInSets, MDTU);
987 }
988
989// Helper method for new pass manager migration.
990MachineBasicBlock *SplitCriticalEdge(
991MachineBasicBlock *Succ,Pass *P,MachineFunctionAnalysisManager *MFAM,
992 std::vector<SparseBitVector<>> *LiveInSets,MachineDomTreeUpdater *MDTU);
993
994 /// Check if the edge between this block and the given successor \p
995 /// Succ, can be split. If this returns true a subsequent call to
996 /// SplitCriticalEdge is guaranteed to return a valid basic block if
997 /// no changes occurred in the meantime.
998boolcanSplitCriticalEdge(constMachineBasicBlock *Succ)const;
999
1000voidpop_front() { Insts.pop_front(); }
1001voidpop_back() { Insts.pop_back(); }
1002voidpush_back(MachineInstr *MI) { Insts.push_back(MI); }
1003
1004 /// Insert MI into the instruction list before I, possibly inside a bundle.
1005 ///
1006 /// If the insertion point is inside a bundle, MI will be added to the bundle,
1007 /// otherwise MI will not be added to any bundle. That means this function
1008 /// alone can't be used to prepend or append instructions to bundles. See
1009 /// MIBundleBuilder::insert() for a more reliable way of doing that.
1010instr_iteratorinsert(instr_iteratorI,MachineInstr *M);
1011
1012 /// Insert a range of instructions into the instruction list before I.
1013template<typename IT>
1014voidinsert(iteratorI,IT S,ITE) {
1015assert((I ==end() ||I->getParent() ==this) &&
1016"iterator points outside of basic block");
1017 Insts.insert(I.getInstrIterator(), S,E);
1018 }
1019
1020 /// Insert MI into the instruction list before I.
1021iteratorinsert(iteratorI,MachineInstr *MI) {
1022assert((I ==end() ||I->getParent() ==this) &&
1023"iterator points outside of basic block");
1024assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
1025"Cannot insert instruction with bundle flags");
1026return Insts.insert(I.getInstrIterator(),MI);
1027 }
1028
1029 /// Insert MI into the instruction list after I.
1030iteratorinsertAfter(iteratorI,MachineInstr *MI) {
1031assert((I ==end() ||I->getParent() ==this) &&
1032"iterator points outside of basic block");
1033assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
1034"Cannot insert instruction with bundle flags");
1035return Insts.insertAfter(I.getInstrIterator(),MI);
1036 }
1037
1038 /// If I is bundled then insert MI into the instruction list after the end of
1039 /// the bundle, otherwise insert MI immediately after I.
1040instr_iteratorinsertAfterBundle(instr_iteratorI,MachineInstr *MI) {
1041assert((I ==instr_end() ||I->getParent() ==this) &&
1042"iterator points outside of basic block");
1043assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
1044"Cannot insert instruction with bundle flags");
1045while (I->isBundledWithSucc())
1046 ++I;
1047return Insts.insertAfter(I,MI);
1048 }
1049
1050 /// Remove an instruction from the instruction list and delete it.
1051 ///
1052 /// If the instruction is part of a bundle, the other instructions in the
1053 /// bundle will still be bundled after removing the single instruction.
1054instr_iteratorerase(instr_iteratorI);
1055
1056 /// Remove an instruction from the instruction list and delete it.
1057 ///
1058 /// If the instruction is part of a bundle, the other instructions in the
1059 /// bundle will still be bundled after removing the single instruction.
1060instr_iteratorerase_instr(MachineInstr *I) {
1061returnerase(instr_iterator(I));
1062 }
1063
1064 /// Remove a range of instructions from the instruction list and delete them.
1065iteratorerase(iteratorI,iteratorE) {
1066return Insts.erase(I.getInstrIterator(),E.getInstrIterator());
1067 }
1068
1069 /// Remove an instruction or bundle from the instruction list and delete it.
1070 ///
1071 /// If I points to a bundle of instructions, they are all erased.
1072iteratorerase(iteratorI) {
1073returnerase(I, std::next(I));
1074 }
1075
1076 /// Remove an instruction from the instruction list and delete it.
1077 ///
1078 /// If I is the head of a bundle of instructions, the whole bundle will be
1079 /// erased.
1080iteratorerase(MachineInstr *I) {
1081returnerase(iterator(I));
1082 }
1083
1084 /// Remove the unbundled instruction from the instruction list without
1085 /// deleting it.
1086 ///
1087 /// This function can not be used to remove bundled instructions, use
1088 /// remove_instr to remove individual instructions from a bundle.
1089MachineInstr *remove(MachineInstr *I) {
1090assert(!I->isBundled() &&"Cannot remove bundled instructions");
1091return Insts.remove(instr_iterator(I));
1092 }
1093
1094 /// Remove the possibly bundled instruction from the instruction list
1095 /// without deleting it.
1096 ///
1097 /// If the instruction is part of a bundle, the other instructions in the
1098 /// bundle will still be bundled after removing the single instruction.
1099MachineInstr *remove_instr(MachineInstr *I);
1100
1101voidclear() {
1102 Insts.clear();
1103 }
1104
1105 /// Take an instruction from MBB 'Other' at the position From, and insert it
1106 /// into this MBB right before 'Where'.
1107 ///
1108 /// If From points to a bundle of instructions, the whole bundle is moved.
1109voidsplice(iterator Where,MachineBasicBlock *Other,iteratorFrom) {
1110// The range splice() doesn't allow noop moves, but this one does.
1111if (Where !=From)
1112splice(Where,Other,From, std::next(From));
1113 }
1114
1115 /// Take a block of instructions from MBB 'Other' in the range [From, To),
1116 /// and insert them into this MBB right before 'Where'.
1117 ///
1118 /// The instruction at 'Where' must not be included in the range of
1119 /// instructions to move.
1120voidsplice(iterator Where,MachineBasicBlock *Other,
1121iteratorFrom,iterator To) {
1122 Insts.splice(Where.getInstrIterator(),Other->Insts,
1123From.getInstrIterator(), To.getInstrIterator());
1124 }
1125
1126 /// This method unlinks 'this' from the containing function, and returns it,
1127 /// but does not delete it.
1128MachineBasicBlock *removeFromParent();
1129
1130 /// This method unlinks 'this' from the containing function and deletes it.
1131voideraseFromParent();
1132
1133 /// Given a machine basic block that branched to 'Old', change the code and
1134 /// CFG so that it branches to 'New' instead.
1135voidReplaceUsesOfBlockWith(MachineBasicBlock *Old,MachineBasicBlock *New);
1136
1137 /// Update all phi nodes in this basic block to refer to basic block \p New
1138 /// instead of basic block \p Old.
1139voidreplacePhiUsesWith(MachineBasicBlock *Old,MachineBasicBlock *New);
1140
1141 /// Find the next valid DebugLoc starting at MBBI, skipping any debug
1142 /// instructions. Return UnknownLoc if there is none.
1143DebugLocfindDebugLoc(instr_iteratorMBBI);
1144DebugLocfindDebugLoc(iteratorMBBI) {
1145returnfindDebugLoc(MBBI.getInstrIterator());
1146 }
1147
1148 /// Has exact same behavior as @ref findDebugLoc (it also searches towards the
1149 /// end of this MBB) except that this function takes a reverse iterator to
1150 /// identify the starting MI.
1151DebugLocrfindDebugLoc(reverse_instr_iteratorMBBI);
1152DebugLocrfindDebugLoc(reverse_iteratorMBBI) {
1153returnrfindDebugLoc(MBBI.getInstrIterator());
1154 }
1155
1156 /// Find the previous valid DebugLoc preceding MBBI, skipping any debug
1157 /// instructions. It is possible to find the last DebugLoc in the MBB using
1158 /// findPrevDebugLoc(instr_end()). Return UnknownLoc if there is none.
1159DebugLocfindPrevDebugLoc(instr_iteratorMBBI);
1160DebugLocfindPrevDebugLoc(iteratorMBBI) {
1161returnfindPrevDebugLoc(MBBI.getInstrIterator());
1162 }
1163
1164 /// Has exact same behavior as @ref findPrevDebugLoc (it also searches towards
1165 /// the beginning of this MBB) except that this function takes reverse
1166 /// iterator to identify the starting MI. A minor difference compared to
1167 /// findPrevDebugLoc is that we can't start scanning at "instr_end".
1168DebugLocrfindPrevDebugLoc(reverse_instr_iteratorMBBI);
1169DebugLocrfindPrevDebugLoc(reverse_iteratorMBBI) {
1170returnrfindPrevDebugLoc(MBBI.getInstrIterator());
1171 }
1172
1173 /// Find and return the merged DebugLoc of the branch instructions of the
1174 /// block. Return UnknownLoc if there is none.
1175DebugLocfindBranchDebugLoc();
1176
1177 /// Possible outcome of a register liveness query to computeRegisterLiveness()
1178enumLivenessQueryResult {
1179LQR_Live,///< Register is known to be (at least partially) live.
1180LQR_Dead,///< Register is known to be fully dead.
1181LQR_Unknown///< Register liveness not decidable from local neighborhood.
1182 };
1183
1184 /// Return whether (physical) register \p Reg has been defined and not
1185 /// killed as of just before \p Before.
1186 ///
1187 /// Search is localised to a neighborhood of \p Neighborhood instructions
1188 /// before (searching for defs or kills) and \p Neighborhood instructions
1189 /// after (searching just for defs) \p Before.
1190 ///
1191 /// \p Reg must be a physical register.
1192LivenessQueryResultcomputeRegisterLiveness(constTargetRegisterInfo *TRI,
1193MCRegisterReg,
1194const_iteratorBefore,
1195unsigned Neighborhood = 10)const;
1196
1197// Debugging methods.
1198voiddump()const;
1199voidprint(raw_ostream &OS,constSlotIndexes * =nullptr,
1200bool IsStandalone =true)const;
1201voidprint(raw_ostream &OS,ModuleSlotTracker &MST,
1202constSlotIndexes * =nullptr,bool IsStandalone =true)const;
1203
1204enumPrintNameFlag {
1205PrintNameIr = (1 << 0),///< Add IR name where available
1206PrintNameAttributes = (1 << 1),///< Print attributes
1207 };
1208
1209voidprintName(raw_ostream &os,unsigned printNameFlags =PrintNameIr,
1210ModuleSlotTracker *moduleSlotTracker =nullptr)const;
1211
1212// Printing method used by LoopInfo.
1213voidprintAsOperand(raw_ostream &OS,bool PrintType =true)const;
1214
1215 /// MachineBasicBlocks are uniquely numbered at the function level, unless
1216 /// they're not in a MachineFunction yet, in which case this will return -1.
1217intgetNumber() const{returnNumber; }
1218voidsetNumber(intN) {Number =N; }
1219
1220 /// Return the call frame size on entry to this basic block.
1221unsignedgetCallFrameSize() const{return CallFrameSize; }
1222 /// Set the call frame size on entry to this basic block.
1223voidsetCallFrameSize(unsignedN) { CallFrameSize =N; }
1224
1225 /// Return the MCSymbol for this basic block.
1226MCSymbol *getSymbol()const;
1227
1228 /// Return the EHCatchret Symbol for this basic block.
1229MCSymbol *getEHCatchretSymbol()const;
1230
1231 std::optional<uint64_t>getIrrLoopHeaderWeight() const{
1232return IrrLoopHeaderWeight;
1233 }
1234
1235voidsetIrrLoopHeaderWeight(uint64_t Weight) {
1236 IrrLoopHeaderWeight = Weight;
1237 }
1238
1239 /// Return probability of the edge from this block to MBB. This method should
1240 /// NOT be called directly, but by using getEdgeProbability method from
1241 /// MachineBranchProbabilityInfo class.
1242BranchProbabilitygetSuccProbability(const_succ_iterator Succ)const;
1243
1244private:
1245 /// Return probability iterator corresponding to the I successor iterator.
1246 probability_iterator getProbabilityIterator(succ_iteratorI);
1247 const_probability_iterator
1248 getProbabilityIterator(const_succ_iteratorI)const;
1249
1250friendclassMachineBranchProbabilityInfo;
1251friendclassMIPrinter;
1252
1253// Methods used to maintain doubly linked list of blocks...
1254friendstructilist_callback_traits<MachineBasicBlock>;
1255
1256// Machine-CFG mutators
1257
1258 /// Add Pred as a predecessor of this MachineBasicBlock. Don't do this
1259 /// unless you know what you're doing, because it doesn't update Pred's
1260 /// successors list. Use Pred->addSuccessor instead.
1261void addPredecessor(MachineBasicBlock *Pred);
1262
1263 /// Remove Pred as a predecessor of this MachineBasicBlock. Don't do this
1264 /// unless you know what you're doing, because it doesn't update Pred's
1265 /// successors list. Use Pred->removeSuccessor instead.
1266void removePredecessor(MachineBasicBlock *Pred);
1267};
1268
1269raw_ostream&operator<<(raw_ostream &OS,constMachineBasicBlock &MBB);
1270
1271/// Prints a machine basic block reference.
1272///
1273/// The format is:
1274/// %bb.5 - a machine basic block with MBB.getNumber() == 5.
1275///
1276/// Usage: OS << printMBBReference(MBB) << '\n';
1277PrintableprintMBBReference(constMachineBasicBlock &MBB);
1278
1279// This is useful when building IndexedMaps keyed on basic block pointers.
1280structMBB2NumberFunctor {
1281usingargument_type =constMachineBasicBlock *;
1282unsignedoperator()(constMachineBasicBlock *MBB) const{
1283returnMBB->getNumber();
1284 }
1285};
1286
1287//===--------------------------------------------------------------------===//
1288// GraphTraits specializations for machine basic block graphs (machine-CFGs)
1289//===--------------------------------------------------------------------===//
1290
1291// Provide specializations of GraphTraits to be able to treat a
1292// MachineFunction as a graph of MachineBasicBlocks.
1293//
1294
1295template <>structGraphTraits<MachineBasicBlock *> {
1296usingNodeRef =MachineBasicBlock *;
1297usingChildIteratorType =MachineBasicBlock::succ_iterator;
1298
1299staticNodeRefgetEntryNode(MachineBasicBlock *BB) {return BB; }
1300staticChildIteratorTypechild_begin(NodeRefN) {returnN->succ_begin(); }
1301staticChildIteratorTypechild_end(NodeRefN) {returnN->succ_end(); }
1302
1303staticunsignedgetNumber(MachineBasicBlock *BB) {
1304assert(BB->getNumber() >= 0 &&"negative block number");
1305return BB->getNumber();
1306 }
1307};
1308
1309static_assert(GraphHasNodeNumbers<MachineBasicBlock *>,
1310"GraphTraits getNumber() not detected");
1311
1312template <>structGraphTraits<constMachineBasicBlock *> {
1313usingNodeRef =constMachineBasicBlock *;
1314usingChildIteratorType =MachineBasicBlock::const_succ_iterator;
1315
1316staticNodeRefgetEntryNode(constMachineBasicBlock *BB) {return BB; }
1317staticChildIteratorTypechild_begin(NodeRefN) {returnN->succ_begin(); }
1318staticChildIteratorTypechild_end(NodeRefN) {returnN->succ_end(); }
1319
1320staticunsignedgetNumber(constMachineBasicBlock *BB) {
1321assert(BB->getNumber() >= 0 &&"negative block number");
1322return BB->getNumber();
1323 }
1324};
1325
1326static_assert(GraphHasNodeNumbers<const MachineBasicBlock *>,
1327"GraphTraits getNumber() not detected");
1328
1329// Provide specializations of GraphTraits to be able to treat a
1330// MachineFunction as a graph of MachineBasicBlocks and to walk it
1331// in inverse order. Inverse order for a function is considered
1332// to be when traversing the predecessor edges of a MBB
1333// instead of the successor edges.
1334//
1335template <>structGraphTraits<Inverse<MachineBasicBlock*>> {
1336usingNodeRef =MachineBasicBlock *;
1337usingChildIteratorType =MachineBasicBlock::pred_iterator;
1338
1339staticNodeRefgetEntryNode(Inverse<MachineBasicBlock *>G) {
1340returnG.Graph;
1341 }
1342
1343staticChildIteratorTypechild_begin(NodeRefN) {returnN->pred_begin(); }
1344staticChildIteratorTypechild_end(NodeRefN) {returnN->pred_end(); }
1345
1346staticunsignedgetNumber(MachineBasicBlock *BB) {
1347assert(BB->getNumber() >= 0 &&"negative block number");
1348return BB->getNumber();
1349 }
1350};
1351
1352static_assert(GraphHasNodeNumbers<Inverse<MachineBasicBlock *>>,
1353"GraphTraits getNumber() not detected");
1354
1355template <>structGraphTraits<Inverse<constMachineBasicBlock*>> {
1356usingNodeRef =constMachineBasicBlock *;
1357usingChildIteratorType =MachineBasicBlock::const_pred_iterator;
1358
1359staticNodeRefgetEntryNode(Inverse<const MachineBasicBlock *>G) {
1360returnG.Graph;
1361 }
1362
1363staticChildIteratorTypechild_begin(NodeRefN) {returnN->pred_begin(); }
1364staticChildIteratorTypechild_end(NodeRefN) {returnN->pred_end(); }
1365
1366staticunsignedgetNumber(constMachineBasicBlock *BB) {
1367assert(BB->getNumber() >= 0 &&"negative block number");
1368return BB->getNumber();
1369 }
1370};
1371
1372static_assert(GraphHasNodeNumbers<Inverse<const MachineBasicBlock *>>,
1373"GraphTraits getNumber() not detected");
1374
1375// These accessors are handy for sharing templated code between IR and MIR.
1376inlineautosuccessors(constMachineBasicBlock *BB) {return BB->successors(); }
1377inlineautopredecessors(constMachineBasicBlock *BB) {
1378return BB->predecessors();
1379}
1380inlineautosucc_size(constMachineBasicBlock *BB) {return BB->succ_size(); }
1381inlineautopred_size(constMachineBasicBlock *BB) {return BB->pred_size(); }
1382inlineautosucc_begin(constMachineBasicBlock *BB) {return BB->succ_begin(); }
1383inlineautopred_begin(constMachineBasicBlock *BB) {return BB->pred_begin(); }
1384inlineautosucc_end(constMachineBasicBlock *BB) {return BB->succ_end(); }
1385inlineautopred_end(constMachineBasicBlock *BB) {return BB->pred_end(); }
1386
1387/// MachineInstrSpan provides an interface to get an iteration range
1388/// containing the instruction it was initialized with, along with all
1389/// those instructions inserted prior to or following that instruction
1390/// at some point after the MachineInstrSpan is constructed.
1391classMachineInstrSpan {
1392MachineBasicBlock &MBB;
1393MachineBasicBlock::iteratorI, B, E;
1394
1395public:
1396MachineInstrSpan(MachineBasicBlock::iterator I,MachineBasicBlock *BB)
1397 :MBB(*BB),I(I), B(I ==MBB.begin() ?MBB.end() :std::prev(I)),
1398 E(std::next(I)) {
1399assert(I == BB->end() ||I->getParent() == BB);
1400 }
1401
1402MachineBasicBlock::iteratorbegin() {
1403return B ==MBB.end() ?MBB.begin() : std::next(B);
1404 }
1405MachineBasicBlock::iteratorend() {return E; }
1406boolempty() {returnbegin() ==end(); }
1407
1408MachineBasicBlock::iteratorgetInitial() {returnI; }
1409};
1410
1411/// Increment \p It until it points to a non-debug instruction or to \p End
1412/// and return the resulting iterator. This function should only be used
1413/// MachineBasicBlock::{iterator, const_iterator, instr_iterator,
1414/// const_instr_iterator} and the respective reverse iterators.
1415template <typename IterT>
1416inline IterTskipDebugInstructionsForward(IterT It, IterTEnd,
1417bool SkipPseudoOp =true) {
1418while (It !=End &&
1419 (It->isDebugInstr() || (SkipPseudoOp && It->isPseudoProbe())))
1420 ++It;
1421return It;
1422}
1423
1424/// Decrement \p It until it points to a non-debug instruction or to \p Begin
1425/// and return the resulting iterator. This function should only be used
1426/// MachineBasicBlock::{iterator, const_iterator, instr_iterator,
1427/// const_instr_iterator} and the respective reverse iterators.
1428template <class IterT>
1429inline IterTskipDebugInstructionsBackward(IterT It, IterT Begin,
1430bool SkipPseudoOp =true) {
1431while (It != Begin &&
1432 (It->isDebugInstr() || (SkipPseudoOp && It->isPseudoProbe())))
1433 --It;
1434return It;
1435}
1436
1437/// Increment \p It, then continue incrementing it while it points to a debug
1438/// instruction. A replacement for std::next.
1439template <typename IterT>
1440inline IterTnext_nodbg(IterT It, IterTEnd,bool SkipPseudoOp =true) {
1441returnskipDebugInstructionsForward(std::next(It),End, SkipPseudoOp);
1442}
1443
1444/// Decrement \p It, then continue decrementing it while it points to a debug
1445/// instruction. A replacement for std::prev.
1446template <typename IterT>
1447inline IterTprev_nodbg(IterT It, IterT Begin,bool SkipPseudoOp =true) {
1448returnskipDebugInstructionsBackward(std::prev(It), Begin, SkipPseudoOp);
1449}
1450
1451/// Construct a range iterator which begins at \p It and moves forwards until
1452/// \p End is reached, skipping any debug instructions.
1453template <typename IterT>
1454inlineautoinstructionsWithoutDebug(IterT It, IterTEnd,
1455bool SkipPseudoOp =true) {
1456returnmake_filter_range(make_range(It,End), [=](constMachineInstr &MI) {
1457return !MI.isDebugInstr() && !(SkipPseudoOp &&MI.isPseudoProbe());
1458 });
1459}
1460
1461}// end namespace llvm
1462
1463#endif// LLVM_CODEGEN_MACHINEBASICBLOCK_H
Pass
aarch64 AArch64 CCMP Pass
Definition:AArch64ConditionalCompares.cpp:800
const
aarch64 promote const
Definition:AArch64PromoteConstant.cpp:230
MBB
MachineBasicBlock & MBB
Definition:ARMSLSHardening.cpp:71
MBBI
MachineBasicBlock MachineBasicBlock::iterator MBBI
Definition:ARMSLSHardening.cpp:72
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")))
From
BlockVerifier::State From
Definition:BlockVerifier.cpp:57
BranchProbability.h
A
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
DebugLoc.h
DenseMapInfo.h
This file defines DenseMapInfo traits for DenseMap.
End
bool End
Definition:ELF_riscv.cpp:480
GraphTraits.h
This file defines the little GraphTraits<X> template class that should be specialized by classes that...
MI
IRTranslator LLVM IR MI
Definition:IRTranslator.cpp:112
LaneBitmask.h
A common definition of LaneBitmask for use in TableGen and CodeGen.
I
#define I(x, y, z)
Definition:MD5.cpp:58
G
#define G(x, y, z)
Definition:MD5.cpp:56
MachineInstrBundleIterator.h
MachineInstr.h
TRI
unsigned const TargetRegisterInfo * TRI
Definition:MachineSink.cpp:2029
Reg
unsigned Reg
Definition:MachineSink.cpp:2028
P
#define P(N)
Number
uint32_t Number
Definition:Profile.cpp:47
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OS
raw_pwrite_stream & OS
Definition:SampleProfWriter.cpp:51
SparseBitVector.h
This file defines the SparseBitVector class.
IRDumpFileSuffixType::Before
@ Before
RHS
Value * RHS
Definition:X86PartialReduction.cpp:74
LHS
Value * LHS
Definition:X86PartialReduction.cpp:73
const_iterator
T
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition:PassManager.h:253
llvm::BasicBlock
LLVM Basic Block Representation.
Definition:BasicBlock.h:61
llvm::BranchProbability
Definition:BranchProbability.h:30
llvm::BranchProbability::getUnknown
static BranchProbability getUnknown()
Definition:BranchProbability.h:51
llvm::BranchProbability::normalizeProbabilities
static void normalizeProbabilities(ProbabilityIter Begin, ProbabilityIter End)
Definition:BranchProbability.h:205
llvm::DebugLoc
A debug info location.
Definition:DebugLoc.h:33
llvm::LiveIntervals
Definition:LiveIntervals.h:55
llvm::MCRegister
Wrapper class representing physical registers. Should be passed by value.
Definition:MCRegister.h:33
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition:MCSymbol.h:41
llvm::MIPrinter
This class prints out the machine instructions using the MIR serialization format.
Definition:MIRPrinter.cpp:146
llvm::MachineBasicBlock::liveout_iterator
Definition:MachineBasicBlock.h:514
llvm::MachineBasicBlock::liveout_iterator::liveout_iterator
liveout_iterator(const MachineBasicBlock &MBB, MCPhysReg ExceptionPointer, MCPhysReg ExceptionSelector, bool End)
Definition:MachineBasicBlock.h:522
llvm::MachineBasicBlock::liveout_iterator::operator++
liveout_iterator & operator++()
Definition:MachineBasicBlock.h:539
llvm::MachineBasicBlock::liveout_iterator::difference_type
std::ptrdiff_t difference_type
Definition:MachineBasicBlock.h:517
llvm::MachineBasicBlock::liveout_iterator::operator*
reference operator*() const
Definition:MachineBasicBlock.h:556
llvm::MachineBasicBlock::liveout_iterator::iterator_category
std::input_iterator_tag iterator_category
Definition:MachineBasicBlock.h:516
llvm::MachineBasicBlock::liveout_iterator::operator++
liveout_iterator operator++(int)
Definition:MachineBasicBlock.h:550
llvm::MachineBasicBlock::liveout_iterator::operator==
bool operator==(const liveout_iterator &RHS) const
Definition:MachineBasicBlock.h:564
llvm::MachineBasicBlock::liveout_iterator::operator->
pointer operator->() const
Definition:MachineBasicBlock.h:560
llvm::MachineBasicBlock::liveout_iterator::operator!=
bool operator!=(const liveout_iterator &RHS) const
Definition:MachineBasicBlock.h:570
llvm::MachineBasicBlock
Definition:MachineBasicBlock.h:125
llvm::MachineBasicBlock::instr_front
const MachineInstr & instr_front() const
Definition:MachineBasicBlock.h:331
llvm::MachineBasicBlock::isInlineAsmBrIndirectTarget
bool isInlineAsmBrIndirectTarget() const
Returns true if this is the indirect dest of an INLINEASM_BR.
Definition:MachineBasicBlock.h:704
llvm::MachineBasicBlock::rfindPrevDebugLoc
DebugLoc rfindPrevDebugLoc(reverse_instr_iterator MBBI)
Has exact same behavior as findPrevDebugLoc (it also searches towards the beginning of this MBB) exce...
Definition:MachineBasicBlock.cpp:1546
llvm::MachineBasicBlock::const_reverse_instr_iterator
Instructions::const_reverse_iterator const_reverse_instr_iterator
Definition:MachineBasicBlock.h:317
llvm::MachineBasicBlock::pred_end
pred_iterator pred_end()
Definition:MachineBasicBlock.h:407
llvm::MachineBasicBlock::pred_size
unsigned pred_size() const
Definition:MachineBasicBlock.h:417
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:937
llvm::MachineBasicBlock::hasEHPadSuccessor
bool hasEHPadSuccessor() const
Definition:MachineBasicBlock.cpp:289
llvm::MachineBasicBlock::setBBID
void setBBID(const UniqueBBID &V)
Sets the fixed BBID of this basic block.
Definition:MachineBasicBlock.h:687
llvm::MachineBasicBlock::empty
bool empty() const
Definition:MachineBasicBlock.h:327
llvm::MachineBasicBlock::erase
iterator erase(MachineInstr *I)
Remove an instruction from the instruction list and delete it.
Definition:MachineBasicBlock.h:1080
llvm::MachineBasicBlock::normalizeSuccProbs
void normalizeSuccProbs()
Normalize probabilities of all successors so that the sum of them becomes one.
Definition:MachineBasicBlock.h:764
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:301
llvm::MachineBasicBlock::livein_end
livein_iterator livein_end() const
Definition:MachineBasicBlock.h:503
llvm::MachineBasicBlock::getFirstTerminatorForward
iterator getFirstTerminatorForward()
Finds the first terminator in a block by scanning forward.
Definition:MachineBasicBlock.cpp:262
llvm::MachineBasicBlock::pop_back
void pop_back()
Definition:MachineBasicBlock.h:1001
llvm::MachineBasicBlock::isEHPad
bool isEHPad() const
Returns true if the block is a landing pad.
Definition:MachineBasicBlock.h:634
llvm::MachineBasicBlock::liveouts
iterator_range< liveout_iterator > liveouts() const
Definition:MachineBasicBlock.h:601
llvm::MachineBasicBlock::back
const MachineInstr & back() const
Definition:MachineBasicBlock.h:337
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:1503
llvm::MachineBasicBlock::pred_reverse_iterator
SmallVectorImpl< MachineBasicBlock * >::reverse_iterator pred_reverse_iterator
Definition:MachineBasicBlock.h:398
llvm::MachineBasicBlock::setIsEHCatchretTarget
void setIsEHCatchretTarget(bool V=true)
Indicates if this is a target block of a catchret.
Definition:MachineBasicBlock.h:657
llvm::MachineBasicBlock::remove_instr
MachineInstr * remove_instr(MachineInstr *I)
Remove the possibly bundled instruction from the instruction list without deleting it.
Definition:MachineBasicBlock.cpp:1448
llvm::MachineBasicBlock::instr_begin
instr_iterator instr_begin()
Definition:MachineBasicBlock.h:339
llvm::MachineBasicBlock::setIsEndSection
void setIsEndSection(bool V=true)
Definition:MachineBasicBlock.h:679
llvm::MachineBasicBlock::setIrrLoopHeaderWeight
void setIrrLoopHeaderWeight(uint64_t Weight)
Definition:MachineBasicBlock.h:1235
llvm::MachineBasicBlock::getLogicalFallThrough
MachineBasicBlock * getLogicalFallThrough()
Return the fallthrough block if the block can implicitly transfer control to it's successor,...
Definition:MachineBasicBlock.h:855
llvm::MachineBasicBlock::getSymbol
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Definition:MachineBasicBlock.cpp:63
llvm::MachineBasicBlock::setIsCleanupFuncletEntry
void setIsCleanupFuncletEntry(bool V=true)
Indicates if this is the entry block of a cleanup funclet.
Definition:MachineBasicBlock.h:669
llvm::MachineBasicBlock::const_succ_iterator
SmallVectorImpl< MachineBasicBlock * >::const_iterator const_succ_iterator
Definition:MachineBasicBlock.h:396
llvm::MachineBasicBlock::rfindPrevDebugLoc
DebugLoc rfindPrevDebugLoc(reverse_iterator MBBI)
Definition:MachineBasicBlock.h:1169
llvm::MachineBasicBlock::getEHCatchretSymbol
MCSymbol * getEHCatchretSymbol() const
Return the EHCatchret Symbol for this basic block.
Definition:MachineBasicBlock.cpp:95
llvm::MachineBasicBlock::pred_end
const_pred_iterator pred_end() const
Definition:MachineBasicBlock.h:408
llvm::MachineBasicBlock::moveBefore
void moveBefore(MachineBasicBlock *NewAfter)
Move 'this' block before or after the specified block.
Definition:MachineBasicBlock.cpp:676
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:308
llvm::MachineBasicBlock::rend
reverse_iterator rend()
Definition:MachineBasicBlock.h:365
llvm::MachineBasicBlock::clear
void clear()
Definition:MachineBasicBlock.h:1101
llvm::MachineBasicBlock::replaceSuccessor
void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New)
Replace successor OLD with NEW and update probability info.
Definition:MachineBasicBlock.cpp:859
llvm::MachineBasicBlock::pred_rend
const_pred_reverse_iterator pred_rend() const
Definition:MachineBasicBlock.h:415
llvm::MachineBasicBlock::getFallThrough
MachineBasicBlock * getFallThrough(bool JumpToFallThrough=true)
Return the fallthrough block if the block can implicitly transfer control to the block after it by fa...
Definition:MachineBasicBlock.cpp:977
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:917
llvm::MachineBasicBlock::SplitCriticalEdge
MachineBasicBlock * SplitCriticalEdge(MachineBasicBlock *Succ, Pass &P, std::vector< SparseBitVector<> > *LiveInSets=nullptr, MachineDomTreeUpdater *MDTU=nullptr)
Split the critical edge from this block to the given successor block, and return the newly created bl...
Definition:MachineBasicBlock.h:975
llvm::MachineBasicBlock::hasLabelMustBeEmitted
bool hasLabelMustBeEmitted() const
Test whether this block must have its label emitted.
Definition:MachineBasicBlock.h:304
llvm::MachineBasicBlock::getFirstNonDebugInstr
const_iterator getFirstNonDebugInstr(bool SkipPseudoOp=true) const
Definition:MachineBasicBlock.h:919
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:1456
llvm::MachineBasicBlock::getSuccProbability
BranchProbability getSuccProbability(const_succ_iterator Succ) const
Return probability of the edge from this block to MBB.
Definition:MachineBasicBlock.cpp:1576
llvm::MachineBasicBlock::instr_rend
const_reverse_instr_iterator instr_rend() const
Definition:MachineBasicBlock.h:346
llvm::MachineBasicBlock::liveins
iterator_range< livein_iterator > liveins() const
Definition:MachineBasicBlock.h:505
llvm::MachineBasicBlock::setAlignment
void setAlignment(Align A, unsigned MaxBytes)
Definition:MachineBasicBlock.h:619
llvm::MachineBasicBlock::phis
iterator_range< iterator > phis()
Returns a range that iterates over the phis in the basic block.
Definition:MachineBasicBlock.h:383
llvm::MachineBasicBlock::instr_rbegin
reverse_instr_iterator instr_rbegin()
Definition:MachineBasicBlock.h:343
llvm::MachineBasicBlock::const_reverse_iterator
MachineInstrBundleIterator< const MachineInstr, true > const_reverse_iterator
Definition:MachineBasicBlock.h:323
llvm::MachineBasicBlock::succ_reverse_iterator
SmallVectorImpl< MachineBasicBlock * >::reverse_iterator succ_reverse_iterator
Definition:MachineBasicBlock.h:402
llvm::MachineBasicBlock::erase_instr
instr_iterator erase_instr(MachineInstr *I)
Remove an instruction from the instruction list and delete it.
Definition:MachineBasicBlock.h:1060
llvm::MachineBasicBlock::getNumber
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
Definition:MachineBasicBlock.h:1217
llvm::MachineBasicBlock::push_back
void push_back(MachineInstr *MI)
Definition:MachineBasicBlock.h:1002
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:212
llvm::MachineBasicBlock::pred_rbegin
pred_reverse_iterator pred_rbegin()
Definition:MachineBasicBlock.h:409
llvm::MachineBasicBlock::succ_end
succ_iterator succ_end()
Definition:MachineBasicBlock.h:423
llvm::MachineBasicBlock::addSuccessorWithoutProb
void addSuccessorWithoutProb(MachineBasicBlock *Succ)
Add Succ as a successor of this MachineBasicBlock.
Definition:MachineBasicBlock.cpp:808
llvm::MachineBasicBlock::instrs
instr_range instrs()
Definition:MachineBasicBlock.h:350
llvm::MachineBasicBlock::hasName
bool hasName() const
Check if there is a name of corresponding LLVM basic block.
Definition:MachineBasicBlock.cpp:320
llvm::MachineBasicBlock::getSinglePredecessor
MachineBasicBlock * getSinglePredecessor()
Definition:MachineBasicBlock.h:840
llvm::MachineBasicBlock::setCallFrameSize
void setCallFrameSize(unsigned N)
Set the call frame size on entry to this basic block.
Definition:MachineBasicBlock.h:1223
llvm::MachineBasicBlock::getBBID
std::optional< UniqueBBID > getBBID() const
Definition:MachineBasicBlock.h:681
llvm::MachineBasicBlock::getBasicBlock
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
Definition:MachineBasicBlock.h:256
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:817
llvm::MachineBasicBlock::const_succ_reverse_iterator
SmallVectorImpl< MachineBasicBlock * >::const_reverse_iterator const_succ_reverse_iterator
Definition:MachineBasicBlock.h:404
llvm::MachineBasicBlock::liveout_end
liveout_iterator liveout_end() const
Definition:MachineBasicBlock.h:598
llvm::MachineBasicBlock::instr_begin
const_instr_iterator instr_begin() const
Definition:MachineBasicBlock.h:340
llvm::MachineBasicBlock::succ_begin
const_succ_iterator succ_begin() const
Definition:MachineBasicBlock.h:422
llvm::MachineBasicBlock::succ_rbegin
const_succ_reverse_iterator succ_rbegin() const
Definition:MachineBasicBlock.h:427
llvm::MachineBasicBlock::pred_rend
pred_reverse_iterator pred_rend()
Definition:MachineBasicBlock.h:413
llvm::MachineBasicBlock::PrintNameFlag
PrintNameFlag
Definition:MachineBasicBlock.h:1204
llvm::MachineBasicBlock::PrintNameIr
@ PrintNameIr
Add IR name where available.
Definition:MachineBasicBlock.h:1205
llvm::MachineBasicBlock::PrintNameAttributes
@ PrintNameAttributes
Print attributes.
Definition:MachineBasicBlock.h:1206
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:693
llvm::MachineBasicBlock::getSinglePredecessor
const MachineBasicBlock * getSinglePredecessor() const
Return the predecessor of this block if it has a single predecessor.
Definition:MachineBasicBlock.cpp:973
llvm::MachineBasicBlock::SkipPHIsLabelsAndDebug
iterator SkipPHIsLabelsAndDebug(iterator I, Register Reg=Register(), bool SkipPseudoOp=true)
Return the first instruction in MBB after I that is not a PHI, label or debug.
Definition:MachineBasicBlock.cpp:227
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:1021
llvm::MachineBasicBlock::setSuccProbability
void setSuccProbability(succ_iterator I, BranchProbability Prob)
Set successor probability of a given iterator.
Definition:MachineBasicBlock.cpp:1598
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:267
llvm::MachineBasicBlock::succ_begin
succ_iterator succ_begin()
Definition:MachineBasicBlock.h:421
llvm::MachineBasicBlock::rfindDebugLoc
DebugLoc rfindDebugLoc(reverse_iterator MBBI)
Definition:MachineBasicBlock.h:1152
llvm::MachineBasicBlock::livein_empty
bool livein_empty() const
Definition:MachineBasicBlock.h:504
llvm::MachineBasicBlock::removeLiveIn
void removeLiveIn(MCRegister Reg, LaneBitmask LaneMask=LaneBitmask::getAll())
Remove the specified register from the live in set.
Definition:MachineBasicBlock.cpp:600
llvm::MachineBasicBlock::erase
iterator erase(iterator I, iterator E)
Remove a range of instructions from the instruction list and delete them.
Definition:MachineBasicBlock.h:1065
llvm::MachineBasicBlock::front
const MachineInstr & front() const
Definition:MachineBasicBlock.h:336
llvm::MachineBasicBlock::printAsOperand
void printAsOperand(raw_ostream &OS, bool PrintType=true) const
Definition:MachineBasicBlock.cpp:594
llvm::MachineBasicBlock::remove
MachineInstr * remove(MachineInstr *I)
Remove the unbundled instruction from the instruction list without deleting it.
Definition:MachineBasicBlock.h:1089
llvm::MachineBasicBlock::instrs
const_instr_range instrs() const
Definition:MachineBasicBlock.h:351
llvm::MachineBasicBlock::rbegin
const_reverse_iterator rbegin() const
Definition:MachineBasicBlock.h:362
llvm::MachineBasicBlock::clearBasicBlock
void clearBasicBlock()
Remove the reference to the underlying IR BasicBlock.
Definition:MachineBasicBlock.h:260
llvm::MachineBasicBlock::getMaxBytesForAlignment
unsigned getMaxBytesForAlignment() const
Return the maximum amount of padding allowed for aligning the basic block.
Definition:MachineBasicBlock.h:625
llvm::MachineBasicBlock::setMaxBytesForAlignment
void setMaxBytesForAlignment(unsigned MaxBytes)
Set the maximum amount of padding allowed for aligning the basic block.
Definition:MachineBasicBlock.h:628
llvm::MachineBasicBlock::validateSuccProbs
void validateSuccProbs() const
Validate successors' probabilities and check if the sum of them is approximate one.
Definition:MachineBasicBlock.cpp:784
llvm::MachineBasicBlock::predecessors
iterator_range< const_pred_iterator > predecessors() const
Definition:MachineBasicBlock.h:441
llvm::MachineBasicBlock::instr_back
const MachineInstr & instr_back() const
Definition:MachineBasicBlock.h:332
llvm::MachineBasicBlock::isIRBlockAddressTaken
bool isIRBlockAddressTaken() const
Test whether this block is the target of an IR BlockAddress.
Definition:MachineBasicBlock.h:289
llvm::MachineBasicBlock::livein_iterator
LiveInVector::const_iterator livein_iterator
Definition:MachineBasicBlock.h:491
llvm::MachineBasicBlock::getEndSymbol
MCSymbol * getEndSymbol() const
Returns the MCSymbol marking the end of this basic block.
Definition:MachineBasicBlock.cpp:106
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:1120
llvm::MachineBasicBlock::clearLiveIns
void clearLiveIns()
Clear live in list.
Definition:MachineBasicBlock.cpp:1743
llvm::MachineBasicBlock::isEHFuncletEntry
bool isEHFuncletEntry() const
Returns true if this is the entry block of an EH funclet.
Definition:MachineBasicBlock.h:660
llvm::MachineBasicBlock::getLastNonDebugInstr
const_iterator getLastNonDebugInstr(bool SkipPseudoOp=true) const
Definition:MachineBasicBlock.h:941
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:1632
llvm::MachineBasicBlock::getFirstTerminator
iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
Definition:MachineBasicBlock.cpp:244
llvm::MachineBasicBlock::sameSection
bool sameSection(const MachineBasicBlock *MBB) const
Returns true if this and MBB belong to the same section.
Definition:MachineBasicBlock.h:725
llvm::MachineBasicBlock::getLiveIns
const std::vector< RegisterMaskPair > & getLiveIns() const
Definition:MachineBasicBlock.h:512
llvm::MachineBasicBlock::insert
iterator insert(iterator I, MachineInstr *MI)
Insert MI into the instruction list before I.
Definition:MachineBasicBlock.h:1021
llvm::MachineBasicBlock::livein_begin
livein_iterator livein_begin() const
Definition:MachineBasicBlock.cpp:1753
llvm::MachineBasicBlock::succ_size
unsigned succ_size() const
Definition:MachineBasicBlock.h:433
llvm::MachineBasicBlock::isReturnBlock
bool isReturnBlock() const
Convenience function that returns true if the block ends in a return instruction.
Definition:MachineBasicBlock.h:948
llvm::MachineBasicBlock::liveins_dbg
iterator_range< livein_iterator > liveins_dbg() const
Definition:MachineBasicBlock.h:498
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:1730
llvm::MachineBasicBlock::hasAddressTaken
bool hasAddressTaken() const
Test whether this block is used as something other than the target of a terminator,...
Definition:MachineBasicBlock.h:277
llvm::MachineBasicBlock::pred_empty
bool pred_empty() const
Definition:MachineBasicBlock.h:420
llvm::MachineBasicBlock::setNumber
void setNumber(int N)
Definition:MachineBasicBlock.h:1218
llvm::MachineBasicBlock::getSectionID
MBBSectionID getSectionID() const
Returns the section ID of this basic block.
Definition:MachineBasicBlock.h:684
llvm::MachineBasicBlock::setAlignment
void setAlignment(Align A)
Set alignment of the basic block.
Definition:MachineBasicBlock.h:617
llvm::MachineBasicBlock::dump
void dump() const
Definition:MachineBasicBlock.cpp:301
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:647
llvm::MachineBasicBlock::instr_back
MachineInstr & instr_back()
Definition:MachineBasicBlock.h:330
llvm::MachineBasicBlock::isEntryBlock
bool isEntryBlock() const
Returns true if this is the entry block of the function.
Definition:MachineBasicBlock.cpp:296
llvm::MachineBasicBlock::const_instr_range
iterator_range< const_instr_iterator > const_instr_range
Definition:MachineBasicBlock.h:349
llvm::MachineBasicBlock::addSuccessor
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
Definition:MachineBasicBlock.cpp:798
llvm::MachineBasicBlock::copySuccessor
void copySuccessor(const MachineBasicBlock *Orig, succ_iterator I)
Copy a successor (and any probability info) from original block to this block's.
Definition:MachineBasicBlock.cpp:899
llvm::MachineBasicBlock::succ_iterator
SmallVectorImpl< MachineBasicBlock * >::iterator succ_iterator
Definition:MachineBasicBlock.h:394
llvm::MachineBasicBlock::pred_rbegin
const_pred_reverse_iterator pred_rbegin() const
Definition:MachineBasicBlock.h:411
llvm::MachineBasicBlock::addLiveIn
void addLiveIn(const RegisterMaskPair &RegMaskPair)
Definition:MachineBasicBlock.h:460
llvm::MachineBasicBlock::SplitCriticalEdge
MachineBasicBlock * SplitCriticalEdge(MachineBasicBlock *Succ, MachineFunctionAnalysisManager &MFAM, std::vector< SparseBitVector<> > *LiveInSets=nullptr, MachineDomTreeUpdater *MDTU=nullptr)
Definition:MachineBasicBlock.h:982
llvm::MachineBasicBlock::getSingleSuccessor
MachineBasicBlock * getSingleSuccessor()
Definition:MachineBasicBlock.h:831
llvm::MachineBasicBlock::getAddressTakenIRBlock
BasicBlock * getAddressTakenIRBlock() const
Retrieves the BasicBlock which corresponds to this MachineBasicBlock.
Definition:MachineBasicBlock.h:292
llvm::MachineBasicBlock::isEHCatchretTarget
bool isEHCatchretTarget() const
Returns true if this is a target block of a catchret.
Definition:MachineBasicBlock.h:654
llvm::MachineBasicBlock::getFirstNonPHI
const_iterator getFirstNonPHI() const
Definition:MachineBasicBlock.h:870
llvm::MachineBasicBlock::sortUniqueLiveIns
void sortUniqueLiveIns()
Sorts and uniques the LiveIns vector.
Definition:MachineBasicBlock.cpp:624
llvm::MachineBasicBlock::getSingleSuccessor
const MachineBasicBlock * getSingleSuccessor() const
Return the successor of this block if it has a single successor.
Definition:MachineBasicBlock.cpp:969
llvm::MachineBasicBlock::phis
iterator_range< const_iterator > phis() const
Definition:MachineBasicBlock.h:386
llvm::MachineBasicBlock::instr_end
const_instr_iterator instr_end() const
Definition:MachineBasicBlock.h:342
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:1760
llvm::MachineBasicBlock::findDebugLoc
DebugLoc findDebugLoc(iterator MBBI)
Definition:MachineBasicBlock.h:1144
llvm::MachineBasicBlock::pred_iterator
SmallVectorImpl< MachineBasicBlock * >::iterator pred_iterator
Definition:MachineBasicBlock.h:391
llvm::MachineBasicBlock::removeSuccessor
void removeSuccessor(MachineBasicBlock *Succ, bool NormalizeSuccProbs=false)
Remove successor from the successors list of this MachineBasicBlock.
Definition:MachineBasicBlock.cpp:836
llvm::MachineBasicBlock::succ_end
const_succ_iterator succ_end() const
Definition:MachineBasicBlock.h:424
llvm::MachineBasicBlock::getFirstNonPHI
iterator getFirstNonPHI()
Returns a pointer to the first instruction in this block that is not a PHINode instruction.
Definition:MachineBasicBlock.cpp:202
llvm::MachineBasicBlock::begin
const_iterator begin() const
Definition:MachineBasicBlock.h:356
llvm::MachineBasicBlock::succ_empty
bool succ_empty() const
Definition:MachineBasicBlock.h:436
llvm::MachineBasicBlock::isPredecessor
bool isPredecessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB is a predecessor of this block.
Definition:MachineBasicBlock.cpp:956
llvm::MachineBasicBlock::hasSuccessorProbabilities
bool hasSuccessorProbabilities() const
Return true if any of the successors have probabilities attached to them.
Definition:MachineBasicBlock.h:812
llvm::MachineBasicBlock::setSectionID
void setSectionID(MBBSectionID V)
Sets the section ID for this basic block.
Definition:MachineBasicBlock.h:693
llvm::MachineBasicBlock::terminators
iterator_range< const_iterator > terminators() const
Definition:MachineBasicBlock.h:378
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:497
llvm::MachineBasicBlock::rfindDebugLoc
DebugLoc rfindDebugLoc(reverse_instr_iterator MBBI)
Has exact same behavior as findDebugLoc (it also searches towards the end of this MBB) except that th...
Definition:MachineBasicBlock.cpp:1524
llvm::MachineBasicBlock::begin
iterator begin()
Definition:MachineBasicBlock.h:355
llvm::MachineBasicBlock::pred_begin
const_pred_iterator pred_begin() const
Definition:MachineBasicBlock.h:406
llvm::MachineBasicBlock::print
void print(raw_ostream &OS, const SlotIndexes *=nullptr, bool IsStandalone=true) const
Definition:MachineBasicBlock.cpp:345
llvm::MachineBasicBlock::instr_rend
reverse_instr_iterator instr_rend()
Definition:MachineBasicBlock.h:345
llvm::MachineBasicBlock::rend
const_reverse_iterator rend() const
Definition:MachineBasicBlock.h:366
llvm::MachineBasicBlock::findDebugLoc
DebugLoc findDebugLoc(instr_iterator MBBI)
Find the next valid DebugLoc starting at MBBI, skipping any debug instructions.
Definition:MachineBasicBlock.cpp:1516
llvm::MachineBasicBlock::instr_iterator
Instructions::iterator instr_iterator
Definition:MachineBasicBlock.h:314
llvm::MachineBasicBlock::pred_begin
pred_iterator pred_begin()
Definition:MachineBasicBlock.h:405
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:273
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:1483
llvm::MachineBasicBlock::reverse_iterator
MachineInstrBundleIterator< MachineInstr, true > reverse_iterator
Definition:MachineBasicBlock.h:321
llvm::MachineBasicBlock::succ_rbegin
succ_reverse_iterator succ_rbegin()
Definition:MachineBasicBlock.h:425
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:964
llvm::MachineBasicBlock::getSublistAccess
static Instructions MachineBasicBlock::* getSublistAccess(MachineInstr *)
Support for MachineInstr::getNextNode().
Definition:MachineBasicBlock.h:371
llvm::MachineBasicBlock::findPrevDebugLoc
DebugLoc findPrevDebugLoc(instr_iterator MBBI)
Find the previous valid DebugLoc preceding MBBI, skipping any debug instructions.
Definition:MachineBasicBlock.cpp:1536
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:1025
llvm::MachineBasicBlock::getParent
MachineFunction * getParent()
Definition:MachineBasicBlock.h:312
llvm::MachineBasicBlock::eraseFromParent
void eraseFromParent()
This method unlinks 'this' from the containing function and deletes it.
Definition:MachineBasicBlock.cpp:1476
llvm::MachineBasicBlock::MachineFunction
friend class MachineFunction
Definition:MachineBasicBlock.h:250
llvm::MachineBasicBlock::setIsInlineAsmBrIndirectTarget
void setIsInlineAsmBrIndirectTarget(bool V=true)
Indicates if this is the indirect dest of an INLINEASM_BR.
Definition:MachineBasicBlock.h:709
llvm::MachineBasicBlock::instr_end
instr_iterator instr_end()
Definition:MachineBasicBlock.h:341
llvm::MachineBasicBlock::end
iterator end()
Definition:MachineBasicBlock.h:357
llvm::MachineBasicBlock::const_instr_iterator
Instructions::const_iterator const_instr_iterator
Definition:MachineBasicBlock.h:315
llvm::MachineBasicBlock::successors
iterator_range< const_succ_iterator > successors() const
Definition:MachineBasicBlock.h:447
llvm::MachineBasicBlock::addLiveIn
void addLiveIn(MCRegister PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll())
Adds the specified register as a live in.
Definition:MachineBasicBlock.h:456
llvm::MachineBasicBlock::getFirstTerminator
const_iterator getFirstTerminator() const
Definition:MachineBasicBlock.h:889
llvm::MachineBasicBlock::succ_rend
const_succ_reverse_iterator succ_rend() const
Definition:MachineBasicBlock.h:431
llvm::MachineBasicBlock::back
MachineInstr & back()
Definition:MachineBasicBlock.h:335
llvm::MachineBasicBlock::getParent
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
Definition:MachineBasicBlock.h:311
llvm::MachineBasicBlock::erase
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
Definition:MachineBasicBlock.cpp:1443
llvm::MachineBasicBlock::getFullName
std::string getFullName() const
Return a formatted string to identify this block and its parent function.
Definition:MachineBasicBlock.cpp:334
llvm::MachineBasicBlock::isBeginSection
bool isBeginSection() const
Returns true if this block begins any section.
Definition:MachineBasicBlock.h:672
llvm::MachineBasicBlock::findPrevDebugLoc
DebugLoc findPrevDebugLoc(iterator MBBI)
Definition:MachineBasicBlock.h:1160
llvm::MachineBasicBlock::terminators
iterator_range< iterator > terminators()
Definition:MachineBasicBlock.h:375
llvm::MachineBasicBlock::getCallFrameSize
unsigned getCallFrameSize() const
Return the call frame size on entry to this basic block.
Definition:MachineBasicBlock.h:1221
llvm::MachineBasicBlock::setIsEHFuncletEntry
void setIsEHFuncletEntry(bool V=true)
Indicates if this is the entry block of an EH funclet.
Definition:MachineBasicBlock.h:663
llvm::MachineBasicBlock::findBranchDebugLoc
DebugLoc findBranchDebugLoc()
Find and return the merged DebugLoc of the branch instructions of the block.
Definition:MachineBasicBlock.cpp:1559
llvm::MachineBasicBlock::successors
iterator_range< succ_iterator > successors()
Definition:MachineBasicBlock.h:444
llvm::MachineBasicBlock::getFirstInstrTerminator
instr_iterator getFirstInstrTerminator()
Same getFirstTerminator but it ignores bundles and return an instr_iterator instead.
Definition:MachineBasicBlock.cpp:253
llvm::MachineBasicBlock::rbegin
reverse_iterator rbegin()
Definition:MachineBasicBlock.h:359
llvm::MachineBasicBlock::isMachineBlockAddressTaken
bool isMachineBlockAddressTaken() const
Test whether this block is used as something other than the target of a terminator,...
Definition:MachineBasicBlock.h:285
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:490
llvm::MachineBasicBlock::insertAfter
iterator insertAfter(iterator I, MachineInstr *MI)
Insert MI into the instruction list after I.
Definition:MachineBasicBlock.h:1030
llvm::MachineBasicBlock::size
unsigned size() const
Definition:MachineBasicBlock.h:325
llvm::MachineBasicBlock::isSuccessor
bool isSuccessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB is a successor of this block.
Definition:MachineBasicBlock.cpp:960
llvm::MachineBasicBlock::predecessors
iterator_range< pred_iterator > predecessors()
Definition:MachineBasicBlock.h:438
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:1109
llvm::MachineBasicBlock::isEHScopeReturnBlock
bool isEHScopeReturnBlock() const
Convenience function that returns true if the bock ends in a EH scope return instruction.
Definition:MachineBasicBlock.h:954
llvm::MachineBasicBlock::isEndSection
bool isEndSection() const
Returns true if this block ends any section.
Definition:MachineBasicBlock.h:675
llvm::MachineBasicBlock::getAlignment
Align getAlignment() const
Return alignment of the basic block.
Definition:MachineBasicBlock.h:614
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:1384
llvm::MachineBasicBlock::iterator
MachineInstrBundleIterator< MachineInstr > iterator
Definition:MachineBasicBlock.h:319
llvm::MachineBasicBlock::isLegalToHoistInto
bool isLegalToHoistInto() const
Returns true if it is legal to hoist instructions into this block.
Definition:MachineBasicBlock.cpp:314
llvm::MachineBasicBlock::instr_front
MachineInstr & instr_front()
Definition:MachineBasicBlock.h:329
llvm::MachineBasicBlock::const_pred_iterator
SmallVectorImpl< MachineBasicBlock * >::const_iterator const_pred_iterator
Definition:MachineBasicBlock.h:393
llvm::MachineBasicBlock::instr_rbegin
const_reverse_instr_iterator instr_rbegin() const
Definition:MachineBasicBlock.h:344
llvm::MachineBasicBlock::erase
iterator erase(iterator I)
Remove an instruction or bundle from the instruction list and delete it.
Definition:MachineBasicBlock.h:1072
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:1040
llvm::MachineBasicBlock::end
const_iterator end() const
Definition:MachineBasicBlock.h:358
llvm::MachineBasicBlock::getName
StringRef getName() const
Return the name of the corresponding LLVM basic block, or an empty string.
Definition:MachineBasicBlock.cpp:326
llvm::MachineBasicBlock::front
MachineInstr & front()
Definition:MachineBasicBlock.h:334
llvm::MachineBasicBlock::const_pred_reverse_iterator
SmallVectorImpl< MachineBasicBlock * >::const_reverse_iterator const_pred_reverse_iterator
Definition:MachineBasicBlock.h:400
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:306
llvm::MachineBasicBlock::LivenessQueryResult
LivenessQueryResult
Possible outcome of a register liveness query to computeRegisterLiveness()
Definition:MachineBasicBlock.h:1178
llvm::MachineBasicBlock::LQR_Dead
@ LQR_Dead
Register is known to be fully dead.
Definition:MachineBasicBlock.h:1180
llvm::MachineBasicBlock::LQR_Live
@ LQR_Live
Register is known to be (at least partially) live.
Definition:MachineBasicBlock.h:1179
llvm::MachineBasicBlock::LQR_Unknown
@ LQR_Unknown
Register liveness not decidable from local neighborhood.
Definition:MachineBasicBlock.h:1181
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:651
llvm::MachineBasicBlock::moveAfter
void moveAfter(MachineBasicBlock *NewBefore)
Definition:MachineBasicBlock.cpp:680
llvm::MachineBasicBlock::succ_rend
succ_reverse_iterator succ_rend()
Definition:MachineBasicBlock.h:429
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:297
llvm::MachineBasicBlock::getIrrLoopHeaderWeight
std::optional< uint64_t > getIrrLoopHeaderWeight() const
Definition:MachineBasicBlock.h:1231
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:1736
llvm::MachineBasicBlock::setIsBeginSection
void setIsBeginSection(bool V=true)
Definition:MachineBasicBlock.h:677
llvm::MachineBasicBlock::sizeWithoutDebugLargerThan
bool sizeWithoutDebugLargerThan(unsigned Limit) const
Definition:MachineBasicBlock.cpp:1777
llvm::MachineBasicBlock::instr_range
iterator_range< instr_iterator > instr_range
Definition:MachineBasicBlock.h:348
llvm::MachineBasicBlock::pop_front
void pop_front()
Definition:MachineBasicBlock.h:1000
llvm::MachineBasicBlock::isLiveIn
bool isLiveIn(MCRegister Reg, LaneBitmask LaneMask=LaneBitmask::getAll()) const
Return true if the specified register is in the live in set.
Definition:MachineBasicBlock.cpp:618
llvm::MachineBasicBlock::removeFromParent
MachineBasicBlock * removeFromParent()
This method unlinks 'this' from the containing function, and returns it, but does not delete it.
Definition:MachineBasicBlock.cpp:1469
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:1014
llvm::MachineBasicBlock::setIsEHPad
void setIsEHPad(bool V=true)
Indicates the block is a landing pad.
Definition:MachineBasicBlock.h:638
llvm::MachineBasicBlock::reverse_instr_iterator
Instructions::reverse_iterator reverse_instr_iterator
Definition:MachineBasicBlock.h:316
llvm::MachineBasicBlock::isCleanupFuncletEntry
bool isCleanupFuncletEntry() const
Returns true if this is the entry block of a cleanup funclet.
Definition:MachineBasicBlock.h:666
llvm::MachineBranchProbabilityInfo
Definition:MachineBranchProbabilityInfo.h:23
llvm::MachineDomTreeUpdater
Definition:MachineDomTreeUpdater.h:26
llvm::MachineFunction
Definition:MachineFunction.h:267
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::MachineInstrBundleIterator::getInstrIterator
instr_iterator getInstrIterator() const
Definition:MachineInstrBundleIterator.h:274
llvm::MachineInstrBundleIterator< MachineInstr, true >::getAtBundleBegin
static MachineInstrBundleIterator getAtBundleBegin(instr_iterator MI)
Get the bundle iterator for the given instruction's bundle.
Definition:MachineInstrBundleIterator.h:174
llvm::MachineInstrSpan
MachineInstrSpan provides an interface to get an iteration range containing the instruction it was in...
Definition:MachineBasicBlock.h:1391
llvm::MachineInstrSpan::getInitial
MachineBasicBlock::iterator getInitial()
Definition:MachineBasicBlock.h:1408
llvm::MachineInstrSpan::MachineInstrSpan
MachineInstrSpan(MachineBasicBlock::iterator I, MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1396
llvm::MachineInstrSpan::begin
MachineBasicBlock::iterator begin()
Definition:MachineBasicBlock.h:1402
llvm::MachineInstrSpan::empty
bool empty()
Definition:MachineBasicBlock.h:1406
llvm::MachineInstrSpan::end
MachineBasicBlock::iterator end()
Definition:MachineBasicBlock.h:1405
llvm::MachineInstr
Representation of each machine instruction.
Definition:MachineInstr.h:71
llvm::MachineInstr::isReturn
bool isReturn(QueryType Type=AnyInBundle) const
Definition:MachineInstr.h:948
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:954
llvm::ModuleSlotTracker
Manage lifetime of a slot tracker for printing IR.
Definition:ModuleSlotTracker.h:44
llvm::Pass
Pass interface - Implemented by all 'passes'.
Definition:Pass.h:94
llvm::Printable
Simple wrapper around std::function<void(raw_ostream&)>.
Definition:Printable.h:38
llvm::Register
Wrapper class representing virtual and physical registers.
Definition:Register.h:19
llvm::SlotIndexes
SlotIndexes pass.
Definition:SlotIndexes.h:297
llvm::SmallVectorBase::empty
bool empty() const
Definition:SmallVector.h:81
llvm::SmallVectorBase::size
size_t size() const
Definition:SmallVector.h:78
llvm::SmallVectorImpl::const_iterator
typename SuperClass::const_iterator const_iterator
Definition:SmallVector.h:578
llvm::SmallVectorImpl::iterator
typename SuperClass::iterator iterator
Definition:SmallVector.h:577
llvm::SmallVectorTemplateCommon::end
iterator end()
Definition:SmallVector.h:269
llvm::SmallVectorTemplateCommon::rbegin
reverse_iterator rbegin()
Definition:SmallVector.h:273
llvm::SmallVectorTemplateCommon::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition:SmallVector.h:254
llvm::SmallVectorTemplateCommon::begin
iterator begin()
Definition:SmallVector.h:267
llvm::SmallVectorTemplateCommon::rend
reverse_iterator rend()
Definition:SmallVector.h:275
llvm::SmallVectorTemplateCommon::reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
Definition:SmallVector.h:255
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition:SmallVector.h:1196
llvm::SparseBitVector
Definition:SparseBitVector.h:256
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::SuccIterator
Definition:CFG.h:141
llvm::TargetRegisterClass
Definition:TargetRegisterInfo.h:44
llvm::TargetRegisterInfo
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Definition:TargetRegisterInfo.h:235
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition:Type.h:45
llvm::ilist_node_with_parent
An ilist node that can access its parent list.
Definition:ilist_node.h:321
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:125
llvm::iplist_impl< simple_ilist< T, Options... >, ilist_traits< T > >::reverse_iterator
base_list_type::reverse_iterator reverse_iterator
Definition:ilist.h:123
llvm::iplist_impl< simple_ilist< T, Options... >, ilist_traits< T > >::const_iterator
base_list_type::const_iterator const_iterator
Definition:ilist.h:122
llvm::iplist_impl< simple_ilist< T, Options... >, ilist_traits< T > >::iterator
base_list_type::iterator iterator
Definition:ilist.h:121
llvm::iplist
An intrusive list with ownership and callbacks specified/controlled by ilist_traits,...
Definition:ilist.h:328
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition:iterator_range.h:42
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::simple_ilist
A simple intrusive list implementation.
Definition:simple_ilist.h:81
uint16_t
uint32_t
uint64_t
ilist.h
This file defines classes to implement an intrusive doubly linked list class (i.e.
iterator_range.h
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition:ISDOpcodes.h:71
llvm::ISD::MCSymbol
@ MCSymbol
Definition:ISDOpcodes.h:178
llvm::detail::combineHashValue
unsigned combineHashValue(unsigned a, unsigned b)
Simplistic combination of 32-bit hash values into 32-bit hash values.
Definition:DenseMapInfo.h:39
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
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:1440
llvm::pred_end
auto pred_end(const MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1385
llvm::successors
auto successors(const MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1376
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::make_range
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Definition:iterator_range.h:77
llvm::pred_size
auto pred_size(const MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1381
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:1416
llvm::succ_size
auto succ_size(const MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1380
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:573
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:1454
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:1429
llvm::succ_begin
RNSuccIterator< NodeRef, BlockT, RegionT > succ_begin(NodeRef Node)
Definition:RegionIterator.h:249
llvm::IRMemLocation::Other
@ Other
Any other memory.
llvm::IRMemLocation::First
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
llvm::succ_end
RNSuccIterator< NodeRef, BlockT, RegionT > succ_end(NodeRef Node)
Definition:RegionIterator.h:254
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition:APFixedPoint.h:303
llvm::PseudoProbeReservedId::Last
@ Last
llvm::pred_begin
auto pred_begin(const MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1383
llvm::predecessors
auto predecessors(const MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1377
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:1447
llvm::printMBBReference
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
Definition:MachineBasicBlock.cpp:122
std
Implement std::hash so that hash_code can be used in STL containers.
Definition:BitVector.h:858
N
#define N
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition:Alignment.h:39
llvm::DenseMapInfo< MBBSectionID >::getEmptyKey
static MBBSectionID getEmptyKey()
Definition:MachineBasicBlock.h:85
llvm::DenseMapInfo< MBBSectionID >::getHashValue
static unsigned getHashValue(const MBBSectionID &SecID)
Definition:MachineBasicBlock.h:91
llvm::DenseMapInfo< MBBSectionID >::isEqual
static bool isEqual(const MBBSectionID &LHS, const MBBSectionID &RHS)
Definition:MachineBasicBlock.h:95
llvm::DenseMapInfo< MBBSectionID >::getTombstoneKey
static MBBSectionID getTombstoneKey()
Definition:MachineBasicBlock.h:88
llvm::DenseMapInfo< unsigned >
Definition:DenseMapInfo.h:126
llvm::DenseMapInfo
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition:DenseMapInfo.h:52
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition:MachineBasicBlock.h:1344
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::getEntryNode
static NodeRef getEntryNode(Inverse< MachineBasicBlock * > G)
Definition:MachineBasicBlock.h:1339
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::ChildIteratorType
MachineBasicBlock::pred_iterator ChildIteratorType
Definition:MachineBasicBlock.h:1337
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::getNumber
static unsigned getNumber(MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1346
llvm::GraphTraits< Inverse< MachineBasicBlock * > >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition:MachineBasicBlock.h:1343
llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition:MachineBasicBlock.h:1364
llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::getNumber
static unsigned getNumber(const MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1366
llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::getEntryNode
static NodeRef getEntryNode(Inverse< const MachineBasicBlock * > G)
Definition:MachineBasicBlock.h:1359
llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition:MachineBasicBlock.h:1363
llvm::GraphTraits< Inverse< const MachineBasicBlock * > >::ChildIteratorType
MachineBasicBlock::const_pred_iterator ChildIteratorType
Definition:MachineBasicBlock.h:1357
llvm::GraphTraits< MachineBasicBlock * >::getNumber
static unsigned getNumber(MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1303
llvm::GraphTraits< MachineBasicBlock * >::ChildIteratorType
MachineBasicBlock::succ_iterator ChildIteratorType
Definition:MachineBasicBlock.h:1297
llvm::GraphTraits< MachineBasicBlock * >::getEntryNode
static NodeRef getEntryNode(MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1299
llvm::GraphTraits< MachineBasicBlock * >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition:MachineBasicBlock.h:1301
llvm::GraphTraits< MachineBasicBlock * >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition:MachineBasicBlock.h:1300
llvm::GraphTraits< const MachineBasicBlock * >::ChildIteratorType
MachineBasicBlock::const_succ_iterator ChildIteratorType
Definition:MachineBasicBlock.h:1314
llvm::GraphTraits< const MachineBasicBlock * >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition:MachineBasicBlock.h:1317
llvm::GraphTraits< const MachineBasicBlock * >::getNumber
static unsigned getNumber(const MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1320
llvm::GraphTraits< const MachineBasicBlock * >::getEntryNode
static NodeRef getEntryNode(const MachineBasicBlock *BB)
Definition:MachineBasicBlock.h:1316
llvm::GraphTraits< const MachineBasicBlock * >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition:MachineBasicBlock.h:1318
llvm::GraphTraits
Definition:GraphTraits.h:38
llvm::Inverse
Definition:GraphTraits.h:123
llvm::LaneBitmask
Definition:LaneBitmask.h:40
llvm::LaneBitmask::getAll
static constexpr LaneBitmask getAll()
Definition:LaneBitmask.h:82
llvm::MBB2NumberFunctor
Definition:MachineBasicBlock.h:1280
llvm::MBB2NumberFunctor::operator()
unsigned operator()(const MachineBasicBlock *MBB) const
Definition:MachineBasicBlock.h:1282
llvm::MBBSectionID
Definition:MachineBasicBlock.h:55
llvm::MBBSectionID::operator!=
bool operator!=(const MBBSectionID &Other) const
Definition:MachineBasicBlock.h:74
llvm::MBBSectionID::ExceptionSectionID
static const MBBSectionID ExceptionSectionID
Definition:MachineBasicBlock.h:68
llvm::MBBSectionID::Number
unsigned Number
Definition:MachineBasicBlock.h:62
llvm::MBBSectionID::ColdSectionID
static const MBBSectionID ColdSectionID
Definition:MachineBasicBlock.h:67
llvm::MBBSectionID::MBBSectionID
MBBSectionID(unsigned N)
Definition:MachineBasicBlock.h:64
llvm::MBBSectionID::Type
enum llvm::MBBSectionID::SectionType Type
llvm::MBBSectionID::SectionType
SectionType
Definition:MachineBasicBlock.h:56
llvm::MBBSectionID::Cold
@ Cold
Definition:MachineBasicBlock.h:60
llvm::MBBSectionID::Exception
@ Exception
Definition:MachineBasicBlock.h:59
llvm::MBBSectionID::Default
@ Default
Definition:MachineBasicBlock.h:57
llvm::MBBSectionID::operator==
bool operator==(const MBBSectionID &Other) const
Definition:MachineBasicBlock.h:70
llvm::MachineBasicBlock::RegisterMaskPair
Pair of physical register and lane mask.
Definition:MachineBasicBlock.h:130
llvm::MachineBasicBlock::RegisterMaskPair::RegisterMaskPair
RegisterMaskPair(MCPhysReg PhysReg, LaneBitmask LaneMask)
Definition:MachineBasicBlock.h:135
llvm::MachineBasicBlock::RegisterMaskPair::operator==
bool operator==(const RegisterMaskPair &other) const
Definition:MachineBasicBlock.h:138
llvm::MachineBasicBlock::RegisterMaskPair::LaneMask
LaneBitmask LaneMask
Definition:MachineBasicBlock.h:133
llvm::MachineBasicBlock::RegisterMaskPair::PhysReg
MCRegister PhysReg
Definition:MachineBasicBlock.h:132
llvm::UniqueBBID
Definition:MachineBasicBlock.h:102
llvm::UniqueBBID::BaseID
unsigned BaseID
Definition:MachineBasicBlock.h:103
llvm::UniqueBBID::CloneID
unsigned CloneID
Definition:MachineBasicBlock.h:104
llvm::ilist_callback_traits
Callbacks do nothing by default in iplist and ilist.
Definition:ilist.h:65
llvm::ilist_traits< MachineInstr >::transferNodesFromList
void transferNodesFromList(ilist_traits &FromList, instr_iterator First, instr_iterator Last)
llvm::ilist_traits< MachineInstr >::addNodeToList
void addNodeToList(MachineInstr *N)
llvm::ilist_traits< MachineInstr >::removeNodeFromList
void removeNodeFromList(MachineInstr *N)
llvm::ilist_traits< MachineInstr >::deleteNode
void deleteNode(MachineInstr *MI)
llvm::ilist_traits
Template traits for intrusive list.
Definition:ilist.h:90

Generated on Thu Jul 17 2025 09:47:10 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp