Files
triton/include/codegen/shared_copy.h

42 lines
680 B
C
Raw Normal View History

2019-01-23 02:07:53 -05:00
#ifndef TDL_INCLUDE_CODEGEN_SHARED_COPY_H
#define TDL_INCLUDE_CODEGEN_SHARED_COPY_H
#include <tuple>
#include <vector>
2019-01-23 02:07:53 -05:00
namespace tdl {
namespace ir {
class module;
2019-02-11 17:27:16 -05:00
class value;
class builder;
class basic_block;
2019-01-23 02:07:53 -05:00
}
namespace codegen{
class buffer_info_pass;
2019-01-23 02:07:53 -05:00
class place_shared_copy {
2019-02-11 17:27:16 -05:00
private:
typedef std::pair<unsigned, unsigned> interval_t;
typedef std::vector<interval_t> interval_vec_t;
private:
bool intersect(const interval_vec_t &I, interval_t i);
void add_copy(ir::value *x, ir::builder &builder);
2019-02-11 17:27:16 -05:00
2019-01-23 02:07:53 -05:00
public:
place_shared_copy(buffer_info_pass *info): info_(info) { }
2019-01-23 02:07:53 -05:00
void run(ir::module &mod);
private:
buffer_info_pass *info_;
2019-01-23 02:07:53 -05:00
};
}
}
#endif