Jlm
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
jlm::rvsdg::Region Class Reference

Represent acyclic RVSDG subgraphs. More...

#include <region.hpp>

Collaboration diagram for jlm::rvsdg::Region:
Collaboration graph
[legend]

Public Types

using Id = uint64_t
 

Public Member Functions

 ~Region () noexcept
 
 Region (rvsdg::Region *parent, Graph *graph)
 
 Region (rvsdg::StructuralNode *node, size_t index)
 
 Region (const Region &)=delete
 
Regionoperator= (const Region &)=delete
 
Id getRegionId () const noexcept
 
RegionArgumentRange Arguments () noexcept
 
RegionArgumentConstRange Arguments () const noexcept
 
RegionResultRange Results () noexcept
 
RegionResultConstRange Results () const noexcept
 
TopNodeRange TopNodes () noexcept
 
TopNodeConstRange TopNodes () const noexcept
 
NodeRange Nodes () noexcept
 
NodeConstRange Nodes () const noexcept
 
BottomNodeRange BottomNodes () noexcept
 
BottomNodeConstRange BottomNodes () const noexcept
 
Graphgraph () const noexcept
 
rvsdg::StructuralNodenode () const noexcept
 
size_t index () const noexcept
 
bool IsRootRegion () const noexcept
 
RegionArgumentaddArgument (std::unique_ptr< RegionArgument > argument)
 
RegionArgumentinsertArgument (size_t index, std::unique_ptr< RegionArgument > argument)
 
size_t RemoveArguments (const util::HashSet< size_t > &indices)
 
size_t PruneArguments ()
 
size_t narguments () const noexcept
 
RegionArgumentargument (size_t index) const noexcept
 
RegionResultaddResult (std::unique_ptr< RegionResult > result)
 
size_t RemoveResults (const util::HashSet< size_t > &indices)
 
size_t nresults () const noexcept
 
RegionResultresult (size_t index) const noexcept
 
size_t numNodes () const noexcept
 
size_t numTopNodes () const noexcept
 
size_t numBottomNodes () const noexcept
 
void removeNode (Node *node)
 
void copy (Region *target, SubstitutionMap &smap) const
 Copy a region with substitutions. More...
 
void prune (bool recursive)
 
void view () const
 
Node::Id getNextNodeId () const noexcept
 

Static Public Member Functions

template<class Operation >
static bool ContainsOperation (const rvsdg::Region &region, bool checkSubregions)
 
template<class NodeType >
static bool ContainsNodeType (const rvsdg::Region &region, bool checkSubregions)
 
static size_t NumRegions (const rvsdg::Region &region) noexcept
 
static std::string ToTree (const rvsdg::Region &region, const util::AnnotationMap &annotationMap) noexcept
 
static std::string ToTree (const rvsdg::Region &region) noexcept
 

Private Types

using RegionArgumentIterator = std::vector< RegionArgument * >::iterator
 
using RegionArgumentConstIterator = std::vector< RegionArgument * >::const_iterator
 
using RegionArgumentRange = util::IteratorRange< RegionArgumentIterator >
 
using RegionArgumentConstRange = util::IteratorRange< RegionArgumentConstIterator >
 
using RegionResultIterator = std::vector< RegionResult * >::iterator
 
using RegionResultConstIterator = std::vector< RegionResult * >::const_iterator
 
using RegionResultRange = util::IteratorRange< RegionResultIterator >
 
using RegionResultConstRange = util::IteratorRange< RegionResultConstIterator >
 
using region_nodes_list = util::IntrusiveList< Node, Node::region_node_list_accessor >
 
using region_top_node_list = util::IntrusiveList< Node, Node::region_top_node_list_accessor >
 
using region_bottom_node_list = util::IntrusiveList< Node, Node::region_bottom_node_list_accessor >
 
using TopNodeIterator = region_top_node_list::Iterator
 
using TopNodeConstIterator = region_top_node_list::ConstIterator
 
using TopNodeRange = util::IteratorRange< TopNodeIterator >
 
using TopNodeConstRange = util::IteratorRange< TopNodeConstIterator >
 
using NodeIterator = region_nodes_list::Iterator
 
