source: icGREP/icgrep-devel/icgrep/pablo/optimizers/booleanreassociationpass.h @ 4754

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

Start of work on applying the distribution law to the AST.

File size: 978 bytes
Line 
1#ifndef BOOLEANREASSOCIATIONPASS_H
2#define BOOLEANREASSOCIATIONPASS_H
3
4#include <pablo/codegenstate.h>
5#include <boost/container/flat_map.hpp>
6#include <boost/graph/adjacency_list.hpp>
7
8namespace pablo {
9
10class BooleanReassociationPass {
11public:
12    using Graph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS, PabloAST *>;
13
14    static bool optimize(PabloFunction & function);
15protected:
16    BooleanReassociationPass();
17    void resolveScopes(PabloFunction & function);
18    void resolveScopes(PabloBlock &block);
19    void processScopes(PabloFunction & function);
20    void processScopes(PabloBlock & block, std::vector<Statement *> && terminals);
21    void processScope(PabloBlock & block, std::vector<Statement *> && terminals);
22    void summarizeAST(PabloBlock & block, std::vector<Statement *> && terminals, Graph & G);
23private:
24    boost::container::flat_map<PabloBlock *, Statement *> mResolvedScopes;
25};
26
27}
28
29#endif // BOOLEANREASSOCIATIONPASS_H
Note: See TracBrowser for help on using the repository browser.