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

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

More work on n-ary operations. Unresolved bug in DistributionPass?.

File size: 1008 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 Statement;
13class PabloAST;
14
15class FactorizeDFG {
16    using ScopeDepth = boost::container::flat_map<const PabloBlock *, unsigned>;
17    using VertexSet = std::vector<PabloAST *>;
18public:
19    static void transform(PabloFunction & function);
20protected:   
21    void initialize(const PabloFunction & function);
22    void initialize(const PabloBlock * const block, const unsigned depth);
23    void factorize(PabloBlock * const block);
24    void factorize(Variadic * const var);
25    PabloBlock * chooseInsertionScope(const VertexSet & users);
26    void findInsertionPoint(const VertexSet & operands, PabloBlock * const scope);
27    void finalize(PabloBlock * const block);
28    void finalize(Variadic * const var, PabloBlock * block);
29    FactorizeDFG() = default;
30private:
31    ScopeDepth  mScopeDepth;
32};
33
34}
35
36#endif // FACTORIZEDFG_H
Note: See TracBrowser for help on using the repository browser.