using NodeConstIterator = region_nodes_list::ConstIterator
 
using NodeRange = util::IteratorRange< NodeIterator >
 
using NodeConstRange = util::IteratorRange< NodeConstIterator >
 
using BottomNodeIterator = region_bottom_node_list::Iterator
 
using BottomNodeConstIterator = region_bottom_node_list::ConstIterator
 
using BottomNodeRange = util::IteratorRange< BottomNodeIterator >
 
using BottomNodeConstRange = util::IteratorRange< BottomNodeConstIterator >
 

Private Member Functions

void onTopNodeAdded (Node &node)
 Adds node to the top nodes of the region. More...
 
void onTopNodeRemoved (Node &node)
 
void onBottomNodeAdded (Node &node)
 Adds node to the set of bottom nodes in the region. More...
 
void onBottomNodeRemoved (Node &node)
 
void onNodeAdded (Node &node)
 Adds node to the list of nodes in the region. More...
 
void onNodeRemoved (Node &node)
 
Node::Id generateNodeId () noexcept
 
void notifyNodeCreate (Node *node)
 
void notifyNodeDestroy (Node *node)
 
void notifyInputCreate (Input *input)
 
void notifyInputChange (Input *input, Output *old_origin, Output *new_origin)
 
void notifyInputDestroy (Input *input)
 

Static Private Member Functions

static void ToTree (const rvsdg::Region &region, const util::AnnotationMap &annotationMap, size_t indentationDepth, std::stringstream &stream) noexcept
 
static std::string GetAnnotationString (const void *key, const util::AnnotationMap &annotationMap, char annotationSeparator, char labelValueSeparator)
 
static std::string ToString (const std::vector< util::Annotation > &annotations, char annotationSeparator, char labelValueSeparator)
 
static std::string ToString (const util::Annotation &annotation, char labelValueSeparator)
 

Private Attributes

Id id_
 
size_t index_
 
Graphgraph_
 
Node::Id nextNodeId_
 
rvsdg::StructuralNodenode_
 
std::vector< RegionResult * > results_
 
std::vector< RegionArgument * > arguments_
 
region_top_node_list topNodes_
 
size_t numTopNodes_
 
region_bottom_node_list bottomNodes_
 
size_t numBottomNodes_
 
region_nodes_list nodes_
 
size_t numNodes_
 
RegionObserverobservers_ = nullptr
 

Friends

class Node
 
class RegionObserver
 
class SimpleNode
 
class StructuralNode
 
class Input
 
class Output
 
class RegionResult
 

Detailed Description

Represent acyclic RVSDG subgraphs.

Regions represent acyclic RVSDG subgraphs and are instantiated with an index in StructuralNodes. Each region has RegionArguments and RegionResults that represent the values at the beginning and end of the acyclic graph, respectively. In addition, each region keeps track of the following properties:

  1. The nodes of the acyclic subgraph. They represent the computations performed in the region.
  2. The top nodes of the acyclic subgraph. These are all nodes of the region that have no inputs, i.e., constants.
  3. The bottom nodes of the acyclic subgraph. These are all nodes of the region that have no users, i.e. that are dead. See Output::IsDead() for more information.

Definition at line 212 of file region.hpp.

Member Typedef Documentation

◆ BottomNodeConstIterator

using jlm::rvsdg::Region::BottomNodeConstIterator = region_bottom_node_list::ConstIterator
private

Definition at line 239 of file region.hpp.

◆ BottomNodeConstRange

Definition at line 241 of file region.hpp.

◆ BottomNodeIterator

using jlm::rvsdg::Region::BottomNodeIterator = region_bottom_node_list::Iterator
private

Definition at line 238 of file region.hpp.

◆ BottomNodeRange

Definition at line 240 of file region.hpp.

◆ Id

using jlm::rvsdg::Region::Id = uint64_t

Definition at line 244 of file region.hpp.

◆ NodeConstIterator

using jlm::rvsdg::Region::NodeConstIterator = region_nodes_list::ConstIterator
private

Definition at line 234 of file region.hpp.

◆ NodeConstRange

Definition at line 236 of file region.hpp.

◆ NodeIterator

using jlm::rvsdg::Region::NodeIterator = region_nodes_list::Iterator
private

