LLVM 20.0.0git
|
Abstract class used to represent an insertion point in a CFG. More...
#include "llvm/CodeGen/GlobalISel/RegBankSelect.h"
Public Member Functions | |
virtual | ~InsertPoint ()=default |
MachineBasicBlock::iterator | getPoint () |
The first call to this method will cause the splitting to happen if need be, then sub sequent calls just return the iterator to that point. | |
MachineBasicBlock & | getInsertMBB () |
The first call to this method will cause the splitting to happen if need be, then sub sequent calls just return the basic block that contains the insertion point. | |
MachineBasicBlock::iterator | insert (MachineInstr &MI) |
Insert MI in the just before getPoint() | |
virtual bool | isSplit () const |
Does this point involve splitting an edge or block? As soon as getPoint is called and thus, the point materialized, the point will not require splitting anymore, i.e., this will return false. | |
virtual uint64_t | frequency (const Pass &P) const |
Frequency of the insertion point. | |
virtual bool | canMaterialize () const |
Check whether this insertion point can be materialized. | |
Protected Member Functions | |
virtual void | materialize ()=0 |
Materialize the insertion point. | |
virtual MachineBasicBlock & | getInsertMBBImpl ()=0 |
Return the materialized insertion basic block. | |
virtual MachineBasicBlock::iterator | getPointImpl ()=0 |
Return the materialized insertion point. | |
Protected Attributes | |
bool | WasMaterialized = false |
Tell if the insert point has already been materialized. | |
Abstract class used to represent an insertion point in a CFG.
This class records an insertion point and materializes it on demand. It allows to reason about the frequency of this insertion point, without having to logically materialize it (e.g., on an edge), before we actually need to insert something.
Definition at line 111 of file RegBankSelect.h.
|
virtualdefault |
|
inlinevirtual |
Check whether this insertion point can be materialized.
As soon as getPoint is called and thus, the point materialized calling this method does not make sense.
Reimplemented in llvm::RegBankSelect::InstrInsertPoint, llvm::RegBankSelect::MBBInsertPoint, and llvm::RegBankSelect::EdgeInsertPoint.
Definition at line 200 of file RegBankSelect.h.
Referenced by llvm::RegBankSelect::RepairingPlacement::addInsertPoint(), getInsertMBB(), and getPoint().
Frequency of the insertion point.
P
is used to access the various analysis that will help to get that information, like MachineBlockFrequencyInfo. If P
does not contain enough to return the actual frequency, this returns 1.
Reimplemented in llvm::RegBankSelect::InstrInsertPoint, llvm::RegBankSelect::MBBInsertPoint, and llvm::RegBankSelect::EdgeInsertPoint.
Definition at line 195 of file RegBankSelect.h.
|
inline |
The first call to this method will cause the splitting to happen if need be, then sub sequent calls just return the basic block that contains the insertion point.
I.e., no more splitting will occur.
Definition at line 168 of file RegBankSelect.h.
References assert(), canMaterialize(), getInsertMBBImpl(), isSplit(), materialize(), and WasMaterialized.
Referenced by insert().
|
protectedpure virtual |
Return the materialized insertion basic block.
Code will be inserted into that basic block.
Referenced by getInsertMBB().
|
inline |
The first call to this method will cause the splitting to happen if need be, then sub sequent calls just return the iterator to that point.
I.e., no more splitting will occur.
Definition at line 149 of file RegBankSelect.h.
References assert(), canMaterialize(), getPointImpl(), isSplit(), materialize(), and WasMaterialized.
Referenced by insert().
|
protectedpure virtual |
Return the materialized insertion point.
Code will be inserted before that point.
Referenced by getPoint().
|
inline |
Insert MI
in the just before getPoint()
Definition at line 180 of file RegBankSelect.h.
References getInsertMBB(), getPoint(), llvm::MachineBasicBlock::insert(), and MI.
|
inlinevirtual |
Does this point involve splitting an edge or block? As soon as getPoint is called and thus, the point materialized, the point will not require splitting anymore, i.e., this will return false.
Reimplemented in llvm::RegBankSelect::InstrInsertPoint, llvm::RegBankSelect::MBBInsertPoint, and llvm::RegBankSelect::EdgeInsertPoint.
Definition at line 188 of file RegBankSelect.h.
Referenced by llvm::RegBankSelect::RepairingPlacement::addInsertPoint(), getInsertMBB(), and getPoint().
|
protectedpure virtual |
Materialize the insertion point.
If isSplit() is true, this involves actually splitting the block or edge.
Referenced by getInsertMBB(), and getPoint().
|
protected |
Tell if the insert point has already been materialized.
Definition at line 114 of file RegBankSelect.h.
Referenced by getInsertMBB(), and getPoint().