Jlm
Loading...
Searching...
No Matches
Classes | 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]

Classes

struct  BackEdgeVar
 Variable passed between hls loop iterations. More...
 
struct  EntryVar
 Variable entering the hls loop. More...
 
struct  ExitVar
 Variable exiting the hls loop. More...
 

Public Member Functions

 ~LoopNode () noexcept override=default
 
const rvsdg::Operation & GetOperation () const noexcept override
 
EntryVar mapInput (const rvsdg::Input &input)
 
ExitVar mapOutput (const rvsdg::Output &output)
 
std::variant< EntryVar, BackEdgeVar > mapArgument (const rvsdg::Output &argument)
 
std::variant< ExitVar, BackEdgeVar > mapResult (const rvsdg::Input &result)
 
std::vector< EntryVar > getEntryVars ()
 
std::vector< ExitVar > getExitVars ()
 
std::vector< BackEdgeVar > getBackEdgeVars ()
 
void removeEntryVars (std::vector< EntryVar > vars)
 
void removeExitVars (std::vector< ExitVar > vars)
 
void removeBackEdgeVars (std::vector< BackEdgeVar > vars)
 
rvsdg::Region * subregion () const noexcept
 
rvsdg::RegionResult * predicate () const noexcept
 
rvsdg::Output & GetPredicateBuffer () const noexcept
 
void set_predicate (jlm::rvsdg::Output *p)
 
BackEdgeArgument * add_backedge (std::shared_ptr< const jlm::rvsdg::Type > type)
 
rvsdg::StructuralOutput * AddLoopVar (rvsdg::Output *origin, rvsdg::Output **buffer=nullptr)
 
rvsdg::Output * addLoopConstant (rvsdg::Output *origin)
 
rvsdg::Output * addResponseInput (rvsdg::Output *origin)
 
rvsdg::Output * addRequestOutput (rvsdg::Output *origin)
 
LoopNode * copy (rvsdg::Region *region, rvsdg::SubstitutionMap &smap) const override
 Copy a node with substitutions.
 
- Public Member Functions inherited from jlm::rvsdg::StructuralNode
 ~StructuralNode () noexcept override
 
std::string DebugString () const override
 
size_t nsubregions () const noexcept
 
rvsdg::Region * subregion (size_t index) const noexcept
 
SubregionIteratorRange Subregions ()
 
SubregionConstIteratorRange Subregions () const
 
StructuralInput * input (size_t index) const noexcept
 
StructuralOutput * output (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
 
NodeInput * input (size_t index) const noexcept
 
InputIteratorRange Inputs () noexcept
 
InputConstIteratorRange Inputs () const noexcept
 
size_t noutputs () const noexcept
 
NodeOutput * output (size_t index) const noexcept
 
OutputIteratorRange Outputs () noexcept
 
OutputConstIteratorRange Outputs () const noexcept
 
bool IsDead () const noexcept
 Determines whether the node is dead.
 
std::size_t numSuccessors () const noexcept
 
size_t RemoveInputs (const util::HashSet< size_t > &indices)
 
size_t RemoveOutputs (const util::HashSet< size_t > &indices)
 
Graph * graph () const noexcept
 
rvsdg::Region * region () const noexcept
 
virtual Node * copy (rvsdg::Region *region, const std::vector< jlm::rvsdg::Output * > &operands) const
 

Static Public Member Functions

static LoopNode * create (rvsdg::Region *parent)
 

Private Member Functions

 LoopNode (rvsdg::Region *parent)
 

Private Attributes

rvsdg::Output * PredicateBuffer_ {}
 

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)
 
StructuralInput * addInput (std::unique_ptr< StructuralInput > input, bool notifyRegion)
 
StructuralOutput * addOutput (std::unique_ptr< StructuralOutput > input)
 
- Protected Member Functions inherited from jlm::rvsdg::Node
NodeInput * addInput (std::unique_ptr< NodeInput > input, bool notifyRegion)
 
NodeOutput * addOutput (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 400 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 171 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 135 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 190 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 182 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 344 of file hls.cpp.

◆ create()

LoopNode * jlm::hls::LoopNode::create ( rvsdg::Region *  parent)
static

Definition at line 410 of file hls.cpp.

◆ getBackEdgeVars()

std::vector< LoopNode::BackEdgeVar > jlm::hls::LoopNode::getBackEdgeVars ( )

Definition at line 279 of file hls.cpp.

◆ getEntryVars()

std::vector< LoopNode::EntryVar > jlm::hls::LoopNode::getEntryVars ( )

Definition at line 257 of file hls.cpp.

◆ getExitVars()

std::vector< LoopNode::ExitVar > jlm::hls::LoopNode::getExitVars ( )

Definition at line 268 of file hls.cpp.

◆ GetOperation()

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

Implements jlm::rvsdg::Node.

Definition at line 198 of file hls.cpp.

◆ GetPredicateBuffer()

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

Definition at line 814 of file hls.hpp.

◆ mapArgument()

std::variant< LoopNode::EntryVar, LoopNode::BackEdgeVar > jlm::hls::LoopNode::mapArgument ( const rvsdg::Output &  argument)

Definition at line 221 of file hls.cpp.

◆ mapInput()

LoopNode::EntryVar jlm::hls::LoopNode::mapInput ( const rvsdg::Input &  input)

Definition at line 205 of file hls.cpp.

◆ mapOutput()

LoopNode::ExitVar jlm::hls::LoopNode::mapOutput ( const rvsdg::Output &  output)

Definition at line 213 of file hls.cpp.

◆ mapResult()

std::variant< LoopNode::ExitVar, LoopNode::BackEdgeVar > jlm::hls::LoopNode::mapResult ( const rvsdg::Input &  result)

Definition at line 239 of file hls.cpp.

◆ predicate()

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

Definition at line 806 of file hls.hpp.

◆ removeBackEdgeVars()

void jlm::hls::LoopNode::removeBackEdgeVars ( std::vector< BackEdgeVar >  vars)

Definition at line 328 of file hls.cpp.

◆ removeEntryVars()

void jlm::hls::LoopNode::removeEntryVars ( std::vector< EntryVar >  vars)

Definition at line 294 of file hls.cpp.

◆ removeExitVars()

void jlm::hls::LoopNode::removeExitVars ( std::vector< ExitVar >  vars)

Definition at line 311 of file hls.cpp.

◆ set_predicate()

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

Definition at line 424 of file hls.cpp.

◆ subregion()

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

Definition at line 800 of file hls.hpp.

Member Data Documentation

◆ PredicateBuffer_

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

Definition at line 880 of file hls.hpp.


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