My Project
|
Block
represents an ordered list of Operation
s.
More...
#include <Block.h>
Classes | |
class | op_iterator |
Public Types | |
using | BlockArgListType = MutableArrayRef< BlockArgument > |
using | args_iterator = BlockArgListType::iterator |
using | reverse_args_iterator = BlockArgListType::reverse_iterator |
using | OpListType = llvm::iplist< Operation > |
This is the list of operations in the block. More... | |
using | iterator = OpListType::iterator |
using | reverse_iterator = OpListType::reverse_iterator |
using | pred_iterator = PredecessorIterator |
using | succ_iterator = SuccessorRange::iterator |
Public Types inherited from mlir::IRObjectWithUseList< BlockOperand > | |
using | use_iterator = ValueUseIterator< BlockOperand > |
using | use_range = iterator_range< use_iterator > |
using | user_iterator = ValueUserIterator< use_iterator, BlockOperand > |
using | user_range = iterator_range< user_iterator > |
Public Member Functions | |
Block () | |
~Block () | |
void | clear () |
Region * | getParent () const |
Operation * | getParentOp () |
Returns the closest surrounding operation that contains this block. More... | |
bool | isEntryBlock () |
Return if this block is the entry block in the parent region. More... | |
void | insertBefore (Block *block) |
void | moveBefore (Block *block) |
void | erase () |
Unlink this Block from its parent region and delete it. More... | |
BlockArgListType | getArguments () |
args_iterator | args_begin () |
args_iterator | args_end () |
reverse_args_iterator | args_rbegin () |
reverse_args_iterator | args_rend () |
bool | args_empty () |
BlockArgument | addArgument (Type type) |
Add one value to the argument list. More... | |
BlockArgument | insertArgument (args_iterator it, Type type) |
iterator_range< args_iterator > | addArguments (ArrayRef< Type > types) |
Add one argument to the argument list for each type specified in the list. More... | |
void | eraseArgument (unsigned index, bool updatePredTerms=true) |
unsigned | getNumArguments () |
BlockArgument | getArgument (unsigned i) |
OpListType & | getOperations () |
iterator | begin () |
iterator | end () |
reverse_iterator | rbegin () |
reverse_iterator | rend () |
bool | empty () |
void | push_back (Operation *op) |
void | push_front (Operation *op) |
Operation & | back () |
Operation & | front () |
Operation * | findAncestorOpInBlock (Operation &op) |
void | dropAllReferences () |
void | dropAllDefinedValueUses () |
bool | isOpOrderValid () |
void | invalidateOpOrder () |
Invalidates the current ordering of operations. More... | |
bool | verifyOpOrder () |
void | recomputeOpOrder () |
Recomputes the ordering of child operations within the block. More... | |
template<typename OpT > | |
iterator_range< op_iterator< OpT > > | getOps () |
template<typename OpT > | |
op_iterator< OpT > | op_begin () |
template<typename OpT > | |
op_iterator< OpT > | op_end () |
iterator_range< iterator > | without_terminator () |
Operation * | getTerminator () |
pred_iterator | pred_begin () |
pred_iterator | pred_end () |
iterator_range< pred_iterator > | getPredecessors () |
bool | hasNoPredecessors () |
Return true if this block has no predecessors. More... | |
Block * | getSinglePredecessor () |
unsigned | getNumSuccessors () |
Block * | getSuccessor (unsigned i) |
succ_iterator | succ_begin () |
succ_iterator | succ_end () |
SuccessorRange | getSuccessors () |
template<typename FnT , typename RetT = detail::walkResultType<FnT>> | |
RetT | walk (FnT &&callback) |
template<typename FnT , typename RetT = detail::walkResultType<FnT>> | |
std::enable_if< std::is_same< RetT, void >::value, RetT >::type | walk (Block::iterator begin, Block::iterator end, FnT &&callback) |
template<typename FnT , typename RetT = detail::walkResultType<FnT>> | |
std::enable_if< std::is_same< RetT, WalkResult >::value, RetT >::type | walk (Block::iterator begin, Block::iterator end, FnT &&callback) |
Block * | splitBlock (iterator splitBefore) |
Block * | splitBlock (Operation *splitBeforeOp) |
void | print (raw_ostream &os) |
void | dump () |
void | printAsOperand (raw_ostream &os, bool printType=true) |
Print out the name of the block without printing its body. More... | |
Public Member Functions inherited from mlir::IRObjectWithUseList< BlockOperand > | |
~IRObjectWithUseList () | |
void | dropAllUses () |
Drop all uses of this object from their respective owners. More... | |
void | replaceAllUsesWith (typename BlockOperand ::ValueType newValue) |
use_iterator | use_begin () const |
use_iterator | use_end () const |
use_range | getUses () const |
Returns a range of all uses, which is useful for iterating over all uses. More... | |
bool | hasOneUse () const |
Returns true if this value has exactly one use. More... | |
bool | use_empty () const |
Returns true if this value has no uses. More... | |
user_iterator | user_begin () const |
user_iterator | user_end () const |
user_range | getUsers () const |
Returns a range of all users. More... | |
Static Public Member Functions | |
static OpListType Block::* | getSublistAccess (Operation *) |
Returns pointer to member of operation list. More... | |
Friends | |
struct | llvm::ilist_traits< Block > |
Additional Inherited Members | |
Protected Member Functions inherited from mlir::IRObjectWithUseList< BlockOperand > | |
IRObjectWithUseList () | |
BlockOperand * | getFirstUse () const |
using mlir::Block::args_iterator = BlockArgListType::iterator |
using mlir::Block::iterator = OpListType::iterator |
using mlir::Block::OpListType = llvm::iplist<Operation> |
This is the list of operations in the block.
using mlir::Block::reverse_args_iterator = BlockArgListType::reverse_iterator |
using mlir::Block::reverse_iterator = OpListType::reverse_iterator |
using mlir::Block::succ_iterator = SuccessorRange::iterator |
|
inlineexplicit |
Block::~Block | ( | ) |
BlockArgument Block::addArgument | ( | Type | type | ) |
Add one value to the argument list.
Add one argument to the argument list for each type specified in the list.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void Block::dropAllDefinedValueUses | ( | ) |
This drops all uses of values defined in this block or in the blocks of nested regions wherever the uses are located.
void Block::dropAllReferences | ( | ) |
This drops all operand uses from operations within this block, which is an essential step in breaking cyclic dependences between references when they are to be deleted.
void Block::dump | ( | ) |
|
inline |
|
inline |
void Block::erase | ( | ) |
void Block::eraseArgument | ( | unsigned | index, |
bool | updatePredTerms = true |
||
) |
Erase the argument at 'index' and remove it from the argument list. If 'updatePredTerms' is set to true, this argument is also removed from the terminators of each predecessor to this block.
Returns 'op' if 'op' lies in this block, or otherwise finds the ancestor operation of 'op' that lies in this block. Returns nullptr if the latter fails. TODO: This is very specific functionality that should live somewhere else, probably in Dominance.cpp.
Returns 'op' if 'op' lies in this block, or otherwise finds the ancestor operation of 'op' that lies in this block. Returns nullptr if the latter fails.
|
inline |
|
inline |
|
inline |
|
inline |
unsigned Block::getNumSuccessors | ( | ) |
|
inline |
|
inline |
Return an iterator range over the operations within this block that are of 'OpT'.
Region * Block::getParent | ( | ) | const |
Provide a 'getParent' method for ilist_node_with_parent methods. We mark it as a const function because ilist_node_with_parent specifically requires a 'getParent() const' method. Once ilist_node removes this constraint, we should drop the const to fit the rest of the MLIR const model.
Operation * Block::getParentOp | ( | ) |
Returns the closest surrounding operation that contains this block.
Returns the closest surrounding operation that contains this block or nullptr if this block is unlinked.
|
inline |
Block * Block::getSinglePredecessor | ( | ) |
If this block has exactly one predecessor, return it. Otherwise, return null.
Note that if a block has duplicate predecessors from a single block (e.g. if you have a conditional branch with the same block as the true/false destinations) is not considered to be a single predecessor.
If this block has exactly one predecessor, return it. Otherwise, return null.
Note that multiple edges from a single block (e.g. if you have a cond branch with the same block as the true/false destinations) is not considered to be a single predecessor.
|
inlinestatic |
Returns pointer to member of operation list.
Block * Block::getSuccessor | ( | unsigned | i | ) |
|
inline |
Operation * Block::getTerminator | ( | ) |
Get the terminator operation of this block. This function asserts that the block has a valid terminator operation.
bool Block::hasNoPredecessors | ( | ) |
Return true if this block has no predecessors.
BlockArgument Block::insertArgument | ( | args_iterator | it, |
Type | type | ||
) |
Insert one value to the position in the argument list indicated by the given iterator. The existing arguments are shifted. The block is expected not to have predecessors.
Insert one value to the given position of the argument list. The existing arguments are shifted. The block is expected not to have predecessors.
void Block::insertBefore | ( | Block * | block | ) |
Insert this block (which must not already be in a region) right before the specified block.
void Block::invalidateOpOrder | ( | ) |
Invalidates the current ordering of operations.
bool Block::isEntryBlock | ( | ) |
Return if this block is the entry block in the parent region.
bool Block::isOpOrderValid | ( | ) |
Returns true if the ordering of the child operations is valid, false otherwise.
void Block::moveBefore | ( | Block * | block | ) |
Unlink this block from its current region and insert it right before the specific block.
|
inline |
|
inline |
|
inline |
|
inline |
void Block::print | ( | raw_ostream & | os | ) |
void Block::printAsOperand | ( | raw_ostream & | os, |
bool | printType = true |
||
) |
Print out the name of the block without printing its body.
Print out the name of the block without printing its body. NOTE: The printType argument is ignored. We keep it for compatibility with LLVM dominator machinery that expects it to exist.
|
inline |
|
inline |
|
inline |
void Block::recomputeOpOrder | ( | ) |
Recomputes the ordering of child operations within the block.
|
inline |
Split the block into two blocks before the specified operation or iterator.
Note that all operations BEFORE the specified iterator stay as part of the original basic block, and the rest of the operations in the original block are moved to the new block, including the old terminator. The original block is left without a terminator.
The newly formed Block is returned, and the specified iterator is invalidated.
|
inline |
|
inline |
bool Block::verifyOpOrder | ( | ) |
Verifies the current ordering of child operations matches the validOpOrder flag. Returns false if the order is valid, true otherwise.
Verifies the current ordering of child operations. Returns false if the order is valid, true otherwise.
|
inline |
Walk the operations in this block in postorder, calling the callback for each operation. See Operation::walk for more details.
|
inline |
Walk the operations in the specified [begin, end) range of this block in postorder, calling the callback for each operation. This method is invoked for void return callbacks. See Operation::walk for more details.
|
inline |
Walk the operations in the specified [begin, end) range of this block in postorder, calling the callback for each operation. This method is invoked for interruptible callbacks. See Operation::walk for more details.
|
inline |
Return an iterator range over the operation within this block excluding the terminator operation at the end.
|
friend |