tree.h (tree_value_handle): Remove struct value_set declaration.
2006-10-29 Daniel Berlin <dberlin@dberlin.org> * tree.h (tree_value_handle): Remove struct value_set declaration. Change value_set to bitmap_set. * tree-pretty-print.c (dump_generic_node): Use has_stmt_ann. * tree-vn.c (get_value_handle): Made inline and moved to tree-flow-inline.h. * tree-flow-inline.h: (has_stmt_ann): New function. * tree-ssa-pre.c (expressions): New variable. (next_expression_id): Ditto. (alloc_expression_id): New function. (struct value_set): Remove. (get_expression_id): New function. (get_or_alloc_expression_id): Ditto. (expression_for_id): Ditto. (clear_expression_ids): Ditto. (FOR_EACH_EXPR_ID_IN_SET): New macro. (bb_value_sets): Renamed to bb_bitmap_sets. All value sets replaced with bitmap_sets. Add visited member. (BB_VISITED): New macro. (postorder): New variable. (add_to_value): Removed. (value_exists_in_set_bitmap): Ditto. (value_insert_into_set_bitmap): Ditto. (set_new): Ditto. (set_copy): Ditto. (set_remove): Ditto. (set_contains_value): Ditto. (insert_into_set): Ditto. (set_equal): Ditto. (find_leader): Ditto. (bitmap_set_subtract_from_value_set): Ditto. (value_insert_into_set): Ditto. (print_value_set): Ditto. (debug_value_set): Ditto. (constant_expr_p): New function. (bitmap_remove_from_set): Ditto. (bitmap_insert_into_set): Ditto. (bitmap_set_free): Ditto. (vh_compare): Ditto. (sorted_array_from_bitmap_set): Ditto. (bitmap_set_subtract): Ditto. (bitmap_set_equal): Ditto. (debug_bitmap_set): Ditto. (find_leader_in_sets): Ditto. (bitmap_set_replace_value): Modify for bitmapped sets. (phi_translate): Ditto. (phi_translate_set): Ditto. (bitmap_find_leader): Ditto. (valid_in_sets): Ditto. (union_contains_value): Ditto. (clean): Ditto. (compute_antic_aux): Ditto. Mark changed blocks. (compute_antic): Ditto. Iterate in postorder and only over changing blocks. (compute_rvuse_and_antic_safe): Reuse postorder. (create_component_ref_by_pieces): Modify for bitmapped sets. (find_or_generate_expression): Ditto. (create_expression_by_pieces): Ditto. (insert_into_preds_of_block): Ditto. (changed_blocks): New variable. (do_regular_insertion): Broken out from insert_aux. (insert_aux): Modified for bitmapped sets. (find_existing_value_expr): New function. (create_value_expr_from): Use it. (insert_extra_phis): Removed. (print_bitmap_set): Renamed from bitmap_print_value_set. (compute_avail): Handle RETURN_EXPR. (init_pre): Modify for bitmapped sets. * tree-flow.h (has_stmt_ann): New function. From-SVN: r118169
This commit is contained in:
parent
7c73bdc185
commit
83737db21d
|
@ -1,3 +1,75 @@
|
|||
2006-10-29 Daniel Berlin <dberlin@dberlin.org>
|
||||
|
||||
* tree.h (tree_value_handle): Remove struct value_set declaration.
|
||||
Change value_set to bitmap_set.
|
||||
* tree-pretty-print.c (dump_generic_node): Use has_stmt_ann.
|
||||
* tree-vn.c (get_value_handle): Made inline and moved to
|
||||
tree-flow-inline.h.
|
||||
* tree-flow-inline.h: (has_stmt_ann): New function.
|
||||
* tree-ssa-pre.c (expressions): New variable.
|
||||
(next_expression_id): Ditto.
|
||||
(alloc_expression_id): New function.
|
||||
(struct value_set): Remove.
|
||||
(get_expression_id): New function.
|
||||
(get_or_alloc_expression_id): Ditto.
|
||||
(expression_for_id): Ditto.
|
||||
(clear_expression_ids): Ditto.
|
||||
(FOR_EACH_EXPR_ID_IN_SET): New macro.
|
||||
(bb_value_sets): Renamed to bb_bitmap_sets.
|
||||
All value sets replaced with bitmap_sets.
|
||||
Add visited member.
|
||||
(BB_VISITED): New macro.
|
||||
(postorder): New variable.
|
||||
(add_to_value): Removed.
|
||||
(value_exists_in_set_bitmap): Ditto.
|
||||
(value_insert_into_set_bitmap): Ditto.
|
||||
(set_new): Ditto.
|
||||
(set_copy): Ditto.
|
||||
(set_remove): Ditto.
|
||||
(set_contains_value): Ditto.
|
||||
(insert_into_set): Ditto.
|
||||
(set_equal): Ditto.
|
||||
(find_leader): Ditto.
|
||||
(bitmap_set_subtract_from_value_set): Ditto.
|
||||
(value_insert_into_set): Ditto.
|
||||
(print_value_set): Ditto.
|
||||
(debug_value_set): Ditto.
|
||||
(constant_expr_p): New function.
|
||||
(bitmap_remove_from_set): Ditto.
|
||||
(bitmap_insert_into_set): Ditto.
|
||||
(bitmap_set_free): Ditto.
|
||||
(vh_compare): Ditto.
|
||||
(sorted_array_from_bitmap_set): Ditto.
|
||||
(bitmap_set_subtract): Ditto.
|
||||
(bitmap_set_equal): Ditto.
|
||||
(debug_bitmap_set): Ditto.
|
||||
(find_leader_in_sets): Ditto.
|
||||
(bitmap_set_replace_value): Modify for bitmapped sets.
|
||||
(phi_translate): Ditto.
|
||||
(phi_translate_set): Ditto.
|
||||
(bitmap_find_leader): Ditto.
|
||||
(valid_in_sets): Ditto.
|
||||
(union_contains_value): Ditto.
|
||||
(clean): Ditto.
|
||||
(compute_antic_aux): Ditto. Mark changed blocks.
|
||||
(compute_antic): Ditto. Iterate in postorder and only over
|
||||
changing blocks.
|
||||
(compute_rvuse_and_antic_safe): Reuse postorder.
|
||||
(create_component_ref_by_pieces): Modify for bitmapped sets.
|
||||
(find_or_generate_expression): Ditto.
|
||||
(create_expression_by_pieces): Ditto.
|
||||
(insert_into_preds_of_block): Ditto.
|
||||
(changed_blocks): New variable.
|
||||
(do_regular_insertion): Broken out from insert_aux.
|
||||
(insert_aux): Modified for bitmapped sets.
|
||||
(find_existing_value_expr): New function.
|
||||
(create_value_expr_from): Use it.
|
||||
(insert_extra_phis): Removed.
|
||||
(print_bitmap_set): Renamed from bitmap_print_value_set.
|
||||
(compute_avail): Handle RETURN_EXPR.
|
||||
(init_pre): Modify for bitmapped sets.
|
||||
* tree-flow.h (has_stmt_ann): New function.
|
||||
|
||||
2006-10-29 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
* builtins.c (fold_builtin_floor): Check for the availability of
|
||||
|
|
|
@ -163,6 +163,17 @@ get_function_ann (tree var)
|
|||
return (ann) ? ann : create_function_ann (var);
|
||||
}
|
||||
|
||||
/* Return true if T has a statement annotation attached to it. */
|
||||
|
||||
static inline bool
|
||||
has_stmt_ann (tree t)
|
||||
{
|
||||
#ifdef ENABLE_CHECKING
|
||||
gcc_assert (is_gimple_stmt (t));
|
||||
#endif
|
||||
return t->common.ann && t->common.ann->common.type == STMT_ANN;
|
||||
}
|
||||
|
||||
/* Return the statement annotation for T, which must be a statement
|
||||
node. Return NULL if the statement annotation doesn't exist. */
|
||||
static inline stmt_ann_t
|
||||
|
@ -1620,4 +1631,32 @@ overlap_subvar (unsigned HOST_WIDE_INT offset, unsigned HOST_WIDE_INT size,
|
|||
|
||||
}
|
||||
|
||||
/* Get the value handle of EXPR. This is the only correct way to get
|
||||
the value handle for a "thing". If EXPR does not have a value
|
||||
handle associated, it returns NULL_TREE.
|
||||
NB: If EXPR is min_invariant, this function is *required* to return
|
||||
EXPR. */
|
||||
|
||||
static inline tree
|
||||
get_value_handle (tree expr)
|
||||
{
|
||||
if (TREE_CODE (expr) == SSA_NAME)
|
||||
return SSA_NAME_VALUE (expr);
|
||||
else if (DECL_P (expr) || TREE_CODE (expr) == TREE_LIST
|
||||
|| TREE_CODE (expr) == CONSTRUCTOR)
|
||||
{
|
||||
tree_ann_common_t ann = tree_common_ann (expr);
|
||||
return ((ann) ? ann->value_handle : NULL_TREE);
|
||||
}
|
||||
else if (is_gimple_min_invariant (expr))
|
||||
return expr;
|
||||
else if (EXPR_P (expr))
|
||||
{
|
||||
tree_ann_common_t ann = tree_common_ann (expr);
|
||||
return ((ann) ? ann->value_handle : NULL_TREE);
|
||||
}
|
||||
else
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
#endif /* _TREE_FLOW_INLINE_H */
|
||||
|
|
|
@ -344,6 +344,7 @@ static inline var_ann_t get_var_ann (tree);
|
|||
static inline function_ann_t function_ann (tree);
|
||||
static inline function_ann_t get_function_ann (tree);
|
||||
static inline stmt_ann_t stmt_ann (tree);
|
||||
static inline bool has_stmt_ann (tree);
|
||||
static inline stmt_ann_t get_stmt_ann (tree);
|
||||
static inline enum tree_ann_type ann_type (tree_ann_t);
|
||||
static inline basic_block bb_for_stmt (tree);
|
||||
|
@ -920,7 +921,7 @@ void print_value_expressions (FILE *, tree);
|
|||
|
||||
/* In tree-vn.c */
|
||||
bool expressions_equal_p (tree, tree);
|
||||
tree get_value_handle (tree);
|
||||
static inline tree get_value_handle (tree);
|
||||
hashval_t vn_compute (tree, hashval_t);
|
||||
void sort_vuses (VEC (tree, gc) *);
|
||||
tree vn_lookup_or_add (tree, tree);
|
||||
|
|
|
@ -421,10 +421,14 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
|
|||
|
||||
is_expr = EXPR_P (node);
|
||||
|
||||
/* We use has_stmt_ann because CALL_EXPR can be both an expression
|
||||
and a statement, and we have no guarantee that it will have a
|
||||
stmt_ann when it is used as an RHS expression. stmt_ann will assert
|
||||
if you call it on something with a non-stmt annotation attached. */
|
||||
if (TREE_CODE (node) != ERROR_MARK
|
||||
&& is_gimple_stmt (node)
|
||||
&& (flags & TDF_VOPS)
|
||||
&& stmt_ann (node)
|
||||
&& has_stmt_ann (node)
|
||||
&& TREE_CODE (node) != PHI_NODE)
|
||||
dump_vops (buffer, node, spc, flags);
|
||||
|
||||
|
|
1574
gcc/tree-ssa-pre.c
1574
gcc/tree-ssa-pre.c
File diff suppressed because it is too large
Load Diff
|
@ -419,33 +419,6 @@ vn_lookup_or_add_with_vuses (tree expr, VEC (tree, gc) *vuses)
|
|||
return v;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Get the value handle of EXPR. This is the only correct way to get
|
||||
the value handle for a "thing". If EXPR does not have a value
|
||||
handle associated, it returns NULL_TREE.
|
||||
NB: If EXPR is min_invariant, this function is *required* to return EXPR. */
|
||||
|
||||
tree
|
||||
get_value_handle (tree expr)
|
||||
{
|
||||
|
||||
if (is_gimple_min_invariant (expr))
|
||||
return expr;
|
||||
|
||||
if (TREE_CODE (expr) == SSA_NAME)
|
||||
return SSA_NAME_VALUE (expr);
|
||||
else if (EXPR_P (expr) || DECL_P (expr) || TREE_CODE (expr) == TREE_LIST
|
||||
|| TREE_CODE (expr) == CONSTRUCTOR)
|
||||
{
|
||||
tree_ann_common_t ann = tree_common_ann (expr);
|
||||
return ((ann) ? ann->value_handle : NULL_TREE);
|
||||
}
|
||||
else
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
|
||||
/* Initialize data structures used in value numbering. */
|
||||
|
||||
void
|
||||
|
@ -456,7 +429,6 @@ vn_init (void)
|
|||
shared_lookup_vuses = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Delete data used for value numbering. */
|
||||
|
||||
void
|
||||
|
|
|
@ -3140,14 +3140,13 @@ struct tree_statement_list
|
|||
(VALUE_HANDLE_CHECK (NODE)->value_handle.vuses)
|
||||
|
||||
/* Defined and used in tree-ssa-pre.c. */
|
||||
struct value_set;
|
||||
|
||||
struct tree_value_handle GTY(())
|
||||
{
|
||||
struct tree_common common;
|
||||
|
||||
/* The set of expressions represented by this handle. */
|
||||
struct value_set * GTY ((skip)) expr_set;
|
||||
struct bitmap_set * GTY ((skip)) expr_set;
|
||||
|
||||
/* Unique ID for this value handle. IDs are handed out in a
|
||||
conveniently dense form starting at 0, so that we can make
|
||||
|
|
Loading…
Reference in New Issue