docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::passes::MemletLinearization Class Reference

Linearizes memlet base types by flattening nested arrays. More...

#include <sdfg/passes/dataflow/memlet_linearization.h>

Inheritance diagram for sdfg::passes::MemletLinearization:
[legend]

Public Member Functions

 MemletLinearization (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager)
 Constructs a new MemletLinearization pass.
virtual bool accept (structured_control_flow::Block &block) override
 Accepts a block and linearizes memlets in its dataflow graph.
Public Member Functions inherited from sdfg::visitor::NonStoppingStructuredSDFGVisitor
 NonStoppingStructuredSDFGVisitor (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager)
bool visit () override
Public Member Functions inherited from sdfg::visitor::StructuredSDFGVisitor
 StructuredSDFGVisitor (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager)
virtual ~StructuredSDFGVisitor ()=default
virtual bool accept (structured_control_flow::AssignmentBlock &node)
virtual bool accept (structured_control_flow::Sequence &node)
virtual bool accept (structured_control_flow::Return &node)
virtual bool accept (structured_control_flow::IfElse &node)
virtual bool accept (structured_control_flow::For &node)
virtual bool accept (structured_control_flow::While &node)
virtual bool accept (structured_control_flow::Continue &node)
virtual bool accept (structured_control_flow::Break &node)
virtual bool accept (structured_control_flow::Map &node)
virtual bool accept (structured_control_flow::Reduce &node)

Static Public Member Functions

static std::string name ()
 Returns the name of the pass.

Additional Inherited Members

Protected Member Functions inherited from sdfg::visitor::NonStoppingStructuredSDFGVisitor
bool visit_internal (structured_control_flow::Sequence &parent) override
Protected Attributes inherited from sdfg::visitor::StructuredSDFGVisitor
builder::StructuredSDFGBuilder & builder_
analysis::AnalysisManager & analysis_manager_

Detailed Description

Linearizes memlet base types by flattening nested arrays.

This pass transforms memlets that have pointer base types pointing to nested arrays. It converts such pointers into flat pointers to the innermost element type, and adjusts the subset accordingly by linearizing multi-dimensional array accesses into a single linear index.

For example, a pointer to int[3][4] with subset [i, j] becomes a pointer to int with subset [i * 4 + j].

This linearization simplifies subsequent passes and code generation by eliminating nested array types in pointer pointees.

Constructor & Destructor Documentation

◆ MemletLinearization()

sdfg::passes::MemletLinearization::MemletLinearization ( builder::StructuredSDFGBuilder & builder,
analysis::AnalysisManager & analysis_manager )

Constructs a new MemletLinearization pass.

Parameters
builderThe structured SDFG builder
analysis_managerThe analysis manager

Member Function Documentation

◆ accept()

virtual bool sdfg::passes::MemletLinearization::accept ( structured_control_flow::Block & block)
overridevirtual

Accepts a block and linearizes memlets in its dataflow graph.

Parameters
blockThe block to process
Returns
true if any memlets were linearized

Reimplemented from sdfg::visitor::StructuredSDFGVisitor.

◆ name()

std::string sdfg::passes::MemletLinearization::name ( )
inlinestatic

Returns the name of the pass.

Returns
The string "MemletLinearization"

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