#ifndef _CG_UTILS_H #define _CG_UTILS_H #include #include #include #include #include #include namespace omega { class CG_loop; CG_outputRepr *output_inequality_repr(CG_outputBuilder *ocg, const GEQ_Handle &inequality, Variable_ID v, const Relation &R, const std::vector > &assigned_on_the_fly, std::map > unin,std::set excluded_floor_vars = std::set()); CG_outputRepr *output_substitution_repr(CG_outputBuilder *ocg, const EQ_Handle &equality, Variable_ID v, bool apply_v_coef, const Relation &R, const std::vector > &assigned_on_the_fly,std::map > unin); CG_outputRepr *output_upper_bound_repr(CG_outputBuilder *ocg, const GEQ_Handle &inequality, Variable_ID v, const Relation &R, const std::vector > &assigned_on_the_fly, std::map > unin); CG_outputRepr *output_lower_bound_repr(CG_outputBuilder *ocg, const GEQ_Handle &inequality, Variable_ID v, const EQ_Handle &stride_eq, Variable_ID wc, const Relation &R, const Relation &known, const std::vector > &assigned_on_the_fly,std::map > unin); CG_outputRepr *output_ident(CG_outputBuilder *ocg, const Relation &R, Variable_ID v, const std::vector > &assigned_on_the_fly,std::map > unin); std::pair > output_assignment(CG_outputBuilder *ocg, const Relation &R, int level, const Relation &known, const std::vector > &assigned_on_the_fly,std::map > unin); CG_outputRepr *output_loop(CG_outputBuilder *ocg, const Relation &R, int level, const Relation &known, const std::vector > &assigned_on_the_fly,std::map > unin); CG_outputRepr *output_guard(CG_outputBuilder *ocg, const Relation &R, const std::vector > &assigned_on_the_fly,std::map > unin); std::vector output_substitutions(CG_outputBuilder *ocg, const Relation &R, const std::vector > &assigned_on_the_fly,std::map > unin); bool bound_must_hit_stride(const GEQ_Handle &inequality, Variable_ID v, const EQ_Handle &stride_eq, Variable_ID wc, const Relation &bounds, const Relation &known); std::pair find_simplest_assignment(const Relation &R, Variable_ID v, const std::vector > &assigned_on_the_fly = std::vector >(), bool *has_global_inspector= NULL); std::pair find_floor_definition(const Relation &R, Variable_ID v, std::set excluded_floor_vars = std::set()); //Anand: 07/31/2013 -- Added the followinng temporary function needs cleanup std::vector > find_floor_definition_temp(const Relation &R, Variable_ID v, std::set excluded_floor_vars = std::set()); std::pair find_simplest_stride(const Relation &R, Variable_ID v); Variable_ID replicate_floor_definition(const Relation &R, const Variable_ID floor_var, Relation &r, F_Exists *f_exists, F_And *f_root, std::map &exists_mapping); Relation pick_one_guard(const Relation &R, int level = 0); CG_outputRepr *leaf_print_repr(BoolSet<> active, const std::map &guards, CG_outputRepr *guard_repr, const Relation &known, int indent, CG_outputBuilder *ocg, const std::vector &remap, const std::vector &xforms, const std::vector &stmts, const std::vector > &assigned_on_the_fly, std::vector > > unin); CG_outputRepr *loop_print_repr(BoolSet<> active,const std::vector &loops, int start, int end, const Relation &guard, CG_outputRepr *guard_repr, int indent, const std::vector &remap, const std::vector &xforms,CG_outputBuilder *ocg, const std::vector &stmts, const std::vector > &assigned_on_the_fly, std::vector > > unin); Relation checkAndRestoreIfProjectedByGlobal(const Relation &R1, const Relation &R2, Variable_ID v); //Relation addInequalitiesToRelation( const Relation &R, std::vector &inequalities); std::string print_to_iegen_string(Relation &R); } #endif