13 #ifndef MLIR_INTERFACES_LOOPLIKEINTERFACE_H_
14 #define MLIR_INTERFACES_LOOPLIKEINTERFACE_H_
42 template <
typename ConcreteType>
55 template <
typename OpTy>
63 for (
Block &block : region)
69 "expected block to have a terminator");
73 while (it != e && !isa<OpTy>(&*it))
75 if (it != subBlockStart)
76 subBlocks.emplace_back(subBlockStart, std::prev(it));
78 while (it != e && isa<OpTy>(&*it))
91 #include "mlir/Interfaces/LoopLikeInterface.h.inc"
Block represents an ordered list of Operations.
OpListType::iterator iterator
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
This class helps build Operations.
static LogicalResult verifyTrait(Operation *op)
This class provides the API for ops that are known to be terminators.
Helper class for implementing traits.
Operation is the basic unit of execution within MLIR.
bool hasTrait()
Returns true if the operation was registered with a particular trait, e.g.
MutableArrayRef< Region > getRegions()
Returns the regions held by this operation.
This class contains a list of basic blocks and a link to the parent operation it is attached to.
LogicalResult verifyOneRegion(Operation *op)
LogicalResult verifyLoopLikeOpInterface(Operation *op)
Verify invariants of the LoopLikeOpInterface.
Include the generated interface declarations.
std::function< SmallVector< Value >(OpBuilder &b, Location loc, ArrayRef< BlockArgument > newBbArgs)> NewYieldValuesFn
A function that returns the additional yielded values during replaceWithAdditionalYields.
SmallVector< std::pair< Block::iterator, Block::iterator > > subBlocks