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

Last change on this file since 4927 was 4927, checked in by nmedfort, 4 years ago

Bug fixes

File size: 825 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;
14public:
15    static bool optimize(PabloFunction & function);
16protected:
17    Simplifier() = default;
18private:
19    static void redundancyElimination(PabloBlock * const block, ExpressionTable * predecessor = nullptr);
20    static PabloAST * fold(Variadic * var, PabloBlock * const block);
21    static PabloAST * fold(Statement * const stmt, PabloBlock * const block);
22    static void deadCodeElimination(PabloBlock * const block);
23    static void strengthReduction(PabloBlock * const block);
24    static bool isSuperfluous(const Assign * const assign);
25};
26
27}
28#endif // PABLO_SIMPLIFIER_HPP
Note: See TracBrowser for help on using the repository browser.