Commit 16bccd7a by Sebastian Pop Committed by Sebastian Pop

remove out of sync comments

	* graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple):
	Remove comments from class declarations: they are already in the code
	close by the defs.

From-SVN: r232934
parent 0baa616a
2016-01-28 Sebastian Pop <s.pop@samsung.com> 2016-01-28 Sebastian Pop <s.pop@samsung.com>
* graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple):
Remove comments from class declarations: they are already in the code
close by the defs.
2016-01-28 Sebastian Pop <s.pop@samsung.com>
* graphite-isl-ast-to-gimple.c (binary_op_to_tree): Call codegen_error_p. * graphite-isl-ast-to-gimple.c (binary_op_to_tree): Call codegen_error_p.
(ternary_op_to_tree): Same. (ternary_op_to_tree): Same.
(unary_op_to_tree): Same. (unary_op_to_tree): Same.
......
...@@ -171,342 +171,117 @@ class translate_isl_ast_to_gimple ...@@ -171,342 +171,117 @@ class translate_isl_ast_to_gimple
{ {
public: public:
translate_isl_ast_to_gimple (sese_info_p r) translate_isl_ast_to_gimple (sese_info_p r)
: region (r), codegen_error (false) : region (r), codegen_error (false) { }
{ }
/* Translates an isl AST node NODE to GCC representation in the
context of a SESE. */
edge translate_isl_ast (loop_p context_loop, __isl_keep isl_ast_node *node, edge translate_isl_ast (loop_p context_loop, __isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip); edge next_e, ivs_params &ip);
/* Translates an isl_ast_node_for to Gimple. */
edge translate_isl_ast_node_for (loop_p context_loop, edge translate_isl_ast_node_for (loop_p context_loop,
__isl_keep isl_ast_node *node, __isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip); edge next_e, ivs_params &ip);
/* Create the loop for a isl_ast_node_for.
- NEXT_E is the edge where new generated code should be attached. */
edge translate_isl_ast_for_loop (loop_p context_loop, edge translate_isl_ast_for_loop (loop_p context_loop,
__isl_keep isl_ast_node *node_for, __isl_keep isl_ast_node *node_for,
edge next_e, edge next_e,
tree type, tree lb, tree ub, tree type, tree lb, tree ub,
ivs_params &ip); ivs_params &ip);
/* Translates an isl_ast_node_if to Gimple. */
edge translate_isl_ast_node_if (loop_p context_loop, edge translate_isl_ast_node_if (loop_p context_loop,
__isl_keep isl_ast_node *node, __isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip); edge next_e, ivs_params &ip);
/* Translates an isl_ast_node_user to Gimple.
FIXME: We should remove iv_map.create (loop->num + 1), if it is
possible. */
edge translate_isl_ast_node_user (__isl_keep isl_ast_node *node, edge translate_isl_ast_node_user (__isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip); edge next_e, ivs_params &ip);
/* Translates an isl_ast_node_block to Gimple. */
edge translate_isl_ast_node_block (loop_p context_loop, edge translate_isl_ast_node_block (loop_p context_loop,
__isl_keep isl_ast_node *node, __isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip); edge next_e, ivs_params &ip);
/* Converts a unary isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */
tree unary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, tree unary_op_to_tree (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip); ivs_params &ip);
/* Converts a binary isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */
tree binary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, tree binary_op_to_tree (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip); ivs_params &ip);
/* Converts a ternary isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */
tree ternary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, tree ternary_op_to_tree (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip); ivs_params &ip);
/* Converts an isl_ast_expr_op expression E with unknown number of arguments
to a GCC expression tree of type TYPE. */
tree nary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, tree nary_op_to_tree (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip); ivs_params &ip);
/* Converts an isl AST expression E back to a GCC expression tree of
type TYPE. */
tree gcc_expression_from_isl_expression (tree type, tree gcc_expression_from_isl_expression (tree type,
__isl_take isl_ast_expr *, __isl_take isl_ast_expr *,
ivs_params &ip); ivs_params &ip);
/* Return the tree variable that corresponds to the given isl ast identifier
expression (an isl_ast_expr of type isl_ast_expr_id).
FIXME: We should replace blind conversation of id's type with derivation
of the optimal type when we get the corresponding isl support. Blindly
converting type sizes may be problematic when we switch to smaller
types. */
tree gcc_expression_from_isl_ast_expr_id (tree type, tree gcc_expression_from_isl_ast_expr_id (tree type,
__isl_keep isl_ast_expr *expr_id, __isl_keep isl_ast_expr *expr_id,
ivs_params &ip); ivs_params &ip);
/* Converts an isl_ast_expr_int expression E to a GCC expression tree of
type TYPE. */
tree gcc_expression_from_isl_expr_int (tree type, tree gcc_expression_from_isl_expr_int (tree type,
__isl_take isl_ast_expr *expr); __isl_take isl_ast_expr *expr);
/* Converts an isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */
tree gcc_expression_from_isl_expr_op (tree type, tree gcc_expression_from_isl_expr_op (tree type,
__isl_take isl_ast_expr *expr, __isl_take isl_ast_expr *expr,
ivs_params &ip); ivs_params &ip);
/* Creates a new LOOP corresponding to isl_ast_node_for. Inserts an
induction variable for the new LOOP. New LOOP is attached to CFG
starting at ENTRY_EDGE. LOOP is inserted into the loop tree and
becomes the child loop of the OUTER_LOOP. NEWIVS_INDEX binds
isl's scattering name to the induction variable created for the
loop of STMT. The new induction variable is inserted in the NEWIVS
vector and is of type TYPE. */
struct loop *graphite_create_new_loop (edge entry_edge, struct loop *graphite_create_new_loop (edge entry_edge,
__isl_keep isl_ast_node *node_for, __isl_keep isl_ast_node *node_for,
loop_p outer, tree type, loop_p outer, tree type,
tree lb, tree ub, ivs_params &ip); tree lb, tree ub, ivs_params &ip);
/* All loops generated by create_empty_loop_on_edge have the form of
a post-test loop:
do
{
body of the loop;
} while (lower bound < upper bound);
We create a new if region protecting the loop to be executed, if
the execution count is zero (lower bound > upper bound). */
edge graphite_create_new_loop_guard (edge entry_edge, edge graphite_create_new_loop_guard (edge entry_edge,
__isl_keep isl_ast_node *node_for, __isl_keep isl_ast_node *node_for,
tree *type, tree *type,
tree *lb, tree *ub, ivs_params &ip); tree *lb, tree *ub, ivs_params &ip);
/* Creates a new if region corresponding to isl's cond. */
edge graphite_create_new_guard (edge entry_edge, edge graphite_create_new_guard (edge entry_edge,
__isl_take isl_ast_expr *if_cond, __isl_take isl_ast_expr *if_cond,
ivs_params &ip); ivs_params &ip);
/* Inserts in iv_map a tuple (OLD_LOOP->num, NEW_NAME) for the induction
variables of the loops around GBB in SESE.
FIXME: Instead of using a vec<tree> that maps each loop id to a possible
chrec, we could consider using a map<int, tree> that maps loop ids to the
corresponding tree expressions. */
void build_iv_mapping (vec<tree> iv_map, gimple_poly_bb_p gbb, void build_iv_mapping (vec<tree> iv_map, gimple_poly_bb_p gbb,
__isl_keep isl_ast_expr *user_expr, ivs_params &ip, __isl_keep isl_ast_expr *user_expr, ivs_params &ip,
sese_l &region); sese_l &region);
/* Patch the missing arguments of the phi nodes. */
void translate_pending_phi_nodes (void); void translate_pending_phi_nodes (void);
/* Add isl's parameter identifiers and corresponding trees to ivs_params. */
void add_parameters_to_ivs_params (scop_p scop, ivs_params &ip); void add_parameters_to_ivs_params (scop_p scop, ivs_params &ip);
/* Generates a build, which specifies the constraints on the parameters. */
__isl_give isl_ast_build *generate_isl_context (scop_p scop); __isl_give isl_ast_build *generate_isl_context (scop_p scop);
#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
/* Generate isl AST from schedule of SCOP. */
__isl_give isl_ast_node * scop_to_isl_ast (scop_p scop); __isl_give isl_ast_node * scop_to_isl_ast (scop_p scop);
#else #else
/* Get the maximal number of schedule dimensions in the scop SCOP. */
int get_max_schedule_dimensions (scop_p scop); int get_max_schedule_dimensions (scop_p scop);
/* Extend the schedule to NB_SCHEDULE_DIMS schedule dimensions.
For schedules with different dimensionality, the isl AST generator can not
define an order and will just randomly choose an order. The solution to
this problem is to extend all schedules to the maximal number of schedule
dimensions (using '0's for the remaining values). */
__isl_give isl_map *extend_schedule (__isl_take isl_map *schedule, __isl_give isl_map *extend_schedule (__isl_take isl_map *schedule,
int nb_schedule_dims); int nb_schedule_dims);
/* Generates a schedule, which specifies an order used to
visit elements in a domain. */
__isl_give isl_union_map *generate_isl_schedule (scop_p scop); __isl_give isl_union_map *generate_isl_schedule (scop_p scop);
/* Set the separate option for all dimensions.
This helps to reduce control overhead. */
__isl_give isl_ast_build *set_options (__isl_take isl_ast_build *control, __isl_give isl_ast_build *set_options (__isl_take isl_ast_build *control,
__isl_keep isl_union_map *schedule); __isl_keep isl_union_map *schedule);
/* Generate isl AST from schedule of SCOP. Also, collects IVS_PARAMS in
IP. */
__isl_give isl_ast_node *scop_to_isl_ast (scop_p scop, ivs_params &ip); __isl_give isl_ast_node *scop_to_isl_ast (scop_p scop, ivs_params &ip);
/* Prints NODE to FILE. */
void print_isl_ast_node (FILE *file, __isl_keep isl_ast_node *node,
__isl_keep isl_ctx *ctx) const
{
isl_printer *prn = isl_printer_to_file (ctx, file);
prn = isl_printer_set_output_format (prn, ISL_FORMAT_C);
prn = isl_printer_print_ast_node (prn, node);
prn = isl_printer_print_str (prn, "\n");
isl_printer_free (prn);
}
#endif #endif
/* Return true if RENAME (defined in BB) is a valid use in NEW_BB. The
definition should flow into use, and the use should respect the loop-closed
SSA form. */
bool is_valid_rename (tree rename, basic_block def_bb, basic_block use_bb, bool is_valid_rename (tree rename, basic_block def_bb, basic_block use_bb,
phi_node_kind, tree old_name, basic_block old_bb) const; phi_node_kind, tree old_name, basic_block old_bb) const;
/* Returns the expression associated to OLD_NAME (which is used in OLD_BB), in
NEW_BB from RENAME_MAP. LOOP_PHI is true when we want to rename OLD_NAME
within a loop PHI instruction. */
tree get_rename (basic_block new_bb, tree old_name, tree get_rename (basic_block new_bb, tree old_name,
basic_block old_bb, phi_node_kind) const; basic_block old_bb, phi_node_kind) const;
/* For ops which are scev_analyzeable, we can regenerate a new name from
its scalar evolution around LOOP. */
tree get_rename_from_scev (tree old_name, gimple_seq *stmts, loop_p loop, tree get_rename_from_scev (tree old_name, gimple_seq *stmts, loop_p loop,
basic_block new_bb, basic_block old_bb, basic_block new_bb, basic_block old_bb,
vec<tree> iv_map); vec<tree> iv_map);
/* Returns a basic block that could correspond to where a constant was defined
in the original code. In the original code OLD_BB had the definition, we
need to find which basic block out of the copies of old_bb, in the new
region, should a definition correspond to if it has to reach BB. */
basic_block get_def_bb_for_const (basic_block bb, basic_block old_bb) const; basic_block get_def_bb_for_const (basic_block bb, basic_block old_bb) const;
/* Get the new name of OP (from OLD_BB) to be used in NEW_BB. LOOP_PHI is
true when we want to rename an OP within a loop PHI instruction. */
tree get_new_name (basic_block new_bb, tree op, tree get_new_name (basic_block new_bb, tree op,
basic_block old_bb, phi_node_kind) const; basic_block old_bb, phi_node_kind) const;
/* Collect all the operands of NEW_EXPR by recursively visiting each
operand. */
void collect_all_ssa_names (tree new_expr, vec<tree> *vec_ssa); void collect_all_ssa_names (tree new_expr, vec<tree> *vec_ssa);
/* Copy the PHI arguments from OLD_PHI to the NEW_PHI. The arguments to
NEW_PHI must be found unless they can be POSTPONEd for later. */
bool copy_loop_phi_args (gphi *old_phi, init_back_edge_pair_t &ibp_old_bb, bool copy_loop_phi_args (gphi *old_phi, init_back_edge_pair_t &ibp_old_bb,
gphi *new_phi, init_back_edge_pair_t &ibp_new_bb, gphi *new_phi, init_back_edge_pair_t &ibp_new_bb,
bool postpone); bool postpone);
/* Copy loop phi nodes from BB to NEW_BB. */
bool copy_loop_phi_nodes (basic_block bb, basic_block new_bb); bool copy_loop_phi_nodes (basic_block bb, basic_block new_bb);
/* Add phi nodes to all merge points of all the diamonds enclosing the loop of
the close phi node PHI. */
bool add_close_phis_to_merge_points (gphi *old_phi, gphi *new_phi, bool add_close_phis_to_merge_points (gphi *old_phi, gphi *new_phi,
tree default_value); tree default_value);
tree add_close_phis_to_outer_loops (tree last_merge_name, edge merge_e, tree add_close_phis_to_outer_loops (tree last_merge_name, edge merge_e,
gimple *old_close_phi); gimple *old_close_phi);
/* Copy all the loop-close phi args from BB to NEW_BB. */
bool copy_loop_close_phi_args (basic_block old_bb, basic_block new_bb, bool copy_loop_close_phi_args (basic_block old_bb, basic_block new_bb,
bool postpone); bool postpone);
/* Copy loop close phi nodes from BB to NEW_BB. */
bool copy_loop_close_phi_nodes (basic_block old_bb, basic_block new_bb); bool copy_loop_close_phi_nodes (basic_block old_bb, basic_block new_bb);
/* Copy the arguments of cond-phi node PHI, to NEW_PHI in the codegenerated
region. If postpone is true and it isn't possible to copy any arg of PHI,
the PHI is added to the REGION->INCOMPLETE_PHIS to be codegenerated later.
Returns false if the copying was unsuccessful. */
bool copy_cond_phi_args (gphi *phi, gphi *new_phi, vec<tree> iv_map, bool copy_cond_phi_args (gphi *phi, gphi *new_phi, vec<tree> iv_map,
bool postpone); bool postpone);
/* Copy cond phi nodes from BB to NEW_BB. A cond-phi node is a basic block
containing phi nodes coming from two predecessors, and none of them are back
edges. */
bool copy_cond_phi_nodes (basic_block bb, basic_block new_bb, bool copy_cond_phi_nodes (basic_block bb, basic_block new_bb,
vec<tree> iv_map); vec<tree> iv_map);
/* Duplicates the statements of basic block BB into basic block NEW_BB
and compute the new induction variables according to the IV_MAP. */
bool graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, bool graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb,
vec<tree> iv_map); vec<tree> iv_map);
/* Copies BB and includes in the copied BB all the statements that can
be reached following the use-def chains from the memory accesses,
and returns the next edge following this new block. */
edge copy_bb_and_scalar_dependences (basic_block bb, edge next_e, edge copy_bb_and_scalar_dependences (basic_block bb, edge next_e,
vec<tree> iv_map); vec<tree> iv_map);
/* Given a basic block containing close-phi it returns the new basic block
where to insert a copy of the close-phi nodes. All the uses in close phis
should come from a single loop otherwise it returns NULL. */
edge edge_for_new_close_phis (basic_block bb); edge edge_for_new_close_phis (basic_block bb);
/* Add NEW_NAME as the ARGNUM-th arg of NEW_PHI which is in NEW_BB.
DOMINATING_PRED is the predecessor basic block of OLD_BB which dominates
the other pred of OLD_BB as well. If no such basic block exists then it is
NULL. NON_DOMINATING_PRED is a pred which does not dominate OLD_BB, it
cannot be NULL.
Case1: OLD_BB->preds {BB1, BB2} and BB1 does not dominate BB2 and vice
versa. In this case DOMINATING_PRED = NULL.
Case2: OLD_BB->preds {BB1, BB2} and BB1 dominates BB2.
Returns true on successful copy of the args, false otherwise. */
bool add_phi_arg_for_new_expr (tree old_phi_args[2], tree new_phi_args[2], bool add_phi_arg_for_new_expr (tree old_phi_args[2], tree new_phi_args[2],
edge old_bb_dominating_edge, edge old_bb_dominating_edge,
edge old_bb_non_dominating_edge, edge old_bb_non_dominating_edge,
gphi *phi, gphi *new_phi, gphi *phi, gphi *new_phi,
basic_block new_bb); basic_block new_bb);
/* Renames the scalar uses of the statement COPY, using the substitution map
RENAME_MAP, inserting the gimplification code at GSI_TGT, for the
translation REGION, with the original copied statement in LOOP, and using
the induction variable renaming map IV_MAP. Returns true when something
has been renamed. */
bool rename_uses (gimple *copy, gimple_stmt_iterator *gsi_tgt, bool rename_uses (gimple *copy, gimple_stmt_iterator *gsi_tgt,
basic_block old_bb, loop_p loop, vec<tree> iv_map); basic_block old_bb, loop_p loop, vec<tree> iv_map);
/* Register in RENAME_MAP the rename tuple (OLD_NAME, EXPR).
When OLD_NAME and EXPR are the same we assert. */
void set_rename (tree old_name, tree expr); void set_rename (tree old_name, tree expr);
/* Create new names for all the definitions created by COPY and add
replacement mappings for each new name. */
void set_rename_for_each_def (gimple *stmt); void set_rename_for_each_def (gimple *stmt);
/* Insert each statement from SEQ at its earliest insertion p. */
void gsi_insert_earliest (gimple_seq seq); void gsi_insert_earliest (gimple_seq seq);
/* Rename all the operands of NEW_EXPR by recursively visiting each
operand. */
tree rename_all_uses (tree new_expr, basic_block new_bb, basic_block old_bb); tree rename_all_uses (tree new_expr, basic_block new_bb, basic_block old_bb);
bool codegen_error_p () const { return codegen_error; }
bool codegen_error_p () const
{ return codegen_error; }
/* Return true when OP is a constant tree. */
bool is_constant (tree op) const bool is_constant (tree op) const
{ {
return TREE_CODE (op) == INTEGER_CST return TREE_CODE (op) == INTEGER_CST
...@@ -535,8 +310,7 @@ private: ...@@ -535,8 +310,7 @@ private:
converting type sizes may be problematic when we switch to smaller converting type sizes may be problematic when we switch to smaller
types. */ types. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
gcc_expression_from_isl_ast_expr_id (tree type, gcc_expression_from_isl_ast_expr_id (tree type,
__isl_take isl_ast_expr *expr_id, __isl_take isl_ast_expr *expr_id,
ivs_params &ip) ivs_params &ip)
...@@ -560,8 +334,7 @@ gcc_expression_from_isl_ast_expr_id (tree type, ...@@ -560,8 +334,7 @@ gcc_expression_from_isl_ast_expr_id (tree type,
/* Converts an isl_ast_expr_int expression E to a GCC expression tree of /* Converts an isl_ast_expr_int expression E to a GCC expression tree of
type TYPE. */ type TYPE. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
gcc_expression_from_isl_expr_int (tree type, __isl_take isl_ast_expr *expr) gcc_expression_from_isl_expr_int (tree type, __isl_take isl_ast_expr *expr)
{ {
gcc_assert (isl_ast_expr_get_type (expr) == isl_ast_expr_int); gcc_assert (isl_ast_expr_get_type (expr) == isl_ast_expr_int);
...@@ -582,8 +355,7 @@ gcc_expression_from_isl_expr_int (tree type, __isl_take isl_ast_expr *expr) ...@@ -582,8 +355,7 @@ gcc_expression_from_isl_expr_int (tree type, __isl_take isl_ast_expr *expr)
/* Converts a binary isl_ast_expr_op expression E to a GCC expression tree of /* Converts a binary isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */ type TYPE. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
binary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip) binary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
{ {
isl_ast_expr *arg_expr = isl_ast_expr_get_op_arg (expr, 0); isl_ast_expr *arg_expr = isl_ast_expr_get_op_arg (expr, 0);
...@@ -682,8 +454,7 @@ binary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip) ...@@ -682,8 +454,7 @@ binary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
/* Converts a ternary isl_ast_expr_op expression E to a GCC expression tree of /* Converts a ternary isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */ type TYPE. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
ternary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip) ternary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
{ {
enum isl_ast_op_type t = isl_ast_expr_get_op_type (expr); enum isl_ast_op_type t = isl_ast_expr_get_op_type (expr);
...@@ -705,8 +476,7 @@ ternary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip) ...@@ -705,8 +476,7 @@ ternary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
/* Converts a unary isl_ast_expr_op expression E to a GCC expression tree of /* Converts a unary isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */ type TYPE. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
unary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip) unary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
{ {
gcc_assert (isl_ast_expr_get_op_type (expr) == isl_ast_op_minus); gcc_assert (isl_ast_expr_get_op_type (expr) == isl_ast_op_minus);
...@@ -720,8 +490,7 @@ unary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip) ...@@ -720,8 +490,7 @@ unary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
/* Converts an isl_ast_expr_op expression E with unknown number of arguments /* Converts an isl_ast_expr_op expression E with unknown number of arguments
to a GCC expression tree of type TYPE. */ to a GCC expression tree of type TYPE. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
nary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip) nary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
{ {
enum tree_code op_code; enum tree_code op_code;
...@@ -768,8 +537,7 @@ nary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip) ...@@ -768,8 +537,7 @@ nary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
/* Converts an isl_ast_expr_op expression E to a GCC expression tree of /* Converts an isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */ type TYPE. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
gcc_expression_from_isl_expr_op (tree type, __isl_take isl_ast_expr *expr, gcc_expression_from_isl_expr_op (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip) ivs_params &ip)
{ {
...@@ -830,8 +598,7 @@ gcc_expression_from_isl_expr_op (tree type, __isl_take isl_ast_expr *expr, ...@@ -830,8 +598,7 @@ gcc_expression_from_isl_expr_op (tree type, __isl_take isl_ast_expr *expr,
/* Converts an isl AST expression E back to a GCC expression tree of /* Converts an isl AST expression E back to a GCC expression tree of
type TYPE. */ type TYPE. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
gcc_expression_from_isl_expression (tree type, __isl_take isl_ast_expr *expr, gcc_expression_from_isl_expression (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip) ivs_params &ip)
{ {
...@@ -867,8 +634,7 @@ gcc_expression_from_isl_expression (tree type, __isl_take isl_ast_expr *expr, ...@@ -867,8 +634,7 @@ gcc_expression_from_isl_expression (tree type, __isl_take isl_ast_expr *expr,
loop of STMT. The new induction variable is inserted in the NEWIVS loop of STMT. The new induction variable is inserted in the NEWIVS
vector and is of type TYPE. */ vector and is of type TYPE. */
struct loop * struct loop *translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
graphite_create_new_loop (edge entry_edge, __isl_keep isl_ast_node *node_for, graphite_create_new_loop (edge entry_edge, __isl_keep isl_ast_node *node_for,
loop_p outer, tree type, tree lb, tree ub, loop_p outer, tree type, tree lb, tree ub,
ivs_params &ip) ivs_params &ip)
...@@ -901,8 +667,7 @@ graphite_create_new_loop (edge entry_edge, __isl_keep isl_ast_node *node_for, ...@@ -901,8 +667,7 @@ graphite_create_new_loop (edge entry_edge, __isl_keep isl_ast_node *node_for,
- NEXT_E is the edge where new generated code should be attached. */ - NEXT_E is the edge where new generated code should be attached. */
edge edge translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
translate_isl_ast_for_loop (loop_p context_loop, translate_isl_ast_for_loop (loop_p context_loop,
__isl_keep isl_ast_node *node_for, edge next_e, __isl_keep isl_ast_node *node_for, edge next_e,
tree type, tree lb, tree ub, tree type, tree lb, tree ub,
...@@ -1009,8 +774,7 @@ get_upper_bound (__isl_keep isl_ast_node *node_for) ...@@ -1009,8 +774,7 @@ get_upper_bound (__isl_keep isl_ast_node *node_for)
We create a new if region protecting the loop to be executed, if We create a new if region protecting the loop to be executed, if
the execution count is zero (lower bound > upper bound). */ the execution count is zero (lower bound > upper bound). */
edge edge translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
graphite_create_new_loop_guard (edge entry_edge, graphite_create_new_loop_guard (edge entry_edge,
__isl_keep isl_ast_node *node_for, tree *type, __isl_keep isl_ast_node *node_for, tree *type,
tree *lb, tree *ub, ivs_params &ip) tree *lb, tree *ub, ivs_params &ip)
...@@ -1064,8 +828,7 @@ graphite_create_new_loop_guard (edge entry_edge, ...@@ -1064,8 +828,7 @@ graphite_create_new_loop_guard (edge entry_edge,
/* Translates an isl_ast_node_for to Gimple. */ /* Translates an isl_ast_node_for to Gimple. */
edge edge translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
translate_isl_ast_node_for (loop_p context_loop, __isl_keep isl_ast_node *node, translate_isl_ast_node_for (loop_p context_loop, __isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip) edge next_e, ivs_params &ip)
{ {
...@@ -1100,8 +863,7 @@ translate_isl_ast_node_for (loop_p context_loop, __isl_keep isl_ast_node *node, ...@@ -1100,8 +863,7 @@ translate_isl_ast_node_for (loop_p context_loop, __isl_keep isl_ast_node *node,
chrec, we could consider using a map<int, tree> that maps loop ids to the chrec, we could consider using a map<int, tree> that maps loop ids to the
corresponding tree expressions. */ corresponding tree expressions. */
void void translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
build_iv_mapping (vec<tree> iv_map, gimple_poly_bb_p gbb, build_iv_mapping (vec<tree> iv_map, gimple_poly_bb_p gbb,
__isl_keep isl_ast_expr *user_expr, ivs_params &ip, __isl_keep isl_ast_expr *user_expr, ivs_params &ip,
sese_l &region) sese_l &region)
...@@ -1130,8 +892,7 @@ build_iv_mapping (vec<tree> iv_map, gimple_poly_bb_p gbb, ...@@ -1130,8 +892,7 @@ build_iv_mapping (vec<tree> iv_map, gimple_poly_bb_p gbb,
FIXME: We should remove iv_map.create (loop->num + 1), if it is possible. */ FIXME: We should remove iv_map.create (loop->num + 1), if it is possible. */
edge edge translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
translate_isl_ast_node_user (__isl_keep isl_ast_node *node, translate_isl_ast_node_user (__isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip) edge next_e, ivs_params &ip)
{ {
...@@ -1189,8 +950,7 @@ translate_isl_ast_node_user (__isl_keep isl_ast_node *node, ...@@ -1189,8 +950,7 @@ translate_isl_ast_node_user (__isl_keep isl_ast_node *node,
/* Translates an isl_ast_node_block to Gimple. */ /* Translates an isl_ast_node_block to Gimple. */
edge edge translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
translate_isl_ast_node_block (loop_p context_loop, translate_isl_ast_node_block (loop_p context_loop,
__isl_keep isl_ast_node *node, __isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip) edge next_e, ivs_params &ip)
...@@ -1210,8 +970,7 @@ translate_isl_ast_node_block (loop_p context_loop, ...@@ -1210,8 +970,7 @@ translate_isl_ast_node_block (loop_p context_loop,
/* Creates a new if region corresponding to isl's cond. */ /* Creates a new if region corresponding to isl's cond. */
edge edge translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
graphite_create_new_guard (edge entry_edge, __isl_take isl_ast_expr *if_cond, graphite_create_new_guard (edge entry_edge, __isl_take isl_ast_expr *if_cond,
ivs_params &ip) ivs_params &ip)
{ {
...@@ -1229,8 +988,7 @@ graphite_create_new_guard (edge entry_edge, __isl_take isl_ast_expr *if_cond, ...@@ -1229,8 +988,7 @@ graphite_create_new_guard (edge entry_edge, __isl_take isl_ast_expr *if_cond,
/* Translates an isl_ast_node_if to Gimple. */ /* Translates an isl_ast_node_if to Gimple. */
edge edge translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
translate_isl_ast_node_if (loop_p context_loop, translate_isl_ast_node_if (loop_p context_loop,
__isl_keep isl_ast_node *node, __isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip) edge next_e, ivs_params &ip)
...@@ -1257,10 +1015,9 @@ translate_isl_ast_node_if (loop_p context_loop, ...@@ -1257,10 +1015,9 @@ translate_isl_ast_node_if (loop_p context_loop,
/* Translates an isl AST node NODE to GCC representation in the /* Translates an isl AST node NODE to GCC representation in the
context of a SESE. */ context of a SESE. */
edge edge translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::translate_isl_ast (loop_p context_loop, translate_isl_ast (loop_p context_loop, __isl_keep isl_ast_node *node,
__isl_keep isl_ast_node *node, edge next_e, ivs_params &ip)
edge next_e, ivs_params &ip)
{ {
if (codegen_error_p ()) if (codegen_error_p ())
return NULL; return NULL;
...@@ -1397,8 +1154,7 @@ phi_uses_name (basic_block bb, tree name) ...@@ -1397,8 +1154,7 @@ phi_uses_name (basic_block bb, tree name)
definition should flow into use, and the use should respect the loop-closed definition should flow into use, and the use should respect the loop-closed
SSA form. */ SSA form. */
bool bool translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
is_valid_rename (tree rename, basic_block def_bb, basic_block use_bb, is_valid_rename (tree rename, basic_block def_bb, basic_block use_bb,
phi_node_kind phi_kind, tree old_name, basic_block old_bb) const phi_node_kind phi_kind, tree old_name, basic_block old_bb) const
{ {
...@@ -1439,11 +1195,9 @@ is_valid_rename (tree rename, basic_block def_bb, basic_block use_bb, ...@@ -1439,11 +1195,9 @@ is_valid_rename (tree rename, basic_block def_bb, basic_block use_bb,
/* Returns the expression associated to OLD_NAME (which is used in OLD_BB), in /* Returns the expression associated to OLD_NAME (which is used in OLD_BB), in
NEW_BB from RENAME_MAP. PHI_KIND determines the kind of phi node. */ NEW_BB from RENAME_MAP. PHI_KIND determines the kind of phi node. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::get_rename (basic_block new_bb, get_rename (basic_block new_bb, tree old_name, basic_block old_bb,
tree old_name, phi_node_kind phi_kind) const
basic_block old_bb,
phi_node_kind phi_kind) const
{ {
gcc_assert (TREE_CODE (old_name) == SSA_NAME); gcc_assert (TREE_CODE (old_name) == SSA_NAME);
vec <tree> *renames = region->rename_map->get (old_name); vec <tree> *renames = region->rename_map->get (old_name);
...@@ -1504,8 +1258,8 @@ translate_isl_ast_to_gimple::get_rename (basic_block new_bb, ...@@ -1504,8 +1258,8 @@ translate_isl_ast_to_gimple::get_rename (basic_block new_bb,
/* Register in RENAME_MAP the rename tuple (OLD_NAME, EXPR). /* Register in RENAME_MAP the rename tuple (OLD_NAME, EXPR).
When OLD_NAME and EXPR are the same we assert. */ When OLD_NAME and EXPR are the same we assert. */
void void translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::set_rename (tree old_name, tree expr) set_rename (tree old_name, tree expr)
{ {
if (dump_file) if (dump_file)
{ {
...@@ -1575,8 +1329,8 @@ later_of_the_two (gimple_stmt_iterator gsi1, gimple_stmt_iterator gsi2) ...@@ -1575,8 +1329,8 @@ later_of_the_two (gimple_stmt_iterator gsi1, gimple_stmt_iterator gsi2)
/* Insert each statement from SEQ at its earliest insertion p. */ /* Insert each statement from SEQ at its earliest insertion p. */
void void translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::gsi_insert_earliest (gimple_seq seq) gsi_insert_earliest (gimple_seq seq)
{ {
update_modified_stmts (seq); update_modified_stmts (seq);
sese_l &codegen_region = region->if_region->true_region->region; sese_l &codegen_region = region->if_region->true_region->region;
...@@ -1646,9 +1400,8 @@ translate_isl_ast_to_gimple::gsi_insert_earliest (gimple_seq seq) ...@@ -1646,9 +1400,8 @@ translate_isl_ast_to_gimple::gsi_insert_earliest (gimple_seq seq)
/* Collect all the operands of NEW_EXPR by recursively visiting each /* Collect all the operands of NEW_EXPR by recursively visiting each
operand. */ operand. */
void void translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::collect_all_ssa_names (tree new_expr, collect_all_ssa_names (tree new_expr, vec<tree> *vec_ssa)
vec<tree> *vec_ssa)
{ {
/* Rename all uses in new_expr. */ /* Rename all uses in new_expr. */
...@@ -1809,9 +1562,8 @@ substitute_ssa_name (tree exp, tree f, tree r) ...@@ -1809,9 +1562,8 @@ substitute_ssa_name (tree exp, tree f, tree r)
/* Rename all the operands of NEW_EXPR by recursively visiting each operand. */ /* Rename all the operands of NEW_EXPR by recursively visiting each operand. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::rename_all_uses (tree new_expr, basic_block new_bb, rename_all_uses (tree new_expr, basic_block new_bb, basic_block old_bb)
basic_block old_bb)
{ {
auto_vec<tree, 2> ssa_names; auto_vec<tree, 2> ssa_names;
collect_all_ssa_names (new_expr, &ssa_names); collect_all_ssa_names (new_expr, &ssa_names);
...@@ -1827,8 +1579,7 @@ translate_isl_ast_to_gimple::rename_all_uses (tree new_expr, basic_block new_bb, ...@@ -1827,8 +1579,7 @@ translate_isl_ast_to_gimple::rename_all_uses (tree new_expr, basic_block new_bb,
/* For ops which are scev_analyzeable, we can regenerate a new name from its /* For ops which are scev_analyzeable, we can regenerate a new name from its
scalar evolution around LOOP. */ scalar evolution around LOOP. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
get_rename_from_scev (tree old_name, gimple_seq *stmts, loop_p loop, get_rename_from_scev (tree old_name, gimple_seq *stmts, loop_p loop,
basic_block new_bb, basic_block old_bb, basic_block new_bb, basic_block old_bb,
vec<tree> iv_map) vec<tree> iv_map)
...@@ -1890,11 +1641,9 @@ get_rename_from_scev (tree old_name, gimple_seq *stmts, loop_p loop, ...@@ -1890,11 +1641,9 @@ get_rename_from_scev (tree old_name, gimple_seq *stmts, loop_p loop,
statement in LOOP, and using the induction variable renaming map statement in LOOP, and using the induction variable renaming map
IV_MAP. Returns true when something has been renamed. */ IV_MAP. Returns true when something has been renamed. */
bool bool translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::rename_uses (gimple *copy, rename_uses (gimple *copy, gimple_stmt_iterator *gsi_tgt, basic_block old_bb,
gimple_stmt_iterator *gsi_tgt, loop_p loop, vec<tree> iv_map)
basic_block old_bb,
loop_p loop, vec<tree> iv_map)
{ {
bool changed = false; bool changed = false;
...@@ -2002,9 +1751,8 @@ translate_isl_ast_to_gimple::rename_uses (gimple *copy, ...@@ -2002,9 +1751,8 @@ translate_isl_ast_to_gimple::rename_uses (gimple *copy,
need to find which basic block out of the copies of old_bb, in the new need to find which basic block out of the copies of old_bb, in the new
region, should a definition correspond to if it has to reach BB. */ region, should a definition correspond to if it has to reach BB. */
basic_block basic_block translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::get_def_bb_for_const (basic_block bb, get_def_bb_for_const (basic_block bb, basic_block old_bb) const
basic_block old_bb) const
{ {
vec <basic_block> *bbs = region->copied_bb_map->get (old_bb); vec <basic_block> *bbs = region->copied_bb_map->get (old_bb);
...@@ -2037,8 +1785,7 @@ translate_isl_ast_to_gimple::get_def_bb_for_const (basic_block bb, ...@@ -2037,8 +1785,7 @@ translate_isl_ast_to_gimple::get_def_bb_for_const (basic_block bb,
/* Get the new name of OP (from OLD_BB) to be used in NEW_BB. PHI_KIND /* Get the new name of OP (from OLD_BB) to be used in NEW_BB. PHI_KIND
determines the kind of phi node. */ determines the kind of phi node. */
tree tree translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
get_new_name (basic_block new_bb, tree op, get_new_name (basic_block new_bb, tree op,
basic_block old_bb, phi_node_kind phi_kind) const basic_block old_bb, phi_node_kind phi_kind) const
{ {
...@@ -2082,8 +1829,7 @@ get_edges (basic_block bb) ...@@ -2082,8 +1829,7 @@ get_edges (basic_block bb)
/* Copy the PHI arguments from OLD_PHI to the NEW_PHI. The arguments to NEW_PHI /* Copy the PHI arguments from OLD_PHI to the NEW_PHI. The arguments to NEW_PHI
must be found unless they can be POSTPONEd for later. */ must be found unless they can be POSTPONEd for later. */
bool bool translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
copy_loop_phi_args (gphi *old_phi, init_back_edge_pair_t &ibp_old_bb, copy_loop_phi_args (gphi *old_phi, init_back_edge_pair_t &ibp_old_bb,
gphi *new_phi, init_back_edge_pair_t &ibp_new_bb, gphi *new_phi, init_back_edge_pair_t &ibp_new_bb,
bool postpone) bool postpone)
...@@ -2130,9 +1876,8 @@ copy_loop_phi_args (gphi *old_phi, init_back_edge_pair_t &ibp_old_bb, ...@@ -2130,9 +1876,8 @@ copy_loop_phi_args (gphi *old_phi, init_back_edge_pair_t &ibp_old_bb,
/* Copy loop phi nodes from BB to NEW_BB. */ /* Copy loop phi nodes from BB to NEW_BB. */
bool bool translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::copy_loop_phi_nodes (basic_block bb, copy_loop_phi_nodes (basic_block bb, basic_block new_bb)
basic_block new_bb)
{ {
if (dump_file) if (dump_file)
fprintf (dump_file, "[codegen] copying loop phi nodes in bb_%d.\n", fprintf (dump_file, "[codegen] copying loop phi nodes in bb_%d.\n",
...@@ -2340,10 +2085,8 @@ add_close_phis_to_merge_points (gphi *old_close_phi, gphi *new_close_phi, ...@@ -2340,10 +2085,8 @@ add_close_phis_to_merge_points (gphi *old_close_phi, gphi *new_close_phi,
/* Copy all the loop-close phi args from BB to NEW_BB. */ /* Copy all the loop-close phi args from BB to NEW_BB. */
bool bool translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::copy_loop_close_phi_args (basic_block old_bb, copy_loop_close_phi_args (basic_block old_bb, basic_block new_bb, bool postpone)
basic_block new_bb,
bool postpone)
{ {
for (gphi_iterator psi = gsi_start_phis (old_bb); !gsi_end_p (psi); for (gphi_iterator psi = gsi_start_phis (old_bb); !gsi_end_p (psi);
gsi_next (&psi)) gsi_next (&psi))
...@@ -2415,9 +2158,8 @@ translate_isl_ast_to_gimple::copy_loop_close_phi_args (basic_block old_bb, ...@@ -2415,9 +2158,8 @@ translate_isl_ast_to_gimple::copy_loop_close_phi_args (basic_block old_bb,
/* Copy loop close phi nodes from BB to NEW_BB. */ /* Copy loop close phi nodes from BB to NEW_BB. */
bool bool translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::copy_loop_close_phi_nodes (basic_block old_bb, copy_loop_close_phi_nodes (basic_block old_bb, basic_block new_bb)
basic_block new_bb)
{ {
if (dump_file) if (dump_file)
fprintf (dump_file, "[codegen] copying loop close phi nodes in bb_%d.\n", fprintf (dump_file, "[codegen] copying loop close phi nodes in bb_%d.\n",
...@@ -2442,8 +2184,7 @@ translate_isl_ast_to_gimple::copy_loop_close_phi_nodes (basic_block old_bb, ...@@ -2442,8 +2184,7 @@ translate_isl_ast_to_gimple::copy_loop_close_phi_nodes (basic_block old_bb,
Returns true on successful copy of the args, false otherwise. */ Returns true on successful copy of the args, false otherwise. */
bool bool translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::
add_phi_arg_for_new_expr (tree old_phi_args[2], tree new_phi_args[2], add_phi_arg_for_new_expr (tree old_phi_args[2], tree new_phi_args[2],
edge old_bb_dominating_edge, edge old_bb_dominating_edge,
edge old_bb_non_dominating_edge, edge old_bb_non_dominating_edge,
...@@ -2605,10 +2346,8 @@ add_phi_arg_for_new_expr (tree old_phi_args[2], tree new_phi_args[2], ...@@ -2605,10 +2346,8 @@ add_phi_arg_for_new_expr (tree old_phi_args[2], tree new_phi_args[2],
the PHI is added to the REGION->INCOMPLETE_PHIS to be codegenerated later. the PHI is added to the REGION->INCOMPLETE_PHIS to be codegenerated later.
Returns false if the copying was unsuccessful. */ Returns false if the copying was unsuccessful. */
bool bool translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::copy_cond_phi_args (gphi *phi, gphi *new_phi, copy_cond_phi_args (gphi *phi, gphi *new_phi, vec<tree> iv_map, bool postpone)
vec<tree> iv_map,
bool postpone)
{ {
if (dump_file) if (dump_file)
fprintf (dump_file, "[codegen] copying cond phi args.\n"); fprintf (dump_file, "[codegen] copying cond phi args.\n");
...@@ -2722,10 +2461,8 @@ translate_isl_ast_to_gimple::copy_cond_phi_args (gphi *phi, gphi *new_phi, ...@@ -2722,10 +2461,8 @@ translate_isl_ast_to_gimple::copy_cond_phi_args (gphi *phi, gphi *new_phi,
containing phi nodes coming from two predecessors, and none of them are back containing phi nodes coming from two predecessors, and none of them are back
edges. */ edges. */
bool bool translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::copy_cond_phi_nodes (basic_block bb, copy_cond_phi_nodes (basic_block bb, basic_block new_bb, vec<tree> iv_map)
basic_block new_bb,
vec<tree> iv_map)
{ {
gcc_assert (!bb_contains_loop_close_phi_nodes (bb)); gcc_assert (!bb_contains_loop_close_phi_nodes (bb));
...@@ -2797,8 +2534,8 @@ should_copy_to_new_region (gimple *stmt, sese_info_p region) ...@@ -2797,8 +2534,8 @@ should_copy_to_new_region (gimple *stmt, sese_info_p region)
/* Create new names for all the definitions created by COPY and add replacement /* Create new names for all the definitions created by COPY and add replacement
mappings for each new name. */ mappings for each new name. */
void void translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::set_rename_for_each_def (gimple *stmt) set_rename_for_each_def (gimple *stmt)
{ {
def_operand_p def_p; def_operand_p def_p;
ssa_op_iter op_iter; ssa_op_iter op_iter;
...@@ -2813,10 +2550,9 @@ translate_isl_ast_to_gimple::set_rename_for_each_def (gimple *stmt) ...@@ -2813,10 +2550,9 @@ translate_isl_ast_to_gimple::set_rename_for_each_def (gimple *stmt)
/* Duplicates the statements of basic block BB into basic block NEW_BB /* Duplicates the statements of basic block BB into basic block NEW_BB
and compute the new induction variables according to the IV_MAP. */ and compute the new induction variables according to the IV_MAP. */
bool bool translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::graphite_copy_stmts_from_block (basic_block bb, graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb,
basic_block new_bb, vec<tree> iv_map)
vec<tree> iv_map)
{ {
/* Iterator poining to the place where new statement (s) will be inserted. */ /* Iterator poining to the place where new statement (s) will be inserted. */
gimple_stmt_iterator gsi_tgt = gsi_last_bb (new_bb); gimple_stmt_iterator gsi_tgt = gsi_last_bb (new_bb);
...@@ -2885,8 +2621,8 @@ translate_isl_ast_to_gimple::graphite_copy_stmts_from_block (basic_block bb, ...@@ -2885,8 +2621,8 @@ translate_isl_ast_to_gimple::graphite_copy_stmts_from_block (basic_block bb,
to insert a copy of the close-phi nodes. All the uses in close phis should to insert a copy of the close-phi nodes. All the uses in close phis should
come from a single loop otherwise it returns NULL. */ come from a single loop otherwise it returns NULL. */
edge edge translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::edge_for_new_close_phis (basic_block bb) edge_for_new_close_phis (basic_block bb)
{ {
/* Make sure that NEW_BB is the new_loop->exit->dest. We find the definition /* Make sure that NEW_BB is the new_loop->exit->dest. We find the definition
of close phi in the original code and then find the mapping of basic block of close phi in the original code and then find the mapping of basic block
...@@ -2925,10 +2661,8 @@ translate_isl_ast_to_gimple::edge_for_new_close_phis (basic_block bb) ...@@ -2925,10 +2661,8 @@ translate_isl_ast_to_gimple::edge_for_new_close_phis (basic_block bb)
be reached following the use-def chains from the memory accesses, be reached following the use-def chains from the memory accesses,
and returns the next edge following this new block. */ and returns the next edge following this new block. */
edge edge translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::copy_bb_and_scalar_dependences (basic_block bb, copy_bb_and_scalar_dependences (basic_block bb, edge next_e, vec<tree> iv_map)
edge next_e,
vec<tree> iv_map)
{ {
int num_phis = number_of_phi_nodes (bb); int num_phis = number_of_phi_nodes (bb);
...@@ -3072,8 +2806,8 @@ translate_isl_ast_to_gimple::copy_bb_and_scalar_dependences (basic_block bb, ...@@ -3072,8 +2806,8 @@ translate_isl_ast_to_gimple::copy_bb_and_scalar_dependences (basic_block bb,
/* Patch the missing arguments of the phi nodes. */ /* Patch the missing arguments of the phi nodes. */
void void translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::translate_pending_phi_nodes () translate_pending_phi_nodes ()
{ {
int i; int i;
phi_rename *rename; phi_rename *rename;
...@@ -3115,9 +2849,8 @@ translate_isl_ast_to_gimple::translate_pending_phi_nodes () ...@@ -3115,9 +2849,8 @@ translate_isl_ast_to_gimple::translate_pending_phi_nodes ()
/* Add isl's parameter identifiers and corresponding trees to ivs_params. */ /* Add isl's parameter identifiers and corresponding trees to ivs_params. */
void void translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::add_parameters_to_ivs_params (scop_p scop, add_parameters_to_ivs_params (scop_p scop, ivs_params &ip)
ivs_params &ip)
{ {
sese_info_p region = scop->scop_info; sese_info_p region = scop->scop_info;
unsigned nb_parameters = isl_set_dim (scop->param_context, isl_dim_param); unsigned nb_parameters = isl_set_dim (scop->param_context, isl_dim_param);
...@@ -3134,8 +2867,8 @@ translate_isl_ast_to_gimple::add_parameters_to_ivs_params (scop_p scop, ...@@ -3134,8 +2867,8 @@ translate_isl_ast_to_gimple::add_parameters_to_ivs_params (scop_p scop,
/* Generates a build, which specifies the constraints on the parameters. */ /* Generates a build, which specifies the constraints on the parameters. */
__isl_give isl_ast_build * __isl_give isl_ast_build *translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::generate_isl_context (scop_p scop) generate_isl_context (scop_p scop)
{ {
isl_set *context_isl = isl_set_params (isl_set_copy (scop->param_context)); isl_set *context_isl = isl_set_params (isl_set_copy (scop->param_context));
return isl_ast_build_from_context (context_isl); return isl_ast_build_from_context (context_isl);
...@@ -3162,8 +2895,8 @@ ast_build_before_for (__isl_keep isl_ast_build *build, void *user) ...@@ -3162,8 +2895,8 @@ ast_build_before_for (__isl_keep isl_ast_build *build, void *user)
/* Generate isl AST from schedule of SCOP. */ /* Generate isl AST from schedule of SCOP. */
__isl_give isl_ast_node * __isl_give isl_ast_node *translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::scop_to_isl_ast (scop_p scop) scop_to_isl_ast (scop_p scop)
{ {
gcc_assert (scop->transformed_schedule); gcc_assert (scop->transformed_schedule);
...@@ -3189,8 +2922,8 @@ translate_isl_ast_to_gimple::scop_to_isl_ast (scop_p scop) ...@@ -3189,8 +2922,8 @@ translate_isl_ast_to_gimple::scop_to_isl_ast (scop_p scop)
#else #else
/* Get the maximal number of schedule dimensions in the scop SCOP. */ /* Get the maximal number of schedule dimensions in the scop SCOP. */
int int translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::get_max_schedule_dimensions (scop_p scop) get_max_schedule_dimensions (scop_p scop)
{ {
int i; int i;
poly_bb_p pbb; poly_bb_p pbb;
...@@ -3213,9 +2946,8 @@ translate_isl_ast_to_gimple::get_max_schedule_dimensions (scop_p scop) ...@@ -3213,9 +2946,8 @@ translate_isl_ast_to_gimple::get_max_schedule_dimensions (scop_p scop)
problem is to extend all schedules to the maximal number of schedule problem is to extend all schedules to the maximal number of schedule
dimensions (using '0's for the remaining values). */ dimensions (using '0's for the remaining values). */
__isl_give isl_map * __isl_give isl_map *translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::extend_schedule (__isl_take isl_map *schedule, extend_schedule (__isl_take isl_map *schedule, int nb_schedule_dims)
int nb_schedule_dims)
{ {
int tmp_dims = isl_map_dim (schedule, isl_dim_out); int tmp_dims = isl_map_dim (schedule, isl_dim_out);
schedule = schedule =
...@@ -3235,8 +2967,8 @@ translate_isl_ast_to_gimple::extend_schedule (__isl_take isl_map *schedule, ...@@ -3235,8 +2967,8 @@ translate_isl_ast_to_gimple::extend_schedule (__isl_take isl_map *schedule,
/* Generates a schedule, which specifies an order used to /* Generates a schedule, which specifies an order used to
visit elements in a domain. */ visit elements in a domain. */
__isl_give isl_union_map * __isl_give isl_union_map *translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::generate_isl_schedule (scop_p scop) generate_isl_schedule (scop_p scop)
{ {
int nb_schedule_dims = get_max_schedule_dimensions (scop); int nb_schedule_dims = get_max_schedule_dimensions (scop);
int i; int i;
...@@ -3267,9 +2999,9 @@ translate_isl_ast_to_gimple::generate_isl_schedule (scop_p scop) ...@@ -3267,9 +2999,9 @@ translate_isl_ast_to_gimple::generate_isl_schedule (scop_p scop)
/* Set the separate option for all dimensions. /* Set the separate option for all dimensions.
This helps to reduce control overhead. */ This helps to reduce control overhead. */
__isl_give isl_ast_build * __isl_give isl_ast_build *translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::set_options (__isl_take isl_ast_build *control, set_options (__isl_take isl_ast_build *control,
__isl_keep isl_union_map *schedule) __isl_keep isl_union_map *schedule)
{ {
isl_ctx *ctx = isl_union_map_get_ctx (schedule); isl_ctx *ctx = isl_union_map_get_ctx (schedule);
isl_space *range_space = isl_space_set_alloc (ctx, 0, 1); isl_space *range_space = isl_space_set_alloc (ctx, 0, 1);
...@@ -3285,8 +3017,8 @@ translate_isl_ast_to_gimple::set_options (__isl_take isl_ast_build *control, ...@@ -3285,8 +3017,8 @@ translate_isl_ast_to_gimple::set_options (__isl_take isl_ast_build *control,
/* Generate isl AST from schedule of SCOP. Also, collects IVS_PARAMS in IP. */ /* Generate isl AST from schedule of SCOP. Also, collects IVS_PARAMS in IP. */
__isl_give isl_ast_node * __isl_give isl_ast_node *translate_isl_ast_to_gimple::
translate_isl_ast_to_gimple::scop_to_isl_ast (scop_p scop, ivs_params &ip) scop_to_isl_ast (scop_p scop, ivs_params &ip)
{ {
/* Generate loop upper bounds that consist of the current loop iterator, an /* Generate loop upper bounds that consist of the current loop iterator, an
operator (< or <=) and an expression not involving the iterator. If this operator (< or <=) and an expression not involving the iterator. If this
...@@ -3383,11 +3115,8 @@ copy_internal_parameters (sese_info_p region, sese_info_p to_region) ...@@ -3383,11 +3115,8 @@ copy_internal_parameters (sese_info_p region, sese_info_p to_region)
} }
} }
/* GIMPLE Loop Generator: generates loops from STMT in GIMPLE form for /* GIMPLE Loop Generator: generates loops in GIMPLE form for the given SCOP.
the given SCOP. Return true if code generation succeeded. Return true if code generation succeeded. */
FIXME: This is not yet a full implementation of the code generator
with isl ASTs. Generation of GIMPLE code has to be completed. */
bool bool
graphite_regenerate_ast_isl (scop_p scop) graphite_regenerate_ast_isl (scop_p scop)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment