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

Computes the read-after-write relation between users. More...

#include <sdfg/analysis/data_dependency_analysis.h>

Inheritance diagram for sdfg::analysis::DataDependencyAnalysis:
[legend]

Public Member Functions

 DataDependencyAnalysis (StructuredSDFG &sdfg)
 DataDependencyAnalysis (StructuredSDFG &sdfg, structured_control_flow::Sequence &node)
 DataDependencyAnalysis (StructuredSDFG &sdfg, structured_control_flow::StructuredLoop &loop)
void set_detailed (bool detailed)
std::string name () const override
void run (analysis::AnalysisManager &analysis_manager) override
void visit_block (analysis::AnalysisManager &analysis_manager, structured_control_flow::Block &block, std::unordered_set< User * > &undefined, std::unordered_map< User *, std::unordered_set< User * > > &open_definitions, std::unordered_map< User *, std::unordered_set< User * > > &closed_definitions)
void visit_assignment_block (analysis::AnalysisManager &analysis_manager, structured_control_flow::AssignmentBlock &assignments, std::unordered_set< User * > &undefined, std::unordered_map< User *, std::unordered_set< User * > > &open_definitions, std::unordered_map< User *, std::unordered_set< User * > > &closed_definitions)
void visit_for (analysis::AnalysisManager &analysis_manager, structured_control_flow::StructuredLoop &for_loop, std::unordered_set< User * > &undefined, std::unordered_map< User *, std::unordered_set< User * > > &open_definitions, std::unordered_map< User *, std::unordered_set< User * > > &closed_definitions)
void visit_if_else (analysis::AnalysisManager &analysis_manager, structured_control_flow::IfElse &if_loop, std::unordered_set< User * > &undefined, std::unordered_map< User *, std::unordered_set< User * > > &open_definitions, std::unordered_map< User *, std::unordered_set< User * > > &closed_definitions)
void visit_while (analysis::AnalysisManager &analysis_manager, structured_control_flow::While &while_loop, std::unordered_set< User * > &undefined, std::unordered_map< User *, std::unordered_set< User * > > &open_definitions, std::unordered_map< User *, std::unordered_set< User * > > &closed_definitions)
void visit_return (analysis::AnalysisManager &analysis_manager, structured_control_flow::Return &return_statement, std::unordered_set< User * > &undefined, std::unordered_map< User *, std::unordered_set< User * > > &open_definitions, std::unordered_map< User *, std::unordered_set< User * > > &closed_definitions)
void visit_sequence (analysis::AnalysisManager &analysis_manager, structured_control_flow::Sequence &sequence, std::unordered_set< User * > &undefined, std::unordered_map< User *, std::unordered_set< User * > > &open_definitions, std::unordered_map< User *, std::unordered_set< User * > > &closed_definitions)
std::unordered_set< User * > defines (User &write)
 Get the users (reads) of a definition (write).
std::unordered_map< User *, std::unordered_set< User * > > definitions (const std::string &container)
 Get all definitions (writes) and their users (reads).
std::unordered_map< User *, std::unordered_set< User * > > defined_by (const std::string &container)
 Get all definitions (writes) for each user (reads).
std::unordered_set< User * > defined_by (User &read)
 Get all definitions (writes) for a user (read).
bool is_undefined_user (User &user) const
bool has_loop_boundary (structured_control_flow::StructuredLoop &loop) const
 Whether boundary snapshots are available for the given loop.
const std::unordered_set< User * > & upward_exposed_reads (structured_control_flow::StructuredLoop &loop) const
 Reads inside loop's body that are upward-exposed at the loop boundary (i.e.
const std::unordered_map< User *, std::unordered_set< User * > > & escaping_definitions (structured_control_flow::StructuredLoop &loop) const
 Writes inside loop's body that escape the body (i.e.
Public Member Functions inherited from sdfg::analysis::Analysis
 Analysis (StructuredSDFG &sdfg)
 Analysis (StructuredSDFG &sdfg, const Options &options)
virtual ~Analysis ()=default
virtual bool invalidate (structured_control_flow::ControlFlowNode &changed)
 Updates the analysis after a change confined to the subtree of changed.
 Analysis (const Analysis &a)=delete
Analysis & operator= (const Analysis &)=delete

Friends

class AnalysisManager

Additional Inherited Members

Protected Member Functions inherited from sdfg::analysis::Analysis
template<class T>
T option (const OptionKey< T > &key, T fallback=T{}) const
Protected Attributes inherited from sdfg::analysis::Analysis
StructuredSDFG & sdfg_
symbolic::Assumptions additional_assumptions_
const Options * options_ = &Options::empty()

Detailed Description

Computes the read-after-write relation between users.

This analysis computes for each definition (write) the set of users (reads).

A definition open when a container is written to. A definition remains open until a new definition to the same container is encountered, that dominates the previous definition in terms of:

  • control-flow
  • subsets (multi-dimensional containers)

Constructor & Destructor Documentation

◆ DataDependencyAnalysis() [1/3]

sdfg::analysis::DataDependencyAnalysis::DataDependencyAnalysis ( StructuredSDFG & sdfg)

◆ DataDependencyAnalysis() [2/3]

sdfg::analysis::DataDependencyAnalysis::DataDependencyAnalysis ( StructuredSDFG & sdfg,
structured_control_flow::Sequence & node )

◆ DataDependencyAnalysis() [3/3]

