My Project
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mlir::Region Class Reference

#include <Region.h>

Public Types

using BlockListType = llvm::iplist< Block >
 
using iterator = BlockListType::iterator
 
using reverse_iterator = BlockListType::reverse_iterator
 

Public Member Functions

 Region ()=default
 
 Region (Operation *container)
 
 ~Region ()
 
MLIRContextgetContext ()
 
Location getLoc ()
 
BlockListTypegetBlocks ()
 
iterator begin ()
 
iterator end ()
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
bool empty ()
 
void push_back (Block *block)
 
void push_front (Block *block)
 
Blockback ()
 
Blockfront ()
 
RegiongetParentRegion ()
 
OperationgetParentOp ()
 Return the parent operation this region is attached to. More...
 
template<typename ParentT >
ParentT getParentOfType ()
 
unsigned getRegionNumber ()
 Return the number of this region in the parent operation. More...
 
bool isProperAncestor (Region *other)
 Return true if this region is a proper ancestor of the other region. More...
 
bool isAncestor (Region *other)
 
void cloneInto (Region *dest, BlockAndValueMapping &mapper)
 
void cloneInto (Region *dest, Region::iterator destPos, BlockAndValueMapping &mapper)
 Clone this region into 'dest' before the given position in 'dest'. More...
 
void takeBody (Region &other)
 
bool isIsolatedFromAbove (Optional< Location > noteLoc=llvm::None)
 
void dropAllReferences ()
 
template<typename FnT , typename RetT = detail::walkResultType<FnT>>
std::enable_if< std::is_same< RetT, void >::value, RetT >::type walk (FnT &&callback)
 
template<typename FnT , typename RetT = detail::walkResultType<FnT>>
std::enable_if< std::is_same< RetT, WalkResult >::value, RetT >::type walk (FnT &&callback)
 
void viewGraph (const Twine &regionName)
 
void viewGraph ()
 

Static Public Member Functions

static BlockListType Region::* getSublistAccess (Block *)
 getSublistAccess() - Returns pointer to member of region. More...
 

Detailed Description

This class contains a list of basic blocks and a link to the parent operation it is attached to.

Member Typedef Documentation

◆ BlockListType

using mlir::Region::BlockListType = llvm::iplist<Block>

◆ iterator

using mlir::Region::iterator = BlockListType::iterator

◆ reverse_iterator

using mlir::Region::reverse_iterator = BlockListType::reverse_iterator

Constructor & Destructor Documentation

◆ Region() [1/2]

mlir::Region::Region ( )
default

◆ Region() [2/2]

Region::Region ( Operation container)
explicit

◆ ~Region()

Region::~Region ( )

Member Function Documentation

◆ back()

Block& mlir::Region::back ( )
inline

◆ begin()

iterator mlir::Region::begin ( )
inline

◆ cloneInto() [1/2]

void Region::cloneInto ( Region dest,
BlockAndValueMapping mapper 
)

Clone the internal blocks from this region into dest. Any cloned blocks are appended to the back of dest. If the mapper contains entries for block arguments, these arguments are not included in the respective cloned block.

Clone the internal blocks from this region into dest. Any cloned blocks are appended to the back of dest.

◆ cloneInto() [2/2]

void Region::cloneInto ( Region dest,
Region::iterator  destPos,
BlockAndValueMapping mapper 
)

Clone this region into 'dest' before the given position in 'dest'.

◆ dropAllReferences()

void Region::dropAllReferences ( )

Drop all operand uses from operations within this region, which is an essential step in breaking cyclic dependences between references when they are to be deleted.

◆ empty()

bool mlir::Region::empty ( )
inline

◆ end()

iterator mlir::Region::end ( )
inline

◆ front()

Block& mlir::Region::front ( )
inline

◆ getBlocks()

BlockListType& mlir::Region::getBlocks ( )
inline

◆ getContext()

MLIRContext * Region::getContext ( )

Return the context this region is inserted in. The region must have a valid parent container.

◆ getLoc()

Location Region::getLoc ( )

Return a location for this region. This is the location attached to the parent container. The region must have a valid parent container.

◆ getParentOfType()

template<typename ParentT >
ParentT mlir::Region::getParentOfType ( )
inline

Find the first parent operation of the given type, or nullptr if there is no ancestor operation.

◆ getParentOp()

Operation * Region::getParentOp ( )

Return the parent operation this region is attached to.

◆ getParentRegion()

Region * Region::getParentRegion ( )

Return the region containing this region or nullptr if the region is attached to a top-level operation.

◆ getRegionNumber()

unsigned Region::getRegionNumber ( )

Return the number of this region in the parent operation.

◆ getSublistAccess()

static BlockListType Region::* mlir::Region::getSublistAccess ( Block )
inlinestatic

getSublistAccess() - Returns pointer to member of region.

◆ isAncestor()

bool mlir::Region::isAncestor ( Region other)
inline

Return true if this region is ancestor of the other region. A region is considered as its own ancestor, use isProperAncestor to avoid this.

◆ isIsolatedFromAbove()

bool Region::isIsolatedFromAbove ( Optional< Location noteLoc = llvm::None)

Check that this does not use any value defined outside it. Emit errors if noteLoc is provided; this location is used to point to the operation containing the region, the actual error is reported at the operation with an offending use.

◆ isProperAncestor()

bool Region::isProperAncestor ( Region other)

Return true if this region is a proper ancestor of the other region.

◆ push_back()

void mlir::Region::push_back ( Block block)
inline

◆ push_front()

void mlir::Region::push_front ( Block block)
inline

◆ rbegin()

reverse_iterator mlir::Region::rbegin ( )
inline

◆ rend()

reverse_iterator mlir::Region::rend ( )
inline

◆ takeBody()

void mlir::Region::takeBody ( Region other)
inline

Takes body of another region (that region will have no body after this operation completes). The current body of this region is cleared.

◆ viewGraph() [1/2]

void mlir::Region::viewGraph ( const Twine &  regionName)

Displays the CFG in a window. This is for use from the debugger and depends on Graphviz to generate the graph. This function is defined in ViewRegionGraph and only works with that target linked.

◆ viewGraph() [2/2]

void mlir::Region::viewGraph ( )

◆ walk() [1/2]

template<typename FnT , typename RetT = detail::walkResultType<FnT>>
std::enable_if<std::is_same<RetT, void>::value, RetT>::type mlir::Region::walk ( FnT &&  callback)
inline

Walk the operations in this region in postorder, calling the callback for each operation. This method is invoked for void-returning callbacks. See Operation::walk for more details.

◆ walk() [2/2]

template<typename FnT , typename RetT = detail::walkResultType<FnT>>
std::enable_if<std::is_same<RetT, WalkResult>::value, RetT>::type mlir::Region::walk ( FnT &&  callback)
inline

Walk the operations in this region in postorder, calling the callback for each operation. This method is invoked for interruptible callbacks. See Operation::walk for more details.


The documentation for this class was generated from the following files: