|
Jlm
|
Represent acyclic RVSDG subgraphs. More...
#include <region.hpp>

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 | |
| Region & | operator= (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 |
| Graph * | graph () const noexcept |
| rvsdg::StructuralNode * | node () const noexcept |
| size_t | index () const noexcept |
| bool | IsRootRegion () const noexcept |
| RegionArgument & | addArgument (std::unique_ptr< RegionArgument > argument) |
| RegionArgument & | insertArgument (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 |
| RegionArgument * | argument (size_t index) const noexcept |
| RegionResult & | addResult (std::unique_ptr< RegionResult > result) |
| size_t | RemoveResults (const util::HashSet< size_t > &indices) |
| size_t | nresults () const noexcept |
| RegionResult * | result (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 ®ion, bool checkSubregions) |
| template<class NodeType > | |
| static bool | ContainsNodeType (const rvsdg::Region ®ion, bool checkSubregions) |
| static size_t | NumRegions (const rvsdg::Region ®ion) noexcept |
| static std::string | ToTree (const rvsdg::Region ®ion, const util::AnnotationMap &annotationMap) noexcept |
| static std::string | ToTree (const rvsdg::Region ®ion) noexcept |
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 ®ion, 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_ |
| Graph * | graph_ |
| Node::Id | nextNodeId_ |
| rvsdg::StructuralNode * | node_ |
| 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_ |
| RegionObserver * | observers_ = nullptr |
Friends | |
| class | Node |
| class | RegionObserver |
| class | SimpleNode |
| class | StructuralNode |
| class | Input |
| class | Output |
| class | RegionResult |
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:
Definition at line 212 of file region.hpp.
|
private |
Definition at line 239 of file region.hpp.
|
private |
Definition at line 241 of file region.hpp.
|
private |
Definition at line 238 of file region.hpp.
|
private |
Definition at line 240 of file region.hpp.
| using jlm::rvsdg::Region::Id = uint64_t |
Definition at line 244 of file region.hpp.
|
private |
Definition at line 234 of file region.hpp.
|
private |
Definition at line 236 of file region.hpp.
|
private |
Definition at line 233 of file region.hpp.
|
private |
Definition at line 235 of file region.hpp.
|
private |
Definition at line 226 of file region.hpp.
|
private |
Definition at line 224 of file region.hpp.
|
private |
Definition at line 225 of file region.hpp.
|
private |
Definition at line 215 of file region.hpp.
|
private |
Definition at line 217 of file region.hpp.
|
private |
Definition at line 214 of file region.hpp.
Definition at line 216 of file region.hpp.
|
private |
Definition at line 220 of file region.hpp.
|
private |
Definition at line 222 of file region.hpp.
|
private |
Definition at line 219 of file region.hpp.
|
private |
Definition at line 221 of file region.hpp.
|
private |
Definition at line 229 of file region.hpp.
|
private |
Definition at line 231 of file region.hpp.
|
private |
Definition at line 228 of file region.hpp.
|
private |
Definition at line 230 of file region.hpp.
|
noexcept |
Definition at line 121 of file region.cpp.
| jlm::rvsdg::Region::Region | ( | rvsdg::Region * | parent, |
| Graph * | graph | ||
| ) |
Definition at line 147 of file region.cpp.
| jlm::rvsdg::Region::Region | ( | rvsdg::StructuralNode * | node, |
| size_t | index | ||
| ) |
Definition at line 158 of file region.cpp.
|
delete |
| 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.
| argument | the argument to add |
Definition at line 176 of file region.cpp.
| 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.
| result | the result to add |
Definition at line 262 of file region.cpp.
|
inlinenoexcept |
Definition at line 437 of file region.hpp.
|
inlinenoexcept |
Definition at line 281 of file region.hpp.
|
inlinenoexcept |
Definition at line 272 of file region.hpp.
|
inlinenoexcept |
Definition at line 357 of file region.hpp.
|
inlinenoexcept |
Definition at line 347 of file region.hpp.
|
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.
| Operation | The operation to check for. |
| region | The region to check. |
| checkSubregions | If true, then the subregions of all contained structural nodes will be checked as well. |
Definition at line 197 of file structural-node.hpp.
|
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.
| Operation | The operation to check for. |
| region | The region to check. |
| checkSubregions | If true, then the subregions of all contained structural nodes will be checked as well. |
Definition at line 163 of file structural-node.hpp.
| void jlm::rvsdg::Region::copy | ( | Region * | target, |
| SubstitutionMap & | smap | ||
| ) | const |
Copy a region with substitutions.
| target | Target region to create nodes in |
| smap | Operand 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.
|
inlineprivatenoexcept |
Definition at line 613 of file region.hpp.
|
staticprivate |
Definition at line 531 of file region.cpp.
|
inlinenoexcept |
Definition at line 544 of file region.hpp.
|
inlinenoexcept |
Definition at line 263 of file region.hpp.
|
inlinenoexcept |
Definition at line 363 of file region.hpp.
|
inlinenoexcept |
Definition at line 375 of file region.hpp.
| 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.
| index | the position to add the result |
| argument | the argument to add |
Definition at line 187 of file region.cpp.
|
noexcept |
Checks if the region is the RVSDG root region.
Definition at line 170 of file region.cpp.
|
inlinenoexcept |
Definition at line 431 of file region.hpp.
|
inlinenoexcept |
Definition at line 369 of file region.hpp.
|
inlinenoexcept |
Definition at line 337 of file region.hpp.
|
inlinenoexcept |
Definition at line 328 of file region.hpp.
|
private |
Definition at line 435 of file region.cpp.
|
private |
Definition at line 426 of file region.cpp.
|
private |
Definition at line 444 of file region.cpp.
|
private |
Definition at line 408 of file region.cpp.
|
private |
Definition at line 417 of file region.cpp.
|
inlinenoexcept |
Definition at line 465 of file region.hpp.
|
inlinenoexcept |
Definition at line 499 of file region.hpp.
|
inlinenoexcept |
Definition at line 481 of file region.hpp.
|
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.
| region | The region for which to count the contained (sub-)regions. |
Definition at line 453 of file region.cpp.
|
inlinenoexcept |
Definition at line 490 of file region.hpp.
|
private |
Adds node to the set of bottom nodes in the region.
| node | The node that is now a bottom node. |
Definition at line 375 of file region.cpp.
|
private |
Removes node from the list of bottom nodes in the region.
| node | The node that is no longer a bottom node. |
Definition at line 384 of file region.cpp.
|
private |
Adds node to the list of nodes in the region.
| node | The node that has been created in the region. |
Definition at line 392 of file region.cpp.
|
private |
Remove node from the region.
| node | The node that is removed. |
Definition at line 400 of file region.cpp.
|
private |
Adds node to the top nodes of the region.
| node | The node that is now a top node. |
Definition at line 358 of file region.cpp.
|
private |
Removes node from the list of top nodes in the region.
| node | The node that is no longer a top node. |
Definition at line 367 of file region.cpp.
| void jlm::rvsdg::Region::prune | ( | bool | recursive | ) |
Removes all dead nodes from the region, including nodes that become dead during pruning.
| recursive | if true, any subregions are also pruned, as well as their subregions etc. |
Definition at line 323 of file region.cpp.
| size_t jlm::rvsdg::Region::PruneArguments | ( | ) |
Remove all arguments that have no users.
Definition at line 238 of file region.cpp.
| 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.
| indices | The indices of the arguments that should be removed. |
Definition at line 210 of file region.cpp.
| void jlm::rvsdg::Region::removeNode | ( | Node * | node | ) |
Deletes the given node from the region. The node must belong to this region, and be dead.
| node | the node to remove |
Definition at line 306 of file region.cpp.
| size_t jlm::rvsdg::Region::RemoveResults | ( | const util::HashSet< size_t > & | indices | ) |
Remove all results that have an index contained in indices.
| indices | The indices of the results that should be removed. |
Definition at line 278 of file region.cpp.
|
inlinenoexcept |
Definition at line 471 of file region.hpp.
|
inlinenoexcept |
Definition at line 299 of file region.hpp.
|
inlinenoexcept |
Definition at line 290 of file region.hpp.
|
inlinenoexcept |
Definition at line 319 of file region.hpp.
|
inlinenoexcept |
Definition at line 309 of file region.hpp.
|
staticprivate |
Definition at line 545 of file region.cpp.
|
staticprivate |
Definition at line 561 of file region.cpp.
|
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.
| region | The top-level region that is converted |
region Definition at line 479 of file region.cpp.
|
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.
| region | The top-level region that is converted |
| annotationMap | A map with annotations for instances of Regions or StructuralNodes. |
region. Definition at line 471 of file region.cpp.
|
staticprivatenoexcept |
Definition at line 488 of file region.cpp.
| 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.
|
friend |
Definition at line 770 of file region.hpp.
|
friend |
Definition at line 766 of file region.hpp.
|
friend |
Definition at line 771 of file region.hpp.
|
friend |
Definition at line 767 of file region.hpp.
|
friend |
Definition at line 772 of file region.hpp.
|
friend |
Definition at line 768 of file region.hpp.
|
friend |
Definition at line 769 of file region.hpp.
|
private |
Definition at line 755 of file region.hpp.
|
private |
Definition at line 758 of file region.hpp.
|
private |
Definition at line 749 of file region.hpp.
|
private |
Definition at line 747 of file region.hpp.
|
private |
Definition at line 748 of file region.hpp.
|
private |
Definition at line 750 of file region.hpp.
|
private |
Definition at line 751 of file region.hpp.
|
private |
Definition at line 760 of file region.hpp.
|
private |
Definition at line 759 of file region.hpp.
|
private |
Definition at line 761 of file region.hpp.
|
private |
Definition at line 757 of file region.hpp.
|
mutableprivate |
Definition at line 764 of file region.hpp.
|
private |
Definition at line 754 of file region.hpp.
|
private |
Definition at line 756 of file region.hpp.