sdfg::analysis::DataDependencyAnalysis::DataDependencyAnalysis ( StructuredSDFG & sdfg,
structured_control_flow::StructuredLoop & loop )

Member Function Documentation

◆ defined_by() [1/2]

std::unordered_map< User *, std::unordered_set< User * > > sdfg::analysis::DataDependencyAnalysis::defined_by ( const std::string & container)

Get all definitions (writes) for each user (reads).

Parameters
Thecontainer of the definitions.
Returns
The users (reads) and their definitions (writes).

◆ defined_by() [2/2]

std::unordered_set< User * > sdfg::analysis::DataDependencyAnalysis::defined_by ( User & read)

Get all definitions (writes) for a user (read).

Parameters
Theuser (read).
Returns
The definitions (writes) of the user.

◆ defines()

std::unordered_set< User * > sdfg::analysis::DataDependencyAnalysis::defines ( User & write)

Get the users (reads) of a definition (write).

Parameters
writethe definition (write)
Returns
The users (reads) of the definition.

◆ definitions()

std::unordered_map< User *, std::unordered_set< User * > > sdfg::analysis::DataDependencyAnalysis::definitions ( const std::string & container)

Get all definitions (writes) and their users (reads).

Parameters
Thecontainer of the definitions.
Returns
The definitions and their users.

◆ escaping_definitions()

const std::unordered_map< User *, std::unordered_set< User * > > & sdfg::analysis::DataDependencyAnalysis::escaping_definitions ( structured_control_flow::StructuredLoop & loop) const

Writes inside loop's body that escape the body (i.e.

are live-out at the loop boundary or feed a future iteration of loop).

◆ has_loop_boundary()

bool sdfg::analysis::DataDependencyAnalysis::has_loop_boundary ( structured_control_flow::StructuredLoop & loop) const

Whether boundary snapshots are available for the given loop.

◆ is_undefined_user()

bool sdfg::analysis::DataDependencyAnalysis::is_undefined_user ( User & user) const

◆ name()

std::string sdfg::analysis::DataDependencyAnalysis::name ( ) const
inlineoverridevirtual

◆ run()

void sdfg::analysis::DataDependencyAnalysis::run ( analysis::AnalysisManager & analysis_manager)
overridevirtual

◆ set_detailed()

void sdfg::analysis::DataDependencyAnalysis::set_detailed ( bool detailed)
inline

◆ upward_exposed_reads()

const std::unordered_set< User * > & sdfg::analysis::DataDependencyAnalysis::upward_exposed_reads ( structured_control_flow::StructuredLoop & loop) const

Reads inside loop's body that are upward-exposed at the loop boundary (i.e.

not satisfied by a definition inside the body).

◆ visit_assignment_block()

void sdfg::analysis::DataDependencyAnalysis::visit_assignment_block ( analysis::AnalysisManager & analysis_manager,
structured_control_flow::AssignmentBlock & assignments,
std::unordered_set< User * > & undefined,
std::unordered_map< User *, std::unordered_set< User * > > & open_definitions,
std::unordered_map< User *, std::unordered_set< User * > > & closed_definitions )

◆ visit_block()

void sdfg::analysis::DataDependencyAnalysis::visit_block ( analysis::AnalysisManager & analysis_manager,
structured_control_flow::Block & block,
std::unordered_set< User * > & undefined,
std::unordered_map< User *, std::unordered_set< User * > > & open_definitions,
std::unordered_map< User *, std::unordered_set< User * > > & closed_definitions )

◆ visit_for()

void sdfg::analysis::DataDependencyAnalysis::visit_for ( analysis::AnalysisManager & analysis_manager,
structured_control_flow::StructuredLoop & for_loop,
std::unordered_set< User * > & undefined,
std::unordered_map< User *, std::unordered_set< User * > > & open_definitions,
std::unordered_map< User *, std::unordered_set< User * > > & closed_definitions )

◆ visit_if_else()

void sdfg::analysis::DataDependencyAnalysis::visit_if_else ( analysis::AnalysisManager & analysis_manager,
structured_control_flow::IfElse & if_loop,
std::unordered_set< User * > & undefined,
std::unordered_map< User *, std::unordered_set< User * > > & open_definitions,
std::unordered_map< User *, std::unordered_set< User * > > & closed_definitions )

◆ visit_return()

void sdfg::analysis::DataDependencyAnalysis::visit_return ( analysis::AnalysisManager & analysis_manager,
structured_control_flow::Return & return_statement,
std::unordered_set< User * > & undefined,
std::unordered_map< User *, std::unordered_set< User * > > & open_definitions,
std::unordered_map< User *, std::unordered_set< User * > > & closed_definitions )

◆ visit_sequence()

void sdfg::analysis::DataDependencyAnalysis::visit_sequence ( analysis::AnalysisManager & analysis_manager,
structured_control_flow::Sequence & sequence,
std::unordered_set< User * > & undefined,
std::unordered_map< User *, std::unordered_set< User * > > & open_definitions,
std::unordered_map< User *, std::unordered_set< User * > > & closed_definitions )

◆ visit_while()

void sdfg::analysis::DataDependencyAnalysis::visit_while ( analysis::AnalysisManager & analysis_manager,
structured_control_flow::While & while_loop,
std::unordered_set< User * > & undefined,
std::unordered_map< User *, std::unordered_set< User * > > & open_definitions,
std::unordered_map< User *, std::unordered_set< User * > > & closed_definitions )

◆ AnalysisManager

friend class AnalysisManager
friend

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