Jlm
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
jlm::rvsdg::ThetaNode Class Referencefinal

#include <theta.hpp>

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

Classes

struct  LoopVar
 Description of a loop-carried variable. More...
 

Public Member Functions

 ~ThetaNode () noexcept override
 
const ThetaOperationGetOperation () const noexcept override
 
rvsdg::Regionsubregion () const noexcept
 
RegionResultpredicate () const noexcept
 
void set_predicate (jlm::rvsdg::Output *p)
 
LoopVar AddLoopVar (rvsdg::Output *origin)
 Creates a new loop-carried variable. More...
 
void RemoveLoopVars (std::vector< LoopVar > loopVars)
 Removes loop variables. More...
 
ThetaNodecopy (rvsdg::Region *region, rvsdg::SubstitutionMap &smap) const override
 Copy a node with substitutions. More...
 
LoopVar MapInputLoopVar (const rvsdg::Input &input) const
 Maps variable at entry to full varibale description. More...
 
LoopVar MapPreLoopVar (const rvsdg::Output &argument) const
 Maps variable at start of loop iteration to full varibale description. More...
 
LoopVar MapPostLoopVar (const rvsdg::Input &result) const
 Maps variable at end of loop iteration to full varibale description. More...
 
LoopVar MapOutputLoopVar (const rvsdg::Output &output) const
 Maps variable at exit to full varibale description. More...
 
std::vector< LoopVarGetLoopVars () const
 Returns all loop variables. More...
 
- Public Member Functions inherited from jlm::rvsdg::StructuralNode
 ~StructuralNode () noexcept override
 
std::string DebugString () const override
 
size_t nsubregions () const noexcept
 
rvsdg::Regionsubregion (size_t index) const noexcept
 
SubregionIteratorRange Subregions ()
 
SubregionConstIteratorRange Subregions () const
 
StructuralInputinput (size_t index) const noexcept
 
StructuralOutputoutput (size_t index) const noexcept
 
- Public Member Functions inherited from jlm::rvsdg::Node
virtual ~Node ()
 
 Node (Region *region)
 
Id GetNodeId () const noexcept
 
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
 
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
 

Static Public Member Functions

static ThetaNodecreate (rvsdg::Region *parent)
 

Private Member Functions

 ThetaNode (rvsdg::Region &parent)
 

Additional Inherited Members

- Public Types inherited from jlm::rvsdg::Node
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
 
- Protected Member Functions inherited from jlm::rvsdg::StructuralNode
 StructuralNode (rvsdg::Region *region, size_t nsubregions)
 
StructuralInputaddInput (std::unique_ptr< StructuralInput > input, bool notifyRegion)
 
StructuralOutputaddOutput (std::unique_ptr< StructuralOutput > input)
 
- Protected Member Functions inherited from jlm::rvsdg::Node
NodeInputaddInput (std::unique_ptr< NodeInput > input, bool notifyRegion)
 
NodeOutputaddOutput (std::unique_ptr< NodeOutput > output)
 

Detailed Description

Definition at line 32 of file theta.hpp.

Constructor & Destructor Documentation

◆ ~ThetaNode()

jlm::rvsdg::ThetaNode::~ThetaNode ( )
overridedefaultnoexcept

◆ ThetaNode()

jlm::rvsdg::ThetaNode::ThetaNode ( rvsdg::Region parent)
explicitprivate

Definition at line 41 of file theta.cpp.

Member Function Documentation

◆ AddLoopVar()

ThetaNode::LoopVar jlm::rvsdg::ThetaNode::AddLoopVar ( rvsdg::Output origin)

Creates a new loop-carried variable.

Parameters
originInput value at start of loop.
Returns
Loop variable description.

Creates a new variable that is routed through the loop. The variable is set up such that the post-iteration value is the same as the pre-iteration value (i.e. the value remains unchanged through the loop). Caller can redirect edges inside the loop to turn this into a variable changed by the loop

Definition at line 49 of file theta.cpp.

