Jlm
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
jlm::rvsdg::Node Class Referenceabstract

#include <node.hpp>

Inheritance diagram for jlm::rvsdg::Node:
Inheritance graph
[legend]
Collaboration diagram for jlm::rvsdg::Node:
Collaboration graph
[legend]

Public Types

using Id = uint64_t
 
using InputIteratorRange = util::IteratorRange< Input::Iterator >
 
using InputConstIteratorRange = util::IteratorRange< Input::ConstIterator >
 
using OutputIteratorRange = util::IteratorRange< Output::Iterator >
 
using OutputConstIteratorRange = util::IteratorRange< Output::ConstIterator >
 
typedef util::IntrusiveListAccessor< Node, &Node::region_node_list_anchor_region_node_list_accessor
 
typedef util::IntrusiveListAccessor< Node, &Node::region_top_node_list_anchor_region_top_node_list_accessor
 
typedef util::IntrusiveListAccessor< Node, &Node::region_bottom_node_list_anchor_region_bottom_node_list_accessor
 

Public Member Functions

virtual ~Node ()
 
 Node (Region *region)
 
Id GetNodeId () const noexcept
 
virtual const OperationGetOperation () const noexcept=0
 
size_t ninputs () const noexcept
 
NodeInputinput (size_t index) const noexcept
 
InputIteratorRange Inputs () noexcept
 
InputConstIteratorRange Inputs () const noexcept
 
size_t noutputs () const noexcept
 
NodeOutputoutput (size_t index) const noexcept
 
OutputIteratorRange Outputs () noexcept
 
OutputConstIteratorRange Outputs () const noexcept
 
bool IsDead () const noexcept
 Determines whether the node is dead. More...
 
std::size_t numSuccessors () const noexcept
 
virtual std::string DebugString () const =0
 
size_t RemoveInputs (const util::HashSet< size_t > &indices)
 
size_t RemoveOutputs (const util::HashSet< size_t > &indices)
 
Graphgraph () const noexcept
 
rvsdg::Regionregion () const noexcept
 
virtual Nodecopy (rvsdg::Region *region, const std::vector< jlm::rvsdg::Output * > &operands) const
 
virtual Nodecopy (rvsdg::Region *region, SubstitutionMap &smap) const =0
 Copy a node with substitutions. More...
 

Protected Member Functions

NodeInputaddInput (std::unique_ptr< NodeInput > input, bool notifyRegion)
 
NodeOutputaddOutput (std::unique_ptr< NodeOutput > output)
 

Private Attributes

util::IntrusiveListAnchor< Noderegion_node_list_anchor_ {}
 
util::IntrusiveListAnchor< Noderegion_top_node_list_anchor_ {}
 
util::IntrusiveListAnchor< Noderegion_bottom_node_list_anchor_ {}
 
Id Id_
 
Regionregion_
 
std::vector< std::unique_ptr< NodeInput > > inputs_
 
std::vector< std::unique_ptr< NodeOutput > > outputs_
 
std::size_t numSuccessors_ = 0
 

Friends

class Output
 

Detailed Description

Definition at line 580 of file node.hpp.

Member Typedef Documentation

◆ Id

using jlm::rvsdg::Node::Id = uint64_t

Definition at line 583 of file node.hpp.

◆ InputConstIteratorRange

Definition at line 586 of file node.hpp.

◆ InputIteratorRange

Definition at line 585 of file node.hpp.

◆ OutputConstIteratorRange

Definition at line 588 of file node.hpp.

◆ OutputIteratorRange

Definition at line 587 of file node.hpp.

◆ region_bottom_node_list_accessor

Definition at line 803 of file node.hpp.

◆ region_node_list_accessor

Definition at line 797 of file node.hpp.

◆ region_top_node_list_accessor

Definition at line 800 of file node.hpp.

Constructor & Destructor Documentation

◆ ~Node()

jlm::rvsdg::Node::~Node ( )
virtual

Definition at line 265 of file node.cpp.

◆ Node()

jlm::rvsdg::Node::Node ( Region region)
explicit

Definition at line 256 of file node.cpp.

Member Function Documentation

◆ addInput()

NodeInput * jlm::rvsdg::Node::addInput ( std::unique_ptr< NodeInput input,
bool  notifyRegion 
)
protected

Adds the given input to the node's inputs. Invalidates existing iterators to the node's inputs.

Parameters
inputan owned pointer to the new input
notifyRegionIf true, the region is informed about the new input. This should be false if the node has not yet notified the region about being created, i.e., this function is being called from the node's constructor.
Returns
a pointer to the added input

Definition at line 288 of file node.cpp.

◆ addOutput()

NodeOutput* jlm::rvsdg::Node::addOutput ( std::unique_ptr< NodeOutput output)
inlineprotected

Definition at line 732 of file node.hpp.

◆ copy() [1/2]

Node * jlm::rvsdg::Node::copy ( rvsdg::Region region,
const std::vector< jlm::rvsdg::Output * > &  operands 
) const
virtual

Reimplemented in jlm::rvsdg::LambdaNode, and jlm::rvsdg::DeltaNode.

Definition at line 369 of file node.cpp.

◆ copy() [2/2]

virtual Node* jlm::rvsdg::Node::copy ( rvsdg::Region region,
SubstitutionMap smap 
) const
pure virtual

Copy a node with substitutions.

Parameters
regionTarget region to create node in
smapOperand substitutions
Returns
Copied node

