MLIR: mlir::Block Class Reference (original) (raw)
[Block](classmlir%5F1%5F1Block.html "Block represents an ordered list of Operations.")
represents an ordered list of [Operation](classmlir%5F1%5F1Operation.html "Operation is the basic unit of execution within MLIR.")
s. More...
#include "[mlir/IR/Block.h](Block%5F8h%5Fsource.html)"
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 |
template | |
using | op_iterator = detail::op_iterator< OpT, iterator > |
This class provides iteration over the held operations of a block for a specific operation type. More... | |
using | pred_iterator = PredecessorIterator |
using | succ_iterator = SuccessorRange::iterator |
![]() |
|
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 ()=default | |
~Block () | |
void | clear () |
Region * | getParent () const |
Provide a 'getParent' method for ilist_node_with_parent methods. More... | |
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) |
Insert this block (which must not already be in a region) right before the specified block. More... | |
void | insertAfter (Block *block) |
Insert this block (which must not already be in a region) right after the specified block. More... | |
void | moveBefore (Block *block) |
Unlink this block from its current region and insert it right before the specific block. More... | |
void | moveBefore (Region *region, llvm::iplist< Block >::iterator iterator) |
Unlink this block from its current region and insert it right before the block that the given iterator points to in the region region. More... | |
void | erase () |
Unlink this Block from its parent region and delete it. More... | |
BlockArgListType | getArguments () |
ValueTypeRange< BlockArgListType > | getArgumentTypes () |
Return a range containing the types of the arguments for this block. More... | |
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, Location loc) |
Add one value to the argument list. More... | |
BlockArgument | insertArgument (args_iterator it, Type type, Location loc) |
Insert one value to the position in the argument list indicated by the given iterator. More... | |
iterator_range< args_iterator > | addArguments (TypeRange types, ArrayRef< Location > locs) |
Add one argument to the argument list for each type specified in the list. More... | |
BlockArgument | insertArgument (unsigned index, Type type, Location loc) |
Add one value to the argument list at the specified position. More... | |
void | eraseArgument (unsigned index) |
Erase the argument at 'index' and remove it from the argument list. More... | |
void | eraseArguments (unsigned start, unsigned num) |
Erases 'num' arguments from the index 'start'. More... | |
void | eraseArguments (const BitVector &eraseIndices) |
Erases the arguments that have their corresponding bit set in eraseIndices and removes them from the argument list. More... | |
void | eraseArguments (function_ref< bool(BlockArgument)> shouldEraseFn) |
Erases arguments using the given predicate. More... | |
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) |
Returns 'op' if 'op' lies in this block, or otherwise finds the ancestor operation of 'op' that lies in this block. More... | |
void | 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. More... | |
void | dropAllDefinedValueUses () |
This drops all uses of values defined in this block or in the blocks of nested regions wherever the uses are located. More... | |
bool | isOpOrderValid () |
Returns true if the ordering of the child operations is valid, false otherwise. More... | |
void | invalidateOpOrder () |
Invalidates the current ordering of operations. More... | |
bool | verifyOpOrder () |
Verifies the current ordering of child operations matches the validOpOrder flag. More... | |
void | recomputeOpOrder () |
Recomputes the ordering of child operations within the block. More... | |
template | |
iterator_range< op_iterator< OpT > > | getOps () |
Return an iterator range over the operations within this block that are of 'OpT'. More... | |
template | |
op_iterator< OpT > | op_begin () |
template | |
op_iterator< OpT > | op_end () |
iterator_range< iterator > | without_terminator () |
Return an iterator range over the operation within this block excluding the terminator operation at the end. More... | |
Operation * | getTerminator () |
Get the terminator operation of this block. More... | |
bool | mightHaveTerminator () |
Check whether this block might have a terminator. More... | |
pred_iterator | pred_begin () |
pred_iterator | pred_end () |
iterator_range< pred_iterator > | getPredecessors () |
bool | hasNoPredecessors () |
Return true if this block has no predecessors. More... | |
bool | hasNoSuccessors () |
Returns true if this blocks has no successors. More... | |
Block * | getSinglePredecessor () |
If this block has exactly one predecessor, return it. More... | |
Block * | getUniquePredecessor () |
If this block has a unique predecessor, i.e., all incoming edges originate from one block, return it. More... | |
unsigned | getNumSuccessors () |
Block * | getSuccessor (unsigned i) |
succ_iterator | succ_begin () |
succ_iterator | succ_end () |
SuccessorRange | getSuccessors () |
bool | isReachable (Block *other, SmallPtrSet< Block *, 16 > &&except={}) |
Return "true" if there is a path from this block to the given block (according to the successors relationship). More... | |
template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, typename FnT , typename ArgT = detail::first_argument, typename RetT = detail::walkResultType> | |
RetT | walk (FnT &&callback) |
Walk all nested operations, blocks (including this block) or regions, depending on the type of callback. More... | |
template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, typename FnT , typename RetT = detail::walkResultType> | |
RetT | walk (Block::iterator begin, Block::iterator end, FnT &&callback) |
Walk all nested operations, blocks (excluding this block) or regions, depending on the type of callback, in the specified [begin, end) range of this block. More... | |
Block * | splitBlock (iterator splitBefore) |
Split the block into two blocks before the specified operation or iterator. More... | |
Block * | splitBlock (Operation *splitBeforeOp) |
void | print (raw_ostream &os) |
void | print (raw_ostream &os, AsmState &state) |
void | dump () |
void | printAsOperand (raw_ostream &os, bool printType=true) |
Print out the name of the block without printing its body. More... | |
void | printAsOperand (raw_ostream &os, AsmState &state) |
![]() |
|
~IRObjectWithUseList () | |
void | dropAllUses () |
Drop all uses of this object from their respective owners. More... | |
void | replaceAllUsesWith (ValueT &&newValue) |
Replace all uses of 'this' value with the new value, updating anything in the IR that uses 'this' to use the other value instead. More... | |
void | shuffleUseList (ArrayRef< unsigned > indices) |
Shuffle the use-list chain according to the provided indices vector, which need to represent a valid shuffle. More... | |
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... | |
Additional Inherited Members | |
---|---|
![]() |
|
IRObjectWithUseList ()=default | |
BlockOperand * | getFirstUse () const |
Return the first operand that is using this value, for use by custom use/def iterators. More... | |
[Block](classmlir%5F1%5F1Block.html "Block represents an ordered list of Operations.")
represents an ordered list of [Operation](classmlir%5F1%5F1Operation.html "Operation is the basic unit of execution within MLIR.")
s.
Definition at line 32 of file Block.h.
◆ args_iterator
◆ BlockArgListType
◆ iterator
◆ op_iterator
This class provides iteration over the held operations of a block for a specific operation type.
Definition at line 188 of file Block.h.
◆ OpListType
This is the list of operations in the block.
Definition at line 136 of file Block.h.
◆ pred_iterator
◆ reverse_args_iterator
◆ reverse_iterator
◆ succ_iterator
mlir::Block::Block ( ) | explicitdefault |
---|
◆ ~Block()
◆ addArgument()
◆ addArguments()
◆ args_begin()
◆ args_empty()
bool mlir::Block::args_empty ( ) | inline |
---|
◆ args_end()
◆ args_rbegin()
◆ args_rend()
◆ back()
Definition at line 152 of file Block.h.
Referenced by addAtomicRMW(), mlir::LLVMTypeConverter::convertType(), ensureDistinctSuccessors(), mlir::impl::ensureRegionTerminator(), getEffectsAfterInBlock(), getNumSuccessors(), getTerminator(), mlir::spirv::hasOneBranchOpTo(), inlineConvertOmpRegions(), insertCopies(), isaElemwiseSingleUnaryOrBinaryOpInterface(), mlir::linalg::detail::isContractionBody(), mlir::isNotBranchOpInterfaceOrReturnLikeOp(), matchSelectReduction(), matchSimpleReduction(), mightHaveTerminator(), mlirBlockGetTerminator(), mlir::sortTopologically(), mlir::RewriterBase::splitBlock(), mlir::SuccessorRange::SuccessorRange(), verifyAndGetTerminator(), mlir::OpTrait::impl::verifyIsTerminator(), verifyRegion(), mlir::OpTrait::SingleBlockImplicitTerminator< TerminatorOpType >::Impl< ConcreteType >::verifyRegionTrait(), and mlir::JamBlockGatherer< OpTy >::walk().
◆ begin()
Definition at line 143 of file Block.h.
Referenced by mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), mlir::OpBuilder::atBlockBegin(), mlir::ImplicitLocOpBuilder::atBlockBegin(), mlir::OpTrait::SingleBlock< ConcreteType >::begin(), collapseBranch(), computeInsertPoint(), mlir::detail::constructContainerOpForParserIfNecessary(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), mlir::LLVMTypeConverter::convertType(), findHighestBlockForPlacement(), findInstPosition(), mlir::detail::DominanceInfoBase< IsPostDom >::findNearestCommonDominator(), fuseIfLegal(), generateCopy(), generateUnrolledLoop(), getDominanceFilterForPrivateMemRefRepl(), getMemoryFootprintBytes(), getOps(), mlir::affine::getPerfectlyNestedLoops(), getPerfectlyNestedLoopsImpl(), mlir::DataFlowSolver::getProgramPointBefore(), handleInlinedAllocas(), mlir::ProgramPoint::isBlockStart(), matchSelectReduction(), matchSimpleReduction(), mlirBlockInsertOwnedOperationAfter(), op_begin(), mlir::affine::permuteLoops(), promoteIfBlock(), mlir::DominanceInfo::properlyDominates(), rewriteOneForallCommonImpl(), mlir::OpBuilder::setInsertionPointToStart(), mlir::RewriterBase::splitBlock(), mlir::JamBlockGatherer< OpTy >::walk(), walk(), and without_terminator().
◆ clear()
void mlir::Block::clear ( ) | inline |
---|
◆ dropAllDefinedValueUses()
void Block::dropAllDefinedValueUses | ( | ) |
---|
◆ dropAllReferences()
void Block::dropAllReferences | ( | ) |
---|
◆ dump()
◆ empty()
bool mlir::Block::empty ( ) | inline |
---|
Definition at line 148 of file Block.h.
Referenced by mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), clear(), mlir::LLVMTypeConverter::convertType(), ensureDistinctSuccessors(), mlir::impl::ensureRegionTerminator(), mlir::detail::ConversionPatternRewriterImpl::SingleEraseRewriter::eraseBlock(), getNumSuccessors(), mlir::RewriterBase::inlineBlockBefore(), mlir::ConversionPatternRewriter::inlineBlockBefore(), insertArgument(), mlir::linalg::detail::isContractionBody(), matchSelectReduction(), matchSimpleReduction(), mightHaveTerminator(), mlirBlockGetFirstOperation(), mlirBlockGetTerminator(), populateOpPayload(), mlir::sortTopologically(), mlir::SuccessorRange::SuccessorRange(), verifyAndGetTerminator(), mlir::OpTrait::SingleBlock< ConcreteType >::verifyTrait(), and mlir::JamBlockGatherer< OpTy >::walk().
◆ end()
Definition at line 144 of file Block.h.
Referenced by mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), mlir::OpBuilder::atBlockEnd(), mlir::ImplicitLocOpBuilder::atBlockEnd(), collapseBranch(), mlir::LLVMTypeConverter::convertType(), mlir::OpTrait::SingleBlock< ConcreteType >::end(), generateUnrolledLoop(), getOps(), mlir::affine::getPerfectlyNestedLoops(), getPerfectlyNestedLoopsImpl(), mlir::DataFlowSolver::getProgramPointAfter(), mlir::affine::hasNoInterveningEffect(), mlir::RewriterBase::inlineBlockBefore(), isBeforeInBlock(), mlir::ProgramPoint::isBlockEnd(), matchSelectReduction(), matchSimpleReduction(), mlir::RewriterBase::mergeBlocks(), mlir::transform::detail::mergeSymbolsInto(), mlir::Operation::moveAfter(), mlir::RewriterBase::moveOpAfter(), mlir::detail::ConversionPatternRewriterImpl::notifyOperationInserted(), op_begin(), op_end(), mlir::affine::permuteLoops(), promoteIfBlock(), mlir::PostDominanceInfo::properlyPostDominates(), mlir::affine::separateFullTiles(), mlir::OpBuilder::setInsertionPointToEnd(), mlir::RewriterBase::splitBlock(), splitBlock(), transformToStructuredCFBranches(), mlir::JamBlockGatherer< OpTy >::walk(), walk(), and without_terminator().
◆ erase()
◆ eraseArgument()
void Block::eraseArgument | ( | unsigned | index | ) |
---|
◆ eraseArguments() [1/3]
void Block::eraseArguments | ( | const BitVector & | eraseIndices | ) |
---|
◆ eraseArguments() [2/3]
Erases arguments using the given predicate.
If the predicate returns true, that argument is erased.
Definition at line 217 of file Block.cpp.
◆ eraseArguments() [3/3]
void Block::eraseArguments | ( | unsigned | start, |
---|---|---|---|
unsigned | num | ||
) |
◆ findAncestorOpInBlock()
◆ front()
Definition at line 153 of file Block.h.
Referenced by mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), areBinOpsSwapped(), checkTransformationPreconditions(), cloneToCollapsedOp< GenericOp >(), mlir::detail::constructContainerOpForParserIfNecessary(), mlir::lsp::MLIRServer::convertFromBytecode(), mlir::LLVMTypeConverter::convertType(), mlir::sparse_tensor::LoopEmitter::enterCoIterationOverTensorsAtLvls(), mlir::function_interface_impl::eraseFunctionArguments(), fuseIfLegal(), generateFusedElementwiseOpRegion(), getEffectsAfter(), getEffectsBeforeInBlock(), llvm::GraphTraits< Inverse< mlir::Region * > >::getEntryNode(), mlir::affine::getPerfectlyNestedLoops(), getPerfectlyNestedLoopsImpl(), mlir::RewriterBase::inlineBlockBefore(), mlir::ConversionPatternRewriter::inlineBlockBefore(), inlineOmpRegionCleanup(), mlir::function_interface_impl::insertFunctionArguments(), mlir::OperationFolder::insertKnownConstant(), isaElemwiseSingleUnaryOrBinaryOpInterface(), mlir::spirv::isMergeBlock(), AllocaScopeInliner::matchAndRewrite(), mlir::linalg::RegionMatcher::matchAsScalarBinaryOp(), matchSelectReduction(), matchSimpleReduction(), mlirBlockGetFirstOperation(), populateOpPayload(), ProfileInfoDepot::populateProfileInfo(), mlir::scf::replaceAndCastForOpIterArg(), rewriteOneForallCommonImpl(), setupCoroMachinery(), transformCyclesToSCFLoops(), transformToStructuredCFBranches(), mlir::OperationFolder::tryToFold(), mlir::linalg::detail::verifyStructuredOpInterface(), and mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::visitCallableOperation().
◆ getArgument()
Definition at line 129 of file Block.h.
Referenced by addAtomicRMW(), mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), areBinOpsSwapped(), convertForOp(), createAsyncDispatchFunction(), createElementFPowIFunc(), eraseTerminatorSuccessorOperands(), findPayloadOp(), generateFusedElementwiseOpRegion(), mlir::detail::getBranchSuccessorArgument(), injectGpuIndexOperations(), inlineOmpRegionCleanup(), mlir::linalg::detail::isContractionBody(), legalizeBlockArguments(), mlir::linalg::RegionMatcher::matchAsScalarBinaryOp(), outlineKernelFuncImpl(), populateOpPayload(), propagateTerminatorLiveness(), pruneRedundantArguments(), mlir::detail::verifyBranchSuccessorOperands(), verifyInitLikeSingleArgRegion(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), mlir::linalg::detail::verifyStructuredOpInterface(), and mlir::transform::detail::verifyStructuredOpPredicateOpTrait().
◆ getArguments()
Definition at line 87 of file Block.h.
Referenced by addBlockArgumentsFromOther(), addBodyWithPayloadOp(), mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), args_begin(), args_end(), args_rbegin(), args_rend(), buildGenericRegion(), buildQuantifier(), mlir::Region::cloneInto(), cloneToCollapsedOp< GenericOp >(), collapseBranch(), createAsyncDispatchFunction(), createBinarySearchFunc(), createHeapSortFunc(), createPartitionFunc(), createQuickSortFunc(), createShiftDownFunc(), createSingleExitBranchRegion(), createSingleExitingLatch(), createSortStableFunc(), mlir::ControlFlowToSCFTransformation::createStructuredDoWhileLoopOp(), dropAllDefinedValueUses(), dropRedundantArguments(), ensureDistinctSuccessors(), findPayloadOp(), fuseIfLegal(), mlir::sparse_tensor::FuncCallOrInlineGenerator< SubClass >::genCallOrInline(), genCoIterateBranchNest(), mlir::sparse_tensor::genCoIteration(), generateFusedElementwiseOpRegion(), genLoopWithIterator(), mlir::Region::getArguments(), mlir::RewriterBase::inlineBlockBefore(), mlir::ConversionPatternRewriter::inlineBlockBefore(), inlineIfCase(), inlinePayload(), inlineWhileCase(), mlir::OperationEquivalence::isRegionEquivalentTo(), mlir::makeRegionIsolatedFromAbove(), matchSelectReduction(), matchSimpleReduction(), mergeIdenticalBlocks(), mlir::outlineSingleBlockRegion(), printLoopControl(), printOperation(), pruneRedundantArguments(), remapArgumentEffects(), mlir::scf::replaceAndCastForOpIterArg(), rewrite(), mlir::mesh::shardedBlockArgumentTypes(), mlir::mesh::spmdizeBlock(), transformCyclesToSCFLoops(), transformToReduceLoop(), transformToStructuredCFBranches(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), and walkReferenceCountedValues().
◆ getArgumentTypes()
auto Block::getArgumentTypes | ( | ) |
---|
◆ getNumArguments()
unsigned mlir::Block::getNumArguments ( ) | inline |
---|
Definition at line 128 of file Block.h.
Referenced by mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), mlir::TypeConverter::convertBlockSignature(), createSingleExitingLatch(), ensureDistinctSuccessors(), findPayloadOp(), generateFusedElementwiseOpRegion(), mlir::RewriterBase::inlineBlockBefore(), mlir::ConversionPatternRewriter::inlineBlockBefore(), inlineIfCase(), mlir::linalg::detail::isContractionBody(), mlir::OperationEquivalence::isRegionEquivalentTo(), legalizeBlockArguments(), mlir::makeRegionIsolatedFromAbove(), mapInitializationArgs(), mlir::linalg::RegionMatcher::matchAsScalarBinaryOp(), matchSimpleReduction(), mlir::outlineSingleBlockRegion(), populateOpPayload(), transformToReduceLoop(), transformToStructuredCFBranches(), mlir::detail::verifyBranchSuccessorOperands(), verifyInitLikeSingleArgRegion(), mlir::transform::detail::verifyPossibleTopLevelTransformOpTrait(), mlir::linalg::detail::verifyStructuredOpInterface(), and mlir::transform::detail::verifyStructuredOpPredicateOpTrait().
◆ getNumSuccessors()
unsigned Block::getNumSuccessors | ( | ) |
---|
◆ getOperations()
Definition at line 137 of file Block.h.
Referenced by mlir::affine::affineParallelize(), mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), mlir::detail::constructContainerOpForParserIfNecessary(), constructTiledLoopNest(), mlir::LLVMTypeConverter::convertType(), findPayloadOp(), getPhiIncomingBlock(), hoistAffineIfOp(), mlir::RewriterBase::inlineBlockBefore(), mlir::ConversionPatternRewriter::inlineBlockBefore(), mlir::OpTrait::SingleBlock< ConcreteType >::insert(), mlir::OpBuilder::insert(), isaElemwiseSingleUnaryOrBinaryOpInterface(), mlir::linalg::RegionMatcher::matchAsScalarBinaryOp(), mlirBlockInsertOwnedOperationAfter(), mlir::Operation::moveBefore(), outlineKernelFuncImpl(), mlir::affine::permuteLoops(), processParallelLoop(), promoteIfBlock(), rewriteOneForallCommonImpl(), ShardingPropagation::runOnOperation(), mlir::affine::separateFullTiles(), setupCoroMachinery(), splitBlock(), mlir::mesh::spmdizeBlock(), transformCyclesToSCFLoops(), and transformToStructuredCFBranches().
◆ getOps()
◆ getParent()
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.
Definition at line 29 of file Block.cpp.
Referenced by llvm::ilist_traits<::mlir::Block >::addNodeToList(), mlir::affine::affineDataCopyGenerate(), mlir::detail::ConversionPatternRewriterImpl::applySignatureConversion(), mlir::sparse_tensor::Merger::buildExp(), mlir::OpBuilder::cloneRegionBefore(), collectUnderlyingAddressValues(), mlir::LLVMTypeConverter::convertType(), mlir::FunctionCallBuilder::create(), mlir::OpBuilder::createBlock(), createElementFPowIFunc(), createElementIPowIFunc(), diagnoseInvalidOperandDominance(), ensureDistinctSuccessors(), erase(), mlir::ConversionPatternRewriter::eraseBlock(), mlir::Region::findAncestorBlockInRegion(), mlir::detail::DominanceInfoBase< IsPostDom >::findNearestCommonDominator(), genCoIterateBranchNest(), generateCopy(), getBlockNumber(), getEffectsAfter(), getEffectsBefore(), mlir::bufferization::AnalysisState::getEnclosingRepetitiveRegion(), getInsertionRegion(), mlir::LatticeAnchor::getLoc(), mlir::dataflow::CFGEdge::getLoc(), mlir::detail::DominanceInfoBase< IsPostDom >::getNode(), getParentOp(), mlir::Operation::getParentRegion(), mlir::detail::DominanceInfoBase< IsPostDom >::hasSSADominance(), mlir::ReductionNode::initialize(), mlir::RewriterBase::inlineRegionBefore(), insertAfter(), insertBefore(), isEntryBlock(), isReachable(), mlir::detail::DominanceInfoBase< IsPostDom >::isReachableFromEntry(), mayBeValidWithoutTerminator(), mlirBlockDetach(), moveBefore(), mlir::RewriterBase::moveBlockBefore(), printBlock(), mlir::detail::DominanceInfoBase< IsPostDom >::properlyDominatesImpl(), llvm::ilist_traits<::mlir::Block >::removeNodeFromList(), mlir::RewriterBase::splitBlock(), splitBlock(), mlir::mesh::spmdizeBlock(), mlir::SuccessorRange::SuccessorRange(), mlir::transformCFGToSCF(), transformCyclesToSCFLoops(), transformToReduceLoop(), transformToStructuredCFBranches(), tryGetBlocksInSameRegion(), and mlir::dataflow::AbstractDenseForwardDataFlowAnalysis::visitRegionBranchOperation().
◆ 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.
Definition at line 33 of file Block.cpp.
References getParent(), and mlir::Region::getParentOp().
Referenced by mlir::ConversionPatternRewriter::applySignatureConversion(), buildPackingLoopNestImpl(), checkAndNestUnderRewriteOp(), mlir::sparse_tensor::createFuncCall(), mlir::LLVM::createGlobalString(), diagnoseInvalidOperandDominance(), emitRemarkForBlock(), mlir::ConversionPatternRewriter::eraseBlock(), finalizeWhileOp(), mlir::Region::findAncestorBlockInRegion(), findInstPosition(), getAncestorBlock(), getBackwardSliceImpl(), getCommonBlockInAffineScope(), mlir::getControlFlowPredecessors(), mlir::Operation::getParentOp(), getParentsOfType(), getPhiIncomingBlock(), hoistSubsetAtIterArg(), mlir::ConversionPatternRewriter::inlineBlockBefore(), isFnEntryBlock(), isFunctionArgument(), mayBeValidWithoutTerminator(), mlir::detail::ConversionPatternRewriterImpl::notifyBlockInserted(), mlir::spirv::Serializer::printValueIDMap(), removeBufferizationAttributes(), mlir::RewriterBase::replaceOpUsesWithinBlock(), mlir::ConversionPatternRewriter::replaceUsesOfBlockArgument(), sameOrEquivalentIterArg(), transformToReduceLoop(), and tryToEnforceAlignment().
◆ getPredecessors()
◆ getSinglePredecessor()
Block * Block::getSinglePredecessor | ( | ) |
---|
◆ getSublistAccess()
Returns pointer to member of operation list.
Definition at line 390 of file Block.h.
◆ getSuccessor()
Block * Block::getSuccessor | ( | unsigned | i | ) |
---|
◆ getSuccessors()
◆ getTerminator()
Get the terminator operation of this block.
This function asserts that the block might have a valid terminator operation.
Definition at line 246 of file Block.cpp.
References back(), and mightHaveTerminator().
Referenced by mlir::OpBuilder::atBlockTerminator(), mlir::ImplicitLocOpBuilder::atBlockTerminator(), mlir::sparse_tensor::Merger::buildLattices(), mlir::sparse_tensor::Merger::buildTensorExpFromLinalg(), collapseBranch(), containsReturn(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), createSingleExitBlocksForReturnLike(), ensureDistinctSuccessors(), fuseIfLegal(), generateFusedElementwiseOpRegion(), generateUnrolledLoop(), getBlockPredecessorOperands(), getEffectsBefore(), getMutableSuccessorOperands(), getPHISourceValue(), mlir::bufferization::BufferPlacementAllocs::getStartOperation(), getSuccessor(), mlir::affine::hasNoInterveningEffect(), inlineIfCase(), inlinePayload(), inlineWhileCase(), mlir::sparse_tensor::insertYieldOp(), mlir::sparse_tensor::isAdmissibleBranch(), mlir::linalg::detail::isContractionBody(), isRegionOrCallableReturn(), lastNonTerminatorInRegion(), AllocaScopeInliner::matchAndRewrite(), outlineKernelFuncImpl(), mlir::outlineSingleBlockRegion(), populateOpPayload(), ProfileInfoDepot::populateProfileInfo(), processParallelLoop(), mlir::scf::replaceAndCastForOpIterArg(), replaceOpWithRegion(), simplifySwitchFromDefaultSwitchOnSameCondition(), simplifySwitchFromSwitchOnSameCondition(), mlir::scf::tileAndFuseConsumerOfSlice(), transformCyclesToSCFLoops(), transformToStructuredCFBranches(), verifyNumBlockArgs(), verifyQuantifierRegions(), and mlir::scf::yieldReplacementForFusedProducer().
◆ getUniquePredecessor()
Block * Block::getUniquePredecessor | ( | ) |
---|
If this block has a unique predecessor, i.e., all incoming edges originate from one block, return it.
Otherwise, return null.
Definition at line 283 of file Block.cpp.
References pred_begin(), and pred_end().
◆ hasNoPredecessors()
bool mlir::Block::hasNoPredecessors ( ) | inline |
---|
◆ hasNoSuccessors()
bool mlir::Block::hasNoSuccessors ( ) | inline |
---|
◆ insertAfter()
void Block::insertAfter | ( | Block * | block | ) |
---|
◆ insertArgument() [1/2]
◆ insertArgument() [2/2]
Add one value to the argument list at the specified position.
Definition at line 174 of file Block.cpp.
◆ insertBefore()
void Block::insertBefore | ( | Block * | block | ) |
---|
◆ invalidateOpOrder()
void Block::invalidateOpOrder | ( | ) |
---|
◆ isEntryBlock()
bool Block::isEntryBlock | ( | ) |
---|
◆ isOpOrderValid()
bool Block::isOpOrderValid | ( | ) |
---|
◆ isReachable()
Return "true" if there is a path from this block to the given block (according to the successors relationship).
Both blocks must be in the same region. Paths that contain a block from except
do not count. This function returns "false" if other
is in except
.
Note: This function performs a block graph traversal and its complexity linear in the number of blocks in the parent region.
Note: Reachability is a necessary but insufficient condition for dominance. Do not use this function in places where you need to check for dominance.
Definition at line 355 of file Block.cpp.
References getParent(), succ_begin(), and succ_end().
◆ mightHaveTerminator()
bool Block::mightHaveTerminator | ( | ) |
---|
◆ moveBefore() [1/2]
void Block::moveBefore | ( | Block * | block | ) |
---|
◆ moveBefore() [2/2]
◆ op_begin()
◆ op_end()
◆ pred_begin()
Definition at line 233 of file Block.h.
References mlir::IRObjectWithUseList< BlockOperand >::getFirstUse().
Referenced by ableToUpdatePredOperands(), buildBlockMapping(), calculateCycleEdges(), llvm::GraphTraits< Inverse< mlir::Block * > >::child_begin(), collectUnderlyingAddressValues(), dropRedundantArguments(), getBlockPredecessorOperands(), getPredecessors(), getSinglePredecessor(), getUniquePredecessor(), hasNoPredecessors(), transformToReduceLoop(), and transformToStructuredCFBranches().
◆ pred_end()
Definition at line 236 of file Block.h.
Referenced by ableToUpdatePredOperands(), buildBlockMapping(), calculateCycleEdges(), llvm::GraphTraits< Inverse< mlir::Block * > >::child_end(), collectUnderlyingAddressValues(), dropRedundantArguments(), getBlockPredecessorOperands(), getPredecessors(), getSinglePredecessor(), getUniquePredecessor(), hasNoPredecessors(), transformToReduceLoop(), and transformToStructuredCFBranches().
◆ print() [1/2]
void Block::print | ( | raw_ostream & | os | ) |
---|
◆ print() [2/2]
void Block::print | ( | raw_ostream & | os, |
---|---|---|---|
AsmState & | state | ||
) |
◆ printAsOperand() [1/2]
void Block::printAsOperand | ( | raw_ostream & | os, |
---|---|---|---|
AsmState & | state | ||
) |
◆ printAsOperand() [2/2]
void Block::printAsOperand | ( | raw_ostream & | os, |
---|---|---|---|
bool | printType = true | ||
) |
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.
Definition at line 4141 of file AsmPrinter.cpp.
◆ push_back()
void mlir::Block::push_back ( Operation * op) | inline |
---|
◆ push_front()
void mlir::Block::push_front ( Operation * op) | inline |
---|
◆ rbegin()
◆ recomputeOpOrder()
void Block::recomputeOpOrder | ( | ) |
---|
◆ rend()
◆ splitBlock() [1/2]
◆ splitBlock() [2/2]
◆ succ_begin()
◆ succ_end()
◆ verifyOpOrder()
bool Block::verifyOpOrder | ( | ) |
---|
Verifies the current ordering of child operations matches the validOpOrder flag.
Verifies the current ordering of child operations.
Returns false if the order is valid, true otherwise.
Definition at line 117 of file Block.cpp.
References isOpOrderValid().
Referenced by invalidateOpOrder(), and ~Block().
◆ walk() [1/2]
template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, typename FnT , typename RetT = detail::walkResultType>
Walk all nested operations, blocks (excluding this block) or regions, depending on the type of callback, in the specified [begin, end) range of this block.
The order in which operations, blocks or regions at the same nesting level are visited (e.g., lexicographical or reverse lexicographical order) is determined by Iterator
. The walk order for enclosing operations, blocks or regions with respect to their nested ones is specified by Order
(post-order by default).
A callback on a operation or block is allowed to erase that operation or block if either:
- the walk is in post-order, or
- the walk is in pre-order and the walk is skipped after the erasure.
See Operation::walk for more details.
Definition at line 357 of file Block.h.
References mlir::WalkResult::advance(), begin(), end(), and mlir::WalkResult::interrupt().
◆ walk() [2/2]
template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, typename FnT , typename ArgT = detail::first_argument, typename RetT = detail::walkResultType>
RetT mlir::Block::walk ( FnT && callback) | inline |
---|
Walk all nested operations, blocks (including this block) or regions, depending on the type of callback.
The order in which operations, blocks or regions at the same nesting level are visited (e.g., lexicographical or reverse lexicographical order) is determined by Iterator
. The walk order for enclosing operations, blocks or regions with respect to their nested ones is specified by Order
(post-order by default).
A callback on a operation or block is allowed to erase that operation or block if either:
- the walk is in post-order, or
- the walk is in pre-order and the walk is skipped after the erasure.
See Operation::walk for more details.
Definition at line 305 of file Block.h.
References mlir::WalkResult::advance(), begin(), end(), mlir::WalkResult::interrupt(), mlir::PostOrder, and mlir::PreOrder.
Referenced by mlir::affine::affineDataCopyGenerate(), emit(), getMemoryFootprintBytes(), and getSingleOpOfType().
◆ without_terminator()
◆ llvm::ilist_traits< Block >
The documentation for this class was generated from the following files:
- include/mlir/IR/Block.h
- lib/IR/AsmPrinter.cpp
- lib/IR/Block.cpp