souffle
2.0.2-371-g6315b36
|
Hosts conditions in a loop-nest to the most-outer/semantically-correct loop. More...
#include <HoistConditions.h>
Public Member Functions | |
std::string | getName () const override |
@Brief get name of the transformer More... | |
bool | hoistConditions (Program &program) |
Hoist filter operations. More... | |
Public Member Functions inherited from souffle::ram::transform::Transformer | |
bool | apply (TranslationUnit &translationUnit) |
@Brief apply the transformer to a translation unit @Param translationUnit that will be transformed. More... | |
virtual | ~Transformer ()=default |
Protected Member Functions | |
bool | transform (TranslationUnit &translationUnit) override |
@Brief transform the translation unit / used by apply @Param translationUnit that will be transformed. More... | |
Protected Attributes | |
analysis::LevelAnalysis * | rla {nullptr} |
Hosts conditions in a loop-nest to the most-outer/semantically-correct loop.
Hoists the conditions to the earliest point in the loop nest where their evaluation is still semantically correct.
The transformations assumes that filter operations are stored verbose, i.e. a conjunction is expressed by two consecutive filter operations. For example ..
should be rewritten / or produced by the translator as
otherwise the levelling becomes imprecise, i.e., for both conditions the most outer-level is sought rather than considered separately.
If there are transformers prior to hoistConditions() that introduce conjunction, another transformer is required that splits the filter operations. However, at the moment this is not necessary because the translator delivers already the right RAM format.
TODO: break-up conditions while transforming so that this requirement is removed.
Definition at line 68 of file HoistConditions.h.
|
inlineoverridevirtual |
@Brief get name of the transformer
Implements souffle::ram::transform::Transformer.
Definition at line 70 of file HoistConditions.h.
bool souffle::ram::transform::HoistConditionsTransformer::hoistConditions | ( | Program & | program | ) |
Hoist filter operations.
program | that is transformed |
There are two types of conditions in filter operations. The first type depends on tuples of TupleOperation operations. The second type are independent of tuple access. Both types of conditions will be hoisted to the most out-scope such that the program is still valid.
Definition at line 34 of file HoistConditions.cpp.
|
inlineoverrideprotectedvirtual |
@Brief transform the translation unit / used by apply @Param translationUnit that will be transformed.
@Return flag reporting whether the RAM program has changed
Implements souffle::ram::transform::Transformer.
Definition at line 90 of file HoistConditions.h.
|
protected |
Definition at line 88 of file HoistConditions.h.