Definition at line 233 of file region.hpp.

◆ NodeRange

Definition at line 235 of file region.hpp.

◆ region_bottom_node_list

Definition at line 226 of file region.hpp.

◆ region_nodes_list

Definition at line 224 of file region.hpp.

◆ region_top_node_list

Definition at line 225 of file region.hpp.

◆ RegionArgumentConstIterator

using jlm::rvsdg::Region::RegionArgumentConstIterator = std::vector<RegionArgument *>::const_iterator
private

Definition at line 215 of file region.hpp.

◆ RegionArgumentConstRange

Definition at line 217 of file region.hpp.

◆ RegionArgumentIterator

using jlm::rvsdg::Region::RegionArgumentIterator = std::vector<RegionArgument *>::iterator
private

Definition at line 214 of file region.hpp.

◆ RegionArgumentRange

Definition at line 216 of file region.hpp.

◆ RegionResultConstIterator

using jlm::rvsdg::Region::RegionResultConstIterator = std::vector<RegionResult *>::const_iterator
private

Definition at line 220 of file region.hpp.

◆ RegionResultConstRange

Definition at line 222 of file region.hpp.

◆ RegionResultIterator

using jlm::rvsdg::Region::RegionResultIterator = std::vector<RegionResult *>::iterator
private

Definition at line 219 of file region.hpp.

◆ RegionResultRange

Definition at line 221 of file region.hpp.

◆ TopNodeConstIterator

using jlm::rvsdg::Region::TopNodeConstIterator = region_top_node_list::ConstIterator
private

Definition at line 229 of file region.hpp.

◆ TopNodeConstRange

Definition at line 231 of file region.hpp.

◆ TopNodeIterator

using jlm::rvsdg::Region::TopNodeIterator = region_top_node_list::Iterator
private

Definition at line 228 of file region.hpp.

◆ TopNodeRange

Definition at line 230 of file region.hpp.

Constructor & Destructor Documentation

◆ ~Region()

jlm::rvsdg::Region::~Region ( )
noexcept

Definition at line 121 of file region.cpp.

◆ Region() [1/3]

jlm::rvsdg::Region::Region ( rvsdg::Region parent,
Graph graph 
)

Definition at line 147 of file region.cpp.

◆ Region() [2/3]

jlm::rvsdg::Region::Region ( rvsdg::StructuralNode node,
size_t  index 
)

Definition at line 158 of file region.cpp.

◆ Region() [3/3]

jlm::rvsdg::Region::Region ( const Region )
delete

Member Function Documentation

◆ addArgument()

RegionArgument & jlm::rvsdg::Region::addArgument ( std::unique_ptr< RegionArgument argument)

Appends the given region argument to the list of region arguments. Invalidates any existing iterators to the argument list.

Parameters
argumentthe argument to add
Returns
a reference to the added argument

Definition at line 176 of file region.cpp.

◆ addResult()

RegionResult & jlm::rvsdg::Region::addResult ( std::unique_ptr< RegionResult result)

Appends the given region result to the list of region results. Invalidates any existing iterators to the result list.

Parameters
resultthe result to add
Returns
a reference to the added result

Definition at line 262 of file region.cpp.

◆ argument()

RegionArgument* jlm::rvsdg::Region::argument ( size_t  index) const
inlinenoexcept

Definition at line 437 of file region.hpp.

◆ Arguments() [1/2]

RegionArgumentConstRange jlm::rvsdg::Region::Arguments ( ) const
inlinenoexcept
Returns
Returns an iterator range for iterating through the arguments of the region.

Definition at line 281 of file region.hpp.

◆ Arguments() [2/2]

RegionArgumentRange jlm::rvsdg::Region::Arguments ( )
inlinenoexcept
Returns
Returns an iterator range for iterating through the arguments of the region.

Definition at line 272 of file region.hpp.

◆ BottomNodes() [1/2]

BottomNodeConstRange jlm::rvsdg::Region::BottomNodes ( ) const
inlinenoexcept
Returns
Returns an iterator range for iterating through the bottom nodes of the region. The bottom nodes are all nodes with only unused outputs, aka. dead nodes.

Definition at line 357 of file region.hpp.

◆ BottomNodes() [2/2]

BottomNodeRange jlm::rvsdg::Region::BottomNodes ( )
inlinenoexcept
Returns
Returns an iterator range for iterating through the bottom nodes of the region. The bottom nodes are all nodes with only unused outputs, aka. dead nodes.

Definition at line 347 of file region.hpp.

◆ ContainsNodeType()

template<class NodeType >
bool jlm::rvsdg::Region::ContainsNodeType ( const rvsdg::Region region,
bool  checkSubregions 
)
inlinestatic

Checks if a node type is contained within the given region. If checkSubregions is true, then the subregions of all contained structural nodes are recursively checked as well.

Template Parameters
OperationThe operation to check for.
Parameters
regionThe region to check.
checkSubregionsIf true, then the subregions of all contained structural nodes will be checked as well.
Returns
True, if the operation is found. Otherwise, false.

Definition at line 197 of file structural-node.hpp.

◆ ContainsOperation()

template<class Operation >
bool jlm::rvsdg::Region::ContainsOperation ( const rvsdg::Region region,
bool  checkSubregions 
)
inlinestatic

Checks if an operation is contained within the given region. If checkSubregions is true, then the subregions of all contained structural nodes are recursively checked as well.

Template Parameters
OperationThe operation to check for.
Parameters
regionThe region to check.
checkSubregionsIf true, then the subregions of all contained structural nodes will be checked as well.
Returns
True, if the operation is found. Otherwise, false.

Definition at line 163 of file structural-node.hpp.

◆ copy()

void jlm::rvsdg::Region::copy ( Region target,
SubstitutionMap smap 
) const

Copy a region with substitutions.

Parameters
targetTarget region to create nodes in
smapOperand substitutions

Copies all nodes of the specified region and its subregions into the target region. Substitutions will be performed as specified, and the substitution map will be updated as nodes are copied.

Definition at line 314 of file region.cpp.

◆ generateNodeId()

Node::Id jlm::rvsdg::Region::generateNodeId ( )
inlineprivatenoexcept
Returns
A unique identifier for a node within this region.
Note
This method is automatically invoked when a node is created. The identifier is only unique within this region.

Definition at line 613 of file region.hpp.

◆ GetAnnotationString()

std::string jlm::rvsdg::Region::GetAnnotationString ( const void *  key,
const util::AnnotationMap annotationMap,
char  annotationSeparator,
char  labelValueSeparator 
)
staticprivate

Definition at line 531 of file region.cpp.

◆ getNextNodeId()

Node::Id jlm::rvsdg::Region::getNextNodeId ( ) const
inlinenoexcept
Returns
the Node:Id that will be used for the next node created in the region.

Definition at line 544 of file region.hpp.

◆ getRegionId()

Id jlm::rvsdg::Region::getRegionId ( ) const
inlinenoexcept
Returns
The unique identifier of the region instance within the graph.
See also
Graph::generateRegionId()

Definition at line 263 of file region.hpp.

◆ graph()

Graph* jlm::rvsdg::Region::graph ( ) const
inlinenoexcept

Definition at line 363 of file region.hpp.

◆ index()

size_t jlm::rvsdg::Region::index ( ) const
inlinenoexcept

Definition at line 375 of file region.hpp.

◆ insertArgument()

RegionArgument & jlm::rvsdg::Region::insertArgument ( size_t  index,
std::unique_ptr< RegionArgument argument 
)

Inserts the given region argument in the list of region arguments, at the given index. Shifts any results with equal or greater index one to the right to make room. Invalidates any existing iterators to the argument list.

Parameters
indexthe position to add the result
argumentthe argument to add
Returns
a reference to the added result
See also
addArgument to add to the end

Definition at line 187 of file region.cpp.

◆ IsRootRegion()

bool jlm::rvsdg::Region::IsRootRegion ( ) const
noexcept

Checks if the region is the RVSDG root region.

Returns
Returns true if it is the root region, otherwise false.

Definition at line 170 of file region.cpp.

◆ narguments()

size_t jlm::rvsdg::Region::narguments ( ) const
inlinenoexcept

Definition at line 431 of file region.hpp.

◆ node()

