Jlm
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
jlm::hls::LoopNode Class Referencefinal

#include <hls.hpp>

Inheritance diagram for jlm::hls::LoopNode:
Inheritance graph
[legend]
Collaboration diagram for jlm::hls::LoopNode:
Collaboration graph
[legend]

Public Member Functions

 ~LoopNode () noexcept override=default
 
const rvsdg::OperationGetOperation () const noexcept override
 
rvsdg::Regionsubregion () const noexcept
 
rvsdg::RegionResultpredicate () const noexcept
 
rvsdg::OutputGetPredicateBuffer () const noexcept
 
void set_predicate (jlm::rvsdg::Output *p)
 
BackEdgeArgumentadd_backedge (std::shared_ptr< const jlm::rvsdg::Type > type)
 
rvsdg::StructuralOutputAddLoopVar (rvsdg::Output *origin, rvsdg::Output **buffer=nullptr)
 
rvsdg::OutputaddLoopConstant (rvsdg::Output *origin)
 
rvsdg::OutputaddResponseInput (rvsdg::Output *origin)
 
rvsdg::OutputaddRequestOutput (rvsdg::Output *origin)
 
void removeLoopOutput (rvsdg::StructuralOutput *output)
 
void removeLoopInput (rvsdg::StructuralInput *input)
 
LoopNodecopy (rvsdg::Region *region, rvsdg::SubstitutionMap &smap) const override
 Copy a node with substitutions. 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 LoopNodecreate (rvsdg::Region *parent, bool init=true)
 

Private Member Functions

 LoopNode (rvsdg::Region *parent)
 

Private Attributes

rvsdg::OutputPredicateBuffer_ {}
 

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 707 of file hls.hpp.

Constructor & Destructor Documentation

◆ ~LoopNode()

jlm::hls::LoopNode::~LoopNode ( )
overridedefaultnoexcept

◆ LoopNode()

jlm::hls::LoopNode::LoopNode ( rvsdg::Region parent)
inlineexplicitprivate

Definition at line 713 of file hls.hpp.

Member Function Documentation

◆ add_backedge()

BackEdgeArgument * jlm::hls::LoopNode::add_backedge ( std::shared_ptr< const jlm::rvsdg::Type type)

Definition at line 284 of file hls.cpp.

◆ addLoopConstant()

jlm::rvsdg::Output * jlm::hls::LoopNode::addLoopConstant ( rvsdg::Output origin)

Creates a node input for a loop constant, and a LoopConstantBuffer inside the loop region.

Parameters
originthe origin of the value outside the loop
Returns
the output of the LoopConstantBuffer inside the loop region

Definition at line 170 of file hls.cpp.

◆ AddLoopVar()

rvsdg::StructuralOutput * jlm::hls::LoopNode::AddLoopVar ( rvsdg::Output origin,
rvsdg::Output **  buffer = nullptr 
)

Creates a loop-carried variable for this LoopNode.

Creates a node input for the initial loop variable, which takes the origin as its value. Inside the loop region, a corresponding EntryArgument is created. A back-edge is also created, by adding a BackEdgeResult and corresponding BackEdgeArgument. Lastly an ExitResult with a corresponding node output is created.

At the top of the loop region, a MuxOperation predicated on the loop predicate buffer is used to pick between the EntryArgument and the BackEdgeArgument.

At the bottom of the region, a BranchOperation predicated on the loop predicate is used to send the result to an ExitResult when the loop is done, or to the BackEdgeResult if not. The BackEdgeResult has a small non-passthrough buffer in front of it, to break cycles.

Parameters
originthe initial value, defined outside the loop
bufferif non-null, will be set to a pointer to the Mux output.
Returns
the created node output that yields the variable's value when the loop exits

Definition at line 134 of file hls.cpp.

◆ addRequestOutput()

rvsdg::Output * jlm::hls::LoopNode::addRequestOutput ( rvsdg::Output origin)

Creates a node output / region result pair for sending requests out of the loop body. This output behaves as an escape hatch, and does not follow standard RVSDG semantics.

Parameters
originthe origin of the request inside the loop
Returns
the created node output

Definition at line 189 of file hls.cpp.

◆ addResponseInput()

rvsdg::Output * jlm::hls::LoopNode::addResponseInput ( rvsdg::Output origin)

Creates an input / region argument pair for sending responses into the loop body. This input behaves as an escape hatch, and does not follow standard RVSDG semantics.

Parameters
originthe origin of the response outside the loop
Returns
the created EntryArgument inside the loop region

Definition at line 181 of file hls.cpp.

◆ copy()

LoopNode * jlm::hls::LoopNode::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 228 of file hls.cpp.

◆ create()

LoopNode * jlm::hls::LoopNode::create ( rvsdg::Region parent,
bool  init = true 
)
static

Definition at line 294 of file hls.cpp.

◆ GetOperation()

const rvsdg::Operation & jlm::hls::LoopNode::GetOperation ( ) const
overridevirtualnoexcept

Implements jlm::rvsdg::Node.

Definition at line 221 of file hls.cpp.

◆ GetPredicateBuffer()

rvsdg::Output& jlm::hls::LoopNode::GetPredicateBuffer ( ) const
inlinenoexcept

Definition at line 739 of file hls.hpp.

◆ predicate()

rvsdg::RegionResult* jlm::hls::LoopNode::predicate ( ) const
inlinenoexcept

Definition at line 731 of file hls.hpp.

◆ removeLoopInput()

void jlm::hls::LoopNode::removeLoopInput ( rvsdg::StructuralInput input)

Removes the given node input, and the corresponding region argument.

Parameters
inputthe node input to remove. Its argument must be dead.

Definition at line 209 of file hls.cpp.

◆ removeLoopOutput()

void jlm::hls::LoopNode::removeLoopOutput ( rvsdg::StructuralOutput output)

Removes the given node output, and the corresponding region result.

Parameters
outputthe node output to remove. Must be dead.

Definition at line 197 of file hls.cpp.

◆ set_predicate()

void jlm::hls::LoopNode::set_predicate ( jlm::rvsdg::Output p)

Definition at line 311 of file hls.cpp.

◆ subregion()

rvsdg::Region* jlm::hls::LoopNode::subregion ( ) const
inlinenoexcept

Definition at line 725 of file hls.hpp.

Member Data Documentation

◆ PredicateBuffer_

rvsdg::Output* jlm::hls::LoopNode::PredicateBuffer_ {}
private

Definition at line 819 of file hls.hpp.


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