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
9namespace triton{
10
11namespace ir{
12 class value;
13 class function;
14 class module;
15}
16
17namespace codegen{
18namespace analysis{
19
20class tiles;
21
22class liveness;
23class cts;
24
25class allocation {
26public:
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
36private:
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