rvsdg::StructuralNode* jlm::rvsdg::Region::node ( ) const
inlinenoexcept

Definition at line 369 of file region.hpp.

◆ Nodes() [1/2]

NodeConstRange jlm::rvsdg::Region::Nodes ( ) const
inlinenoexcept
Returns
Returns an iterator range for iterating through the nodes of the region.

Definition at line 337 of file region.hpp.

◆ Nodes() [2/2]

NodeRange jlm::rvsdg::Region::Nodes ( )
inlinenoexcept
Returns
Returns an iterator range for iterating through the nodes of the region.

Definition at line 328 of file region.hpp.

◆ notifyInputChange()

void jlm::rvsdg::Region::notifyInputChange ( Input input,
Output old_origin,
Output new_origin 
)
private

Definition at line 435 of file region.cpp.

◆ notifyInputCreate()

void jlm::rvsdg::Region::notifyInputCreate ( Input input)
private

Definition at line 426 of file region.cpp.

◆ notifyInputDestroy()

void jlm::rvsdg::Region::notifyInputDestroy ( Input input)
private

Definition at line 444 of file region.cpp.

◆ notifyNodeCreate()

void jlm::rvsdg::Region::notifyNodeCreate ( Node node)
private

Definition at line 408 of file region.cpp.

◆ notifyNodeDestroy()

void jlm::rvsdg::Region::notifyNodeDestroy ( Node node)
private

Definition at line 417 of file region.cpp.

◆ nresults()

size_t jlm::rvsdg::Region::nresults ( ) const
inlinenoexcept

Definition at line 465 of file region.hpp.

◆ numBottomNodes()

size_t jlm::rvsdg::Region::numBottomNodes ( ) const
inlinenoexcept
Returns
The number of bottom nodes in the region.

Definition at line 499 of file region.hpp.

◆ numNodes()

size_t jlm::rvsdg::Region::numNodes ( ) const
inlinenoexcept
Returns
The number of nodes in the region.

Definition at line 481 of file region.hpp.

◆ NumRegions()

size_t jlm::rvsdg::Region::NumRegions ( const rvsdg::Region region)
staticnoexcept

Counts the number of (sub-)regions contained within region. The count includes region, i.e., if region does not contain any structural nodes and therefore no subregions, then the count is one.

Parameters
regionThe region for which to count the contained (sub-)regions.
Returns
The number of (sub-)regions.

Definition at line 453 of file region.cpp.

◆ numTopNodes()

size_t jlm::rvsdg::Region::numTopNodes ( ) const
inlinenoexcept
Returns
The number of top nodes in the region.

Definition at line 490 of file region.hpp.

◆ onBottomNodeAdded()

void jlm::rvsdg::Region::onBottomNodeAdded ( Node node)
private

Adds node to the set of bottom nodes in the region.

Parameters
nodeThe node that is now a bottom node.
See also
BottomNodes
Note
This method is automatically invoked when a node is created or becomes dead.

Definition at line 375 of file region.cpp.

◆ onBottomNodeRemoved()

void jlm::rvsdg::Region::onBottomNodeRemoved ( Node node)
private

Removes node from the list of bottom nodes in the region.

Parameters
nodeThe node that is no longer a bottom node.
Note
This method is automatically invoked when a node ceases to be dead.

Definition at line 384 of file region.cpp.

◆ onNodeAdded()

void jlm::rvsdg::Region::onNodeAdded ( Node node)
private

Adds node to the list of nodes in the region.

Parameters
nodeThe node that has been created in the region.
Note
This method is automatically invoked when a node is created.

Definition at line 392 of file region.cpp.

◆ onNodeRemoved()

void jlm::rvsdg::Region::onNodeRemoved ( Node node)
private

Remove node from the region.

Parameters
nodeThe node that is removed.
Note
This method is automatically invoked when a node is deleted.

Definition at line 400 of file region.cpp.

◆ onTopNodeAdded()

void jlm::rvsdg::Region::onTopNodeAdded ( Node node)
private

Adds node to the top nodes of the region.

Parameters
nodeThe node that is now a top node.
See also
TopNodes
Note
This method is automatically invoked when a top node is created.

Definition at line 358 of file region.cpp.

