source: icGREP/icgrep-devel/icgrep/pablo/optimizers/schedulingprepass.h @ 4896

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

Work on coalescing algorithm + minor changes.

File size: 1.1 KB
Line 
1#ifndef SCHEDULINGPREPASS_H
2#define SCHEDULINGPREPASS_H
3
4#include <boost/container/flat_map.hpp>
5#include <boost/graph/adjacency_list.hpp>
6#include <unordered_map>
7
8namespace pablo {
9
10class PabloFunction;
11class PabloBlock;
12class Statement;
13class PabloAST;
14
15class SchedulingPrePass {
16public:
17    using Graph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS, PabloAST *>;
18    using Vertex = Graph::vertex_descriptor;
19    using Map = std::unordered_map<const PabloAST *, Vertex>;
20    using ScopeMap = boost::container::flat_map<const PabloBlock *, Statement *>;
21    using ReadyPair = std::pair<unsigned, Vertex>;
22    using ReadySet = std::vector<ReadyPair>;
23public:
24    static bool optimize(PabloFunction & function);
25protected:
26    void schedule(PabloFunction & function);
27    void schedule(PabloBlock * const block);
28    void resolveNestedUsages(Statement * const root, Statement * const stmt, Graph & G, Map & M, PabloBlock * const block);
29    SchedulingPrePass() = default;
30private:
31    ScopeMap mResolvedScopes;
32};
33
34
35}
36
37
38#endif // SCHEDULINGPREPASS_H
Note: See TracBrowser for help on using the repository browser.