1 | #ifndef TDL_INCLUDE_CODEGEN_BUFFER_INFO_PASS_H |
2 | #define TDL_INCLUDE_CODEGEN_BUFFER_INFO_PASS_H |
3 | |
4 | #include <set> |
5 | #include <map> |
6 | |
7 | namespace triton { |
8 | |
9 | namespace ir { |
10 | class module; |
11 | class value; |
12 | class phi_node; |
13 | class instruction; |
14 | class builder; |
15 | } |
16 | |
17 | namespace codegen{ |
18 | |
19 | namespace analysis{ |
20 | class layouts; |
21 | } |
22 | |
23 | namespace transform{ |
24 | |
25 | class cts { |
26 | private: |
27 | bool is_shmem_op(ir::instruction* i, int op); |
28 | bool is_shmem_res(ir::value* i); |
29 | void add_copy(ir::instruction *parent, ir::value *x, ir::builder &builder, bool to_shared, std::map<ir::value*,ir::value*>& copies); |
30 | |
31 | public: |
32 | cts(analysis::layouts* layouts, bool has_sm80 = false): layouts_(layouts), has_sm80_(has_sm80) {} |
33 | void run(ir::module &mod); |
34 | |
35 | private: |
36 | bool has_sm80_; |
37 | analysis::layouts* layouts_; |
38 | }; |
39 | |
40 | } |
41 | } |
42 | } |
43 | |
44 | #endif |