◆ onTopNodeRemoved()

void jlm::rvsdg::Region::onTopNodeRemoved ( Node node)
private

Removes node from the list of top nodes in the region.

Parameters
nodeThe node that is no longer a top node.
Note
This method is automatically invoked when inputs are added to a node.

Definition at line 367 of file region.cpp.

◆ operator=()

Region& jlm::rvsdg::Region::operator= ( const Region )
delete

◆ prune()

void jlm::rvsdg::Region::prune ( bool  recursive)

Removes all dead nodes from the region, including nodes that become dead during pruning.

Parameters
recursiveif true, any subregions are also pruned, as well as their subregions etc.

Definition at line 323 of file region.cpp.

◆ PruneArguments()

size_t jlm::rvsdg::Region::PruneArguments ( )

Remove all arguments that have no users.

Returns
The number of arguments that were removed.

Definition at line 238 of file region.cpp.

◆ RemoveArguments()

size_t jlm::rvsdg::Region::RemoveArguments ( const util::HashSet< size_t > &  indices)

Remove all arguments that have no users and an index contained in indices.

Parameters
indicesThe indices of the arguments that should be removed.
Returns
The number of arguments that were actually removed. This might be less than the number of indices as some arguments might not have been dead or a provided argument index does not belong to an actual argument.

Definition at line 210 of file region.cpp.

◆ removeNode()

void jlm::rvsdg::Region::removeNode ( Node node)

Deletes the given node from the region. The node must belong to this region, and be dead.

Parameters
nodethe node to remove

Definition at line 306 of file region.cpp.

◆ RemoveResults()

size_t jlm::rvsdg::Region::RemoveResults ( const util::HashSet< size_t > &  indices)

Remove all results that have an index contained in indices.

Parameters
indicesThe indices of the results that should be removed.
Returns
The number of results that were removed. This might be less than the number of indices as some provided result indices might not belong to an actual result.

Definition at line 278 of file region.cpp.

◆ result()

RegionResult* jlm::rvsdg::Region::result ( size_t  index) const
inlinenoexcept

Definition at line 471 of file region.hpp.

◆ Results() [1/2]

RegionResultConstRange jlm::rvsdg::Region::Results ( ) const
inlinenoexcept
Returns
Returns an iterator range for iterating through the results of the region.

Definition at line 299 of file region.hpp.

◆ Results() [2/2]

RegionResultRange jlm::rvsdg::Region::Results ( )
inlinenoexcept
Returns
Returns an iterator range for iterating through the results of the region.

Definition at line 290 of file region.hpp.

◆ TopNodes() [1/2]

TopNodeConstRange jlm::rvsdg::Region::TopNodes ( ) const
inlinenoexcept
Returns
Returns an iterator range for iterating through the top nodes of the region. The top nodes are all nodes that do not have any inputs.

Definition at line 319 of file region.hpp.

◆ TopNodes() [2/2]

TopNodeRange jlm::rvsdg::Region::TopNodes ( )
inlinenoexcept
Returns
Returns an iterator range for iterating through the top nodes of the region. The top nodes are all nodes that do not have any inputs.

Definition at line 309 of file region.hpp.

◆ ToString() [1/2]

std::string jlm::rvsdg::Region::ToString ( const std::vector< util::Annotation > &  annotations,
char  annotationSeparator,
char  labelValueSeparator 
)
staticprivate

Definition at line 545 of file region.cpp.

◆ ToString() [2/2]

std::string jlm::rvsdg::Region::ToString ( const util::Annotation annotation,
char  labelValueSeparator 
)
staticprivate

Definition at line 561 of file region.cpp.

◆ ToTree() [1/3]

std::string jlm::rvsdg::Region::ToTree ( const rvsdg::Region region)
staticnoexcept

Converts region and all of its contained structural nodes with subregions to a tree in ASCII format of the following form:

RootRegion
-STRUCTURAL_TEST_NODE
Region[0]
Region[1]
—STRUCTURAL_TEST_NODE
-—Region[0]
-—Region[1]
-—Region[2]

The above tree has a single structural node in the RVSDG's root region. This node has two subregions, where the second subregion contains another structural node with three subregions.

