souffle
2.0.2-371-g6315b36
|
Convert IndexScan operations to Filter/Existence Checks. More...
#include <IfConversion.h>
Public Member Functions | |
bool | convertIndexScans (Program &program) |
Apply if-conversion to the whole program. More... | |
std::string | getName () const override |
@Brief get name of the transformer More... | |
Own< Operation > | rewriteIndexScan (const IndexScan *indexScan) |
Rewrite IndexScan 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... | |
Convert IndexScan operations to Filter/Existence Checks.
If there exists IndexScan operations in the RAM, and their tuples are not further used in subsequent operations, the IndexScan operations will be rewritten to Filter/Existence Checks.
For example,
will be rewritten to
Definition at line 58 of file IfConversion.h.
bool souffle::ram::transform::IfConversionTransformer::convertIndexScans | ( | Program & | program | ) |
Apply if-conversion to the whole program.
RAM | program |
Search for queries and rewrite their IndexScan operations if possible.
Definition at line 80 of file IfConversion.cpp.
References rewriteIndexScan().
|
inlineoverridevirtual |
@Brief get name of the transformer
Implements souffle::ram::transform::Transformer.
Definition at line 60 of file IfConversion.h.
Own< Operation > souffle::ram::transform::IfConversionTransformer::rewriteIndexScan | ( | const IndexScan * | indexScan | ) |
Rewrite IndexScan operations.
indexScan | An index operation |
Rewrites IndexScan operations to a filter/existence check if the IndexScan's tuple is not used in a consecutive RAM operation
Definition at line 37 of file IfConversion.cpp.
Referenced by convertIndexScans().
|
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 84 of file IfConversion.h.