1#ifndef TRITON_INCLUDE_IR_CODEGEN_SWIZZLE_H
2#define TRITON_INCLUDE_IR_CODEGEN_SWIZZLE_H
3
4#include <map>
5
6namespace triton{
7
8namespace ir{
9 class module;
10}
11
12namespace codegen{
13class target;
14
15namespace analysis{
16
17class layouts;
18class data_layout;
19
20class swizzle {
21public:
22 // constructor
23 swizzle(layouts *l, target* tgt): layouts_(l), tgt_(tgt){ }
24 // accessors
25 int get_per_phase(data_layout* layout) { return per_phase_.at(layout); }
26 int get_max_phase(data_layout* layout) { return max_phase_.at(layout); }
27 int get_vec (data_layout* layout) { return vec_.at(layout); }
28 // run
29 void run(ir::module &mod);
30private:
31 layouts* layouts_;
32 target* tgt_;
33 std::map<data_layout*, int> per_phase_;
34 std::map<data_layout*, int> max_phase_;
35 std::map<data_layout*, int> vec_;
36};
37
38}
39}
40}
41
42
43#endif
44