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

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

Removed dummy nodes from the reassociation pass and have edges pointing to the if/while node instead to allow for proper topological ordering.

File size: 977 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 {
11    using Graph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS, PabloAST *>;
12public:
13    static bool optimize(PabloFunction & function);
14protected:
15    BooleanReassociationPass();
16    void resolveScopes(PabloFunction & function);
17    void resolveScopes(PabloBlock &block);
18    void processScopes(PabloFunction & function);
19    void processScopes(PabloBlock & block, std::vector<Statement *> && terminals);
20    void processScope(PabloBlock & block, std::vector<Statement *> && terminals);
21    void summarizeAST(PabloBlock & block, std::vector<Statement *> && terminals, Graph & G);
22private:
23    boost::container::flat_map<PabloBlock *, Statement *> mResolvedScopes;
24};
25
26}
27
28#endif // BOOLEANREASSOCIATIONPASS_H
Note: See TracBrowser for help on using the repository browser.