Parameters
regionThe top-level region that is converted
Returns
A string containing the ASCII tree of region

Definition at line 479 of file region.cpp.

◆ ToTree() [2/3]

std::string jlm::rvsdg::Region::ToTree ( const rvsdg::Region region,
const util::AnnotationMap annotationMap 
)
staticnoexcept

Converts region and all of its contained structural nodes with subregions to a tree in ASCII format of the following form:

RootRegion
-STRUCTURAL_TEST_NODE
Region[0]
Region[1]
—STRUCTURAL_TEST_NODE
-—Region[0]
-—Region[1]
-—Region[2] NumNodes:0 NumArguments:0

The above tree has a single structural node in the RVSDG's root region. This node has two subregions, where the second subregion contains another structural node with three subregions. For the third subregion, two annotations with label NumNodes and NumArguments was provided in annotationMap.

Parameters
regionThe top-level region that is converted
annotationMapA map with annotations for instances of Regions or StructuralNodes.
Returns
A string containing the ASCII tree of region.

Definition at line 471 of file region.cpp.

◆ ToTree() [3/3]

void jlm::rvsdg::Region::ToTree ( const rvsdg::Region region,
const util::AnnotationMap annotationMap,
size_t  indentationDepth,
std::stringstream &  stream 
)
staticprivatenoexcept

Definition at line 488 of file region.cpp.

◆ view()

void jlm::rvsdg::Region::view ( ) const

This function is meant to be used from the debugger. You can just invoke it and a xdot window should pop up with a DOT visualization of the region. This depends on xdot being in the PATH.

Definition at line 342 of file region.cpp.

Friends And Related Function Documentation

◆ Input

friend class Input
friend

Definition at line 770 of file region.hpp.

◆ Node

friend class Node
friend

Definition at line 766 of file region.hpp.

◆ Output

friend class Output
friend

Definition at line 771 of file region.hpp.

◆ RegionObserver

friend class RegionObserver
friend

Definition at line 767 of file region.hpp.

◆ RegionResult

friend class RegionResult
friend

Definition at line 772 of file region.hpp.

◆ SimpleNode

friend class SimpleNode
friend

Definition at line 768 of file region.hpp.

◆ StructuralNode

friend class StructuralNode
friend

Definition at line 769 of file region.hpp.

Member Data Documentation

◆ arguments_

std::vector<RegionArgument *> jlm::rvsdg::Region::arguments_
private

Definition at line 755 of file region.hpp.

◆ bottomNodes_

region_bottom_node_list jlm::rvsdg::Region::bottomNodes_
private

Definition at line 758 of file region.hpp.

◆ graph_

Graph* jlm::rvsdg::Region::graph_
private

Definition at line 749 of file region.hpp.

◆ id_

Id jlm::rvsdg::Region::id_
private

Definition at line 747 of file region.hpp.

◆ index_

size_t jlm::rvsdg::Region::index_
private

Definition at line 748 of file region.hpp.

◆ nextNodeId_

Node::Id jlm::rvsdg::Region::nextNodeId_
private

Definition at line 750 of file region.hpp.

◆ node_

rvsdg::StructuralNode* jlm::rvsdg::Region::node_
private

Definition at line 751 of file region.hpp.

◆ nodes_

region_nodes_list jlm::rvsdg::Region::nodes_
private

Definition at line 760 of file region.hpp.

◆ numBottomNodes_

size_t jlm::rvsdg::Region::numBottomNodes_
private

Definition at line 759 of file region.hpp.

◆ numNodes_

size_t jlm::rvsdg::Region::numNodes_
private

Definition at line 761 of file region.hpp.

◆ numTopNodes_

size_t jlm::rvsdg::Region::numTopNodes_
private

Definition at line 757 of file region.hpp.

◆ observers_

RegionObserver* jlm::rvsdg::Region::observers_ = nullptr
mutableprivate

Definition at line 764 of file region.hpp.

◆ results_

std::vector<RegionResult *> jlm::rvsdg::Region::results_
private

Definition at line 754 of file region.hpp.

◆ topNodes_

region_top_node_list jlm::rvsdg::Region::topNodes_
private

Definition at line 756 of file region.hpp.


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