1 | #ifndef TDL_INCLUDE_IR_CODEGEN_STORAGE_ALLOC_H |
---|---|
2 | #define TDL_INCLUDE_IR_CODEGEN_STORAGE_ALLOC_H |
3 | |
4 | #include <map> |
5 | #include <set> |
6 | #include <iostream> |
7 | #include "triton/codegen/analysis/liveness.h" |
8 | |
9 | namespace triton{ |
10 | |
11 | namespace ir{ |
12 | class value; |
13 | class function; |
14 | class module; |
15 | } |
16 | |
17 | namespace codegen{ |
18 | namespace analysis{ |
19 | |
20 | class tiles; |
21 | |
22 | class liveness; |
23 | class cts; |
24 | |
25 | class allocation { |
26 | public: |
27 | allocation(liveness *live) |
28 | : liveness_(live) { } |
29 | // accessors |
30 | bool has_offset(const data_layout *x) const { return offsets_.find(x) != offsets_.end(); } |
31 | unsigned offset(const data_layout *x) const { return offsets_.at(x); } |
32 | unsigned allocated_size() const { return allocated_size_; } |
33 | // run |
34 | void run(ir::module& mod); |
35 | |
36 | private: |
37 | std::map<const data_layout*, unsigned> offsets_; |
38 | size_t allocated_size_; |
39 | // dependences |
40 | liveness *liveness_; |
41 | }; |
42 | |
43 | } |
44 | } |
45 | } |
46 | |
47 | #endif |
48 |