◆ copy()

ThetaNode * jlm::rvsdg::ThetaNode::copy ( rvsdg::Region region,
rvsdg::SubstitutionMap smap 
) const
overridevirtual

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.

Implements jlm::rvsdg::Node.

Definition at line 100 of file theta.cpp.

◆ create()

static ThetaNode* jlm::rvsdg::ThetaNode::create ( rvsdg::Region parent)
inlinestatic

Definition at line 73 of file theta.hpp.

◆ GetLoopVars()

std::vector< ThetaNode::LoopVar > jlm::rvsdg::ThetaNode::GetLoopVars ( ) const

Returns all loop variables.

Returns
List of loop variable descriptions.

Definition at line 176 of file theta.cpp.

◆ GetOperation()

const ThetaOperation & jlm::rvsdg::ThetaNode::GetOperation ( ) const
overridevirtualnoexcept

Implements jlm::rvsdg::Node.

Definition at line 33 of file theta.cpp.

◆ MapInputLoopVar()

ThetaNode::LoopVar jlm::rvsdg::ThetaNode::MapInputLoopVar ( const rvsdg::Input input) const

Maps variable at entry to full varibale description.

Parameters
inputInput to the theta node.
Returns
The loop variable description.
Precondition
input must be an input to this node.

Returns the full description of the loop variable corresponding to this entry into the theta node.

Definition at line 130 of file theta.cpp.

◆ MapOutputLoopVar()

ThetaNode::LoopVar jlm::rvsdg::ThetaNode::MapOutputLoopVar ( const rvsdg::Output output) const

Maps variable at exit to full varibale description.

Parameters
outputOutput of this theta node
Returns
The loop variable description
Precondition
output must be an output of this node

Returns the full description of the loop variable corresponding to this loop exit value.

Definition at line 166 of file theta.cpp.

◆ MapPostLoopVar()

ThetaNode::LoopVar jlm::rvsdg::ThetaNode::MapPostLoopVar ( const rvsdg::Input result) const

Maps variable at end of loop iteration to full varibale description.

Parameters
resultResult of theta region.
Returns
The loop variable description.
Precondition
result must be a result to the subregion of this node.

Returns the full description of the loop variable corresponding to this variable at the end of each loop iteration.

Definition at line 150 of file theta.cpp.

◆ MapPreLoopVar()

ThetaNode::LoopVar jlm::rvsdg::ThetaNode::MapPreLoopVar ( const rvsdg::Output argument) const

Maps variable at start of loop iteration to full varibale description.

Parameters
argumentArgument of theta region.
Returns
The loop variable description.
Precondition
argument must be an argument to the subregion of this node.

Returns the full description of the loop variable corresponding to this variable at the start of each loop iteration.

Definition at line 140 of file theta.cpp.

◆ predicate()

RegionResult* jlm::rvsdg::ThetaNode::predicate ( ) const
inlinenoexcept

Definition at line 85 of file theta.hpp.

◆ RemoveLoopVars()

void jlm::rvsdg::ThetaNode::RemoveLoopVars ( std::vector< LoopVar loopVars)

Removes loop variables.

Parameters
loopVarsThe loop variables to be removed.
Precondition
For each loopvar in loopvars the following must hold:
  • loopvar.pre->origin() == loopvar.post
  • loopvar.pre has no other users besides loopvar.post
  • loopvar.output has no users

Removes loop variables from this theta construct. The loop variables must be loop-invariant and otherwise unused. See dead node elimination that is explicitly structured to restructure loops before processing to ensure this invariant.

Definition at line 63 of file theta.cpp.

◆ set_predicate()

void jlm::rvsdg::ThetaNode::set_predicate ( jlm::rvsdg::Output p)
inline

Definition at line 93 of file theta.hpp.

◆ subregion()

rvsdg::Region* jlm::rvsdg::ThetaNode::subregion ( ) const
inlinenoexcept

Definition at line 79 of file theta.hpp.


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