diff options
Diffstat (limited to 'include/irtools.hh')
-rw-r--r-- | include/irtools.hh | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/include/irtools.hh b/include/irtools.hh index a743fa5..c4a78ed 100644 --- a/include/irtools.hh +++ b/include/irtools.hh @@ -6,6 +6,7 @@ #include <code_gen/CG_outputRepr.h> #include "ir_code.hh" #include "dep.hh" + #define DEP_DEBUG 0 // IR tree is used to initialize a loop. For a loop node, payload is @@ -18,7 +19,7 @@ struct ir_tree_node { ir_tree_node *parent; std::vector<ir_tree_node *> children; int payload; - + ~ir_tree_node() { for (int i = 0; i < children.size(); i++) delete children[i]; @@ -28,19 +29,22 @@ struct ir_tree_node { std::vector<ir_tree_node *> build_ir_tree(IR_Control *control, ir_tree_node *parent = NULL); + std::vector<ir_tree_node *> extract_ir_stmts( - const std::vector<ir_tree_node *> &ir_tree); + const std::vector<ir_tree_node *> &ir_tree); + bool is_dependence_valid(ir_tree_node *src_node, ir_tree_node *dst_node, const DependenceVector &dv, bool before); + std::pair<std::vector<DependenceVector>, std::vector<DependenceVector> > test_data_dependences( - IR_Code *ir, const omega::CG_outputRepr *repr1, - const omega::Relation &IS1, const omega::CG_outputRepr *repr2, - const omega::Relation &IS2, std::vector<omega::Free_Var_Decl*> &freevar, - std::vector<std::string> index, int i, int j, - std::map<std::string, std::vector<omega::CG_outputRepr * > > &uninterpreted_symbols, - std::map<std::string, std::vector<omega::CG_outputRepr * > > &uninterpreted_symbols_stringrepr); + IR_Code *ir, const omega::CG_outputRepr *repr1, + const omega::Relation &IS1, const omega::CG_outputRepr *repr2, + const omega::Relation &IS2, std::vector<omega::Free_Var_Decl *> &freevar, + std::vector<std::string> index, int i, int j, + std::map<std::string, std::vector<omega::CG_outputRepr *> > &uninterpreted_symbols, + std::map<std::string, std::vector<omega::CG_outputRepr *> > &uninterpreted_symbols_stringrepr); -std::vector<omega::CG_outputRepr *> collect_loop_inductive_and_conditionals(ir_tree_node * stmt_node); +std::vector<omega::CG_outputRepr *> collect_loop_inductive_and_conditionals(ir_tree_node *stmt_node); // Manu typedef std::map<int, std::pair<std::vector<DependenceVector>, std::vector<DependenceVector> > > tempResultMap; @@ -48,9 +52,17 @@ typedef std::pair<std::vector<DependenceVector>, std::vector<DependenceVector> > // Manu:: this function is required for reduction operation bool from_same_statement(IR_Code *ir, IR_ArrayRef *a, IR_ArrayRef *b); + int stmtType(IR_Code *ir, const omega::CG_outputRepr *repr); + IR_OPERATION_TYPE getReductionOperator(IR_Code *ir, const omega::CG_outputRepr *repr); -void mapRefstoStatements(IR_Code *ir,std::vector<IR_ArrayRef *> access, int ref2Stmt[], std::map<int,std::set<int> >& rMap, std::set<int>& tnrStmts, std::set<int>& nrStmts); -void checkReductionDependence(int i, int j, int nestLeveli, omega::coef_t lbound[], omega::coef_t ubound[], int ref2Stmt[], std::map<int,std::set<int> >& rMap, DVPair& dv, tempResultMap& trMap, std::set<int> nrStmts ); + +void +mapRefstoStatements(IR_Code *ir, std::vector<IR_ArrayRef *> access, int ref2Stmt[], std::map<int, std::set<int> > &rMap, + std::set<int> &tnrStmts, std::set<int> &nrStmts); + +void +checkReductionDependence(int i, int j, int nestLeveli, omega::coef_t lbound[], omega::coef_t ubound[], int ref2Stmt[], + std::map<int, std::set<int> > &rMap, DVPair &dv, tempResultMap &trMap, std::set<int> nrStmts); #endif |