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

Loop splitting transformation at a symbolic boundary. More...

#include <sdfg/transformations/loop_split.h>

Inheritance diagram for sdfg::transformations::LoopSplit:
[legend]

Public Member Functions

 LoopSplit (structured_control_flow::StructuredLoop &loop, const symbolic::Expression &split_point)
 Construct a loop split transformation.
virtual std::string name () const override
 Get the name of this transformation.
virtual bool can_be_applied (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override
 Check if this transformation can be safely applied.
virtual void apply (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override
 Apply this transformation to the SDFG.
virtual void to_json (nlohmann::json &j) const override
 Serialize this transformation to JSON.
Public Member Functions inherited from sdfg::transformations::Transformation
virtual ~Transformation ()=default
virtual void set_report (PassReportConsumer *report)
 Set the report consumer for transformation feedback.
virtual bool try_apply (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager)
 Attempt to apply the transformation if possible.

Static Public Member Functions

static LoopSplit from_json (builder::StructuredSDFGBuilder &builder, const nlohmann::json &j)

Additional Inherited Members

Protected Attributes inherited from sdfg::transformations::Transformation
PassReportConsumer * report_ = nullptr

Detailed Description

Loop splitting transformation at a symbolic boundary.

Splits a single loop into two consecutive loops at the same nesting level, partitioning the iteration space at a symbolic split point.

Given: for (i = init; i < bound; i = update) { body }

Produces: for (i = init; i < split_point; i = update) { body_copy } for (i = split_point; i < bound; i = update) { body }

The split point is an arbitrary symbolic expression (e.g., an enclosing loop's induction variable). The transformation is always semantically correct — it is an identity on the iteration space: [init, bound) = [init, split_point) ∪ [split_point, bound)

If split_point <= init, the first loop is empty (zero iterations). If split_point >= bound, the second loop is empty (zero iterations).

Note
The loop must be contiguous (stride == 1)
The loop condition must be a simple strict-less-than (indvar < bound)
The split_point must be a valid symbolic expression in scope

Primary use case: enabling LoopDistribute on triangular loop nests (e.g., splitting k in [0, i) at i_tile0 for blocked LU factorization).

Constructor & Destructor Documentation

◆ LoopSplit()

sdfg::transformations::LoopSplit::LoopSplit ( structured_control_flow::StructuredLoop & loop,
const symbolic::Expression & split_point )

Construct a loop split transformation.

Parameters
loopThe loop to split
split_pointSymbolic expression at which to split the iteration space

Member Function Documentation

◆ apply()

virtual void sdfg::transformations::LoopSplit::apply ( builder::StructuredSDFGBuilder & builder,
analysis::AnalysisManager & analysis_manager )
overridevirtual

Apply this transformation to the SDFG.

Parameters
builderThe SDFG builder
analysis_managerThe analysis manager (may be invalidated)

Implements sdfg::transformations::Transformation.

◆ can_be_applied()

virtual bool sdfg::transformations::LoopSplit::can_be_applied ( builder::StructuredSDFGBuilder & builder,
analysis::AnalysisManager & analysis_manager )
overridevirtual

Check if this transformation can be safely applied.

Parameters
builderThe SDFG builder
analysis_managerThe analysis manager providing necessary analyses
Returns
true if all preconditions are met

Implements sdfg::transformations::Transformation.

◆ from_json()

LoopSplit sdfg::transformations::LoopSplit::from_json ( builder::StructuredSDFGBuilder & builder,
const nlohmann::json & j )
static

◆ name()

virtual std::string sdfg::transformations::LoopSplit::name ( ) const
overridevirtual

Get the name of this transformation.

Returns
The transformation name (e.g., "LoopInterchange")

Implements sdfg::transformations::Transformation.

◆ to_json()

virtual void sdfg::transformations::LoopSplit::to_json ( nlohmann::json & j) const
overridevirtual

Serialize this transformation to JSON.

Parameters
jJSON object to populate with transformation description
Exceptions
std::logic_errorif not implemented

Implements sdfg::transformations::Transformation.


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