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

Last change on this file since 5160 was 5160, checked in by nmedfort, 3 years ago

Initial work for incorporating Types into Pablo AST.

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