[code generation] added double-buffering
This commit is contained in:
34
include/codegen/buffer_info.h
Normal file
34
include/codegen/buffer_info.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef TDL_INCLUDE_CODEGEN_BUFFER_INFO_PASS_H
|
||||
#define TDL_INCLUDE_CODEGEN_BUFFER_INFO_PASS_H
|
||||
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
namespace tdl {
|
||||
|
||||
namespace ir {
|
||||
class module;
|
||||
class value;
|
||||
}
|
||||
|
||||
namespace codegen{
|
||||
|
||||
class buffer_info_pass {
|
||||
public:
|
||||
void run(ir::module &mod);
|
||||
// queries
|
||||
bool is_double(ir::value *x);
|
||||
bool is_shared(ir::value *x);
|
||||
ir::value *get_reference(ir::value *x);
|
||||
|
||||
private:
|
||||
std::set<ir::value*> shared_;
|
||||
std::set<ir::value*> double_;
|
||||
std::map<ir::value*, ir::value*> refs_;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user