source: icGREP/icgrep-devel/icgrep/pablo/optimizers/pablo_simplifier.hpp @ 5202

Last change on this file since 5202 was 5202, checked in by nmedfort, 2 years ago

Initial work on adding types to PabloAST and mutable Var objects.

File size: 851 bytes
Line 
1#ifndef PABLO_SIMPLIFIER_HPP
2#define PABLO_SIMPLIFIER_HPP
3
4#include <pablo/codegenstate.h>
5
6namespace pablo {
7
8class PabloFunction;
9struct ExpressionTable;
10
11class Simplifier {
12    friend class BooleanReassociationPass;
13    struct VariableTable;
14public:
15    static bool optimize(PabloFunction & function);
16protected:
17    Simplifier() = default;
18private:
19    static PabloAST * fold(Variadic * var, PabloBlock * const block);
20    static PabloAST * fold(Statement * const stmt, PabloBlock * const block);
21    static void redundancyElimination(PabloBlock * const block, ExpressionTable * et = nullptr, VariableTable * const vt = nullptr);
22    static void deadCodeElimination(PabloFunction & f);
23    static void deadCodeElimination(PabloBlock * const block);
24    static void strengthReduction(PabloBlock * const block);
25};
26
27}
28#endif // PABLO_SIMPLIFIER_HPP
Note: See TracBrowser for help on using the repository browser.