source: icGREP/icgrep-devel/icgrep/pablo/passes/factorizedfg.h @ 4890

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

Continued work on multiplexing pass.

File size: 1014 bytes
Line 
1#ifndef FACTORIZEDFG_H
2#define FACTORIZEDFG_H
3
4#include <boost/container/flat_map.hpp>
5#include <vector>
6
7namespace pablo {
8
9class PabloFunction;
10class PabloBlock;
11class Variadic;
12class Not;
13class Statement;
14class PabloAST;
15
16class FactorizeDFG {
17    using ScopeDepth = boost::container::flat_map<const PabloBlock *, unsigned>;
18    using VertexSet = std::vector<PabloAST *>;
19public:
20    static void transform(PabloFunction & function);
21protected:   
22    void initialize(const PabloFunction & function);
23    void initialize(const PabloBlock * const block, const unsigned depth);
24    void CSE(PabloBlock * const block);
25    void CSE(Variadic * const var);
26    PabloBlock * chooseInsertionScope(const VertexSet & users);
27    void findInsertionPoint(const VertexSet & operands, PabloBlock * const scope);
28    void finalize(PabloBlock * const block);
29    Statement * finalize(Variadic * const var, PabloBlock * block);
30    FactorizeDFG() = default;
31private:
32    ScopeDepth  mScopeDepth;
33};
34
35}
36
37#endif // FACTORIZEDFG_H
Note: See TracBrowser for help on using the repository browser.