some cleaning
This commit is contained in:
@@ -16,12 +16,12 @@ namespace codegen{
|
||||
class layout;
|
||||
class target_tuner;
|
||||
class liveness;
|
||||
class loop_info;
|
||||
class buffer_info_pass;
|
||||
|
||||
class allocation {
|
||||
public:
|
||||
allocation(liveness *live)
|
||||
: liveness_(live){ }
|
||||
allocation(liveness *live, buffer_info_pass *buffer_info)
|
||||
: liveness_(live), buffer_info_(buffer_info){ }
|
||||
|
||||
// accessors
|
||||
unsigned get_offset(ir::value *x) const { return offsets_.at(x); }
|
||||
@@ -36,6 +36,7 @@ private:
|
||||
size_t allocated_size_;
|
||||
// dependences
|
||||
liveness *liveness_;
|
||||
buffer_info_pass *buffer_info_;
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -15,6 +15,8 @@ namespace codegen{
|
||||
|
||||
typedef unsigned slot_index;
|
||||
|
||||
class buffer_info_pass;
|
||||
|
||||
struct segment {
|
||||
slot_index start;
|
||||
slot_index end;
|
||||
@@ -35,11 +37,13 @@ private:
|
||||
typedef std::map<ir::value*, bool> has_storage_map_t;
|
||||
|
||||
public:
|
||||
/// Intervals iterators...
|
||||
// Intervals iterators
|
||||
using iterator = intervals_map_t::iterator;
|
||||
using const_iterator = intervals_map_t::const_iterator;
|
||||
|
||||
public:
|
||||
// constructor
|
||||
liveness(buffer_info_pass *info): info_(info){ }
|
||||
|
||||
// accessors
|
||||
const intervals_map_t& intervals() const { return intervals_; }
|
||||
@@ -49,6 +53,7 @@ public:
|
||||
void run(ir::module &mod);
|
||||
|
||||
private:
|
||||
buffer_info_pass *info_;
|
||||
has_storage_map_t has_dedicated_storage_;
|
||||
indices_map_t indices_;
|
||||
intervals_map_t intervals_;
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "ir/module.h"
|
||||
#include "ir/function.h"
|
||||
#include "ir/type.h"
|
||||
#include "codegen/buffer_info.h"
|
||||
|
||||
|
||||
namespace llvm{
|
||||
@@ -22,6 +23,8 @@ namespace codegen{
|
||||
|
||||
class allocation;
|
||||
class tune;
|
||||
class buffer_info_pass;
|
||||
|
||||
typedef std::vector<llvm::Value*> indices_t;
|
||||
|
||||
struct distributed_axis {
|
||||
@@ -103,7 +106,6 @@ private:
|
||||
llvm::Constant* llvm_constant(ir::constant *cst, llvm::LLVMContext &ctx);
|
||||
|
||||
// grid construction
|
||||
bool is_shared(ir::value *v);
|
||||
void create_grids(std::vector<ir::value *> &grids,
|
||||
std::map<unsigned *, ir::value *> &references,
|
||||
ir::function *fn);
|
||||
@@ -116,7 +118,7 @@ private:
|
||||
void lower_tile_instruction(ir::instruction *src, llvm::IRBuilder<> &builder);
|
||||
|
||||
public:
|
||||
selection(allocation *alloc, tune *params): alloc_(alloc), params_(params){ }
|
||||
selection(allocation *alloc, tune *params, buffer_info_pass *buffer_info): alloc_(alloc), params_(params), buffer_info_(buffer_info){ }
|
||||
void run(ir::module &src, llvm::Module &dst);
|
||||
|
||||
private:
|
||||
@@ -124,6 +126,7 @@ private:
|
||||
tmap_t tmap_;
|
||||
allocation *alloc_;
|
||||
tune *params_;
|
||||
buffer_info_pass *buffer_info_;
|
||||
std::map<unsigned*, distributed_axis> axes_;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user