|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Ensures every structured loop has a unique induction variable. More...
#include <sdfg/passes/structured_control_flow/unique_loop_indvars.h>
Public Member Functions | |
| UniqueLoopIndvars () | |
| std::string | name () override |
| virtual bool | run_pass (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override |
| Public Member Functions inherited from sdfg::passes::Pass | |
| Pass ()=default | |
| Pass (const Options &options) | |
| virtual | ~Pass ()=default |
| virtual std::vector< OptionSpec > | options () |
| bool | run (builder::SDFGBuilder &builder, bool create_report=false) |
| bool | run (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager, bool create_report=false) |
| virtual bool | run_pass (builder::SDFGBuilder &builder) |
| virtual void | invalidates (analysis::AnalysisManager &analysis_manager, bool applied) |
Additional Inherited Members | |
| Protected Member Functions inherited from sdfg::passes::Pass | |
| template<class T> | |
| T | option (const OptionKey< T > &key, T fallback=T{}) const |
Ensures every structured loop has a unique induction variable.
Traverses all structured loops in the SDFG (via the structured visitor). Each loop's induction variable is recorded in a set of already-used names. If a loop reuses an induction variable that has already been seen (e.g. two sibling or nested loops both named i), and that induction variable is genuinely read inside the loop, the loop's induction variable is renamed to a fresh container and every use of the old symbol within that loop (init, update, condition and body) is replaced.
Whether the induction variable is genuinely read is decided with the Users analysis: there must be a read user that depends on the loop's update user and that is not the loop-control use of another loop (i.e. an actual data read).
Disambiguating shared induction variables is required for downstream analyses (e.g. argument-size/subset inference for offloading) that key on the symbol of a loop variable and would otherwise treat a nested loop variable as a free symbol.
| sdfg::passes::UniqueLoopIndvars::UniqueLoopIndvars | ( | ) |
|
overridevirtual |
Implements sdfg::passes::Pass.
|
overridevirtual |
Reimplemented from sdfg::passes::Pass.