Create a new node that is semantically equivalent to an existing node. The newly created node will use the same operands as the existing node unless there is a substitution registered for a particular operand.

The given substitution map is updated so that all outputs of the original node will be substituted by corresponding outputs of the newly created node in subsequent copy operations.

Implemented in jlm::rvsdg::ThetaNode, jlm::rvsdg::PhiNode, jlm::rvsdg::LambdaNode, jlm::rvsdg::DeltaNode, jlm::hls::LoopNode, jlm::rvsdg::TestStructuralNode, jlm::rvsdg::SimpleNode, and jlm::rvsdg::GammaNode.

◆ DebugString()

virtual std::string jlm::rvsdg::Node::DebugString ( ) const
pure virtual

◆ GetNodeId()

Id jlm::rvsdg::Node::GetNodeId ( ) const
inlinenoexcept
Returns
The unique identifier of the node instance within the region.
See also
Region::generateNodeId()

Definition at line 600 of file node.hpp.

◆ GetOperation()

virtual const Operation& jlm::rvsdg::Node::GetOperation ( ) const
pure virtualnoexcept

◆ graph()

Graph * jlm::rvsdg::Node::graph ( ) const
noexcept

Definition at line 282 of file node.cpp.

◆ input()

NodeInput* jlm::rvsdg::Node::input ( size_t  index) const
inlinenoexcept

Definition at line 615 of file node.hpp.

◆ Inputs() [1/2]

InputConstIteratorRange jlm::rvsdg::Node::Inputs ( ) const
inlinenoexcept

Definition at line 633 of file node.hpp.

◆ Inputs() [2/2]

InputIteratorRange jlm::rvsdg::Node::Inputs ( )
inlinenoexcept

Definition at line 622 of file node.hpp.

◆ IsDead()

bool jlm::rvsdg::Node::IsDead ( ) const
inlinenoexcept

Determines whether the node is dead.

A node is considered dead if all its outputs are dead.

Returns
True, if the node is dead, otherwise false.
See also
output::IsDead()

Definition at line 688 of file node.hpp.

◆ ninputs()

size_t jlm::rvsdg::Node::ninputs ( ) const
inlinenoexcept

Definition at line 609 of file node.hpp.

◆ noutputs()

size_t jlm::rvsdg::Node::noutputs ( ) const
inlinenoexcept

Definition at line 644 of file node.hpp.

◆ numSuccessors()

std::size_t jlm::rvsdg::Node::numSuccessors ( ) const
inlinenoexcept

Definition at line 694 of file node.hpp.

◆ output()

NodeOutput* jlm::rvsdg::Node::output ( size_t  index) const
inlinenoexcept

Definition at line 650 of file node.hpp.

◆ Outputs() [1/2]

OutputConstIteratorRange jlm::rvsdg::Node::Outputs ( ) const
inlinenoexcept

Definition at line 668 of file node.hpp.

◆ Outputs() [2/2]

OutputIteratorRange jlm::rvsdg::Node::Outputs ( )
inlinenoexcept

Definition at line 657 of file node.hpp.

◆ region()

rvsdg::Region* jlm::rvsdg::Node::region ( ) const
inlinenoexcept

Definition at line 761 of file node.hpp.

◆ RemoveInputs()

size_t jlm::rvsdg::Node::RemoveInputs ( const util::HashSet< size_t > &  indices)

Removes all inputs that have an index in indices.

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

Definition at line 306 of file node.cpp.

◆ RemoveOutputs()

size_t jlm::rvsdg::Node::RemoveOutputs ( const util::HashSet< size_t > &  indices)

Removes all outputs that have no users and an index contained in indices.

Parameters
indicesThe indices of the outputs that should be removed.
Returns
The number of outputs that were actually removed. This might be less than the number of indices as some outputs might not have been dead or a provided output index does not belong to an output argument.
See also
output::nusers()

Definition at line 342 of file node.cpp.

Friends And Related Function Documentation

◆ Output

friend class Output
friend

Definition at line 812 of file node.hpp.

Member Data Documentation

◆ Id_

Id jlm::rvsdg::Node::Id_
private

Definition at line 806 of file node.hpp.

◆ inputs_

std::vector<std::unique_ptr<NodeInput> > jlm::rvsdg::Node::inputs_
private

Definition at line 808 of file node.hpp.

◆ numSuccessors_

std::size_t jlm::rvsdg::Node::numSuccessors_ = 0
private

Definition at line 810 of file node.hpp.

◆ outputs_

std::vector<std::unique_ptr<NodeOutput> > jlm::rvsdg::Node::outputs_
private

Definition at line 809 of file node.hpp.

◆ region_

Region* jlm::rvsdg::Node::region_
private

Definition at line 807 of file node.hpp.

◆ region_bottom_node_list_anchor_

util::IntrusiveListAnchor<Node> jlm::rvsdg::Node::region_bottom_node_list_anchor_ {}
private

Definition at line 793 of file node.hpp.

◆ region_node_list_anchor_

util::IntrusiveListAnchor<Node> jlm::rvsdg::Node::region_node_list_anchor_ {}
private

Definition at line 789 of file node.hpp.

◆ region_top_node_list_anchor_

util::IntrusiveListAnchor<Node> jlm::rvsdg::Node::region_top_node_list_anchor_ {}
private

Definition at line 791 of file node.hpp.


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