Commit acd63801 by Martin Jambor Committed by Martin Jambor

gimple.h (create_tmp_reg): Declare.

2010-04-19  Martin Jambor  <mjambor@suse.cz>

	* gimple.h (create_tmp_reg): Declare.
	* gimplify.c (create_tmp_reg): New function.
	(gimplify_return_expr): Use create_tmp_reg.
	(gimplify_omp_atomic): Likewise.
	(gimple_regimplify_operands): Likewise.
	* tree-dfa.c (make_rename_temp): Likewise.
	* tree-predcom.c (predcom_tmp_var): Likewise.
	(reassociate_to_the_same_stmt): Likewise.
	* tree-sra.c (replace_uses_with_default_def_ssa_name): Likewise.
	(get_replaced_param_substitute): Likewise.
	* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
	* tree-ssa-phiopt.c (cond_store_replacement): Likewise.
	* tree-ssa-pre.c (get_representative_for): Likewise.
	(create_expression_by_pieces): Likewise.
	* tree-tailcall.c (adjust_return_value_with_ops): Likewise.
	(create_tailcall_accumulator): Likewise.

From-SVN: r158523
parent 0b6e2868
2010-04-19 Martin Jambor <mjambor@suse.cz>
* gimple.h (create_tmp_reg): Declare.
* gimplify.c (create_tmp_reg): New function.
(gimplify_return_expr): Use create_tmp_reg.
(gimplify_omp_atomic): Likewise.
(gimple_regimplify_operands): Likewise.
* tree-dfa.c (make_rename_temp): Likewise.
* tree-predcom.c (predcom_tmp_var): Likewise.
(reassociate_to_the_same_stmt): Likewise.
* tree-sra.c (replace_uses_with_default_def_ssa_name): Likewise.
(get_replaced_param_substitute): Likewise.
* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
* tree-ssa-phiopt.c (cond_store_replacement): Likewise.
* tree-ssa-pre.c (get_representative_for): Likewise.
(create_expression_by_pieces): Likewise.
* tree-tailcall.c (adjust_return_value_with_ops): Likewise.
(create_tailcall_accumulator): Likewise.
2010-04-19 Martin Jambor <mjambor@suse.cz>
* cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Update
new_stmt.
(cgraph_materialize_all_clones): Assert !need_ssa_update_p.
......
......@@ -964,6 +964,7 @@ extern bool gimple_ior_addresses_taken (bitmap, gimple);
extern tree create_tmp_var_raw (tree, const char *);
extern tree create_tmp_var_name (const char *);
extern tree create_tmp_var (tree, const char *);
extern tree create_tmp_reg (tree, const char *);
extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *);
extern tree get_formal_tmp_var (tree, gimple_seq *);
extern void declare_vars (tree, gimple, bool);
......
......@@ -508,6 +508,23 @@ create_tmp_var (tree type, const char *prefix)
return tmp_var;
}
/* Create a new temporary variable declaration of type TYPE by calling
create_tmp_var and if TYPE is a vector or a complex number, mark the new
temporary as gimple register. */
tree
create_tmp_reg (tree type, const char *prefix)
{
tree tmp;
tmp = create_tmp_var (type, prefix);
if (TREE_CODE (type) == COMPLEX_TYPE
|| TREE_CODE (type) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (tmp) = 1;
return tmp;
}
/* Create a temporary with a name derived from VAL. Subroutine of
lookup_tmp_var; nobody else should call this function. */
......@@ -1219,10 +1236,7 @@ gimplify_return_expr (tree stmt, gimple_seq *pre_p)
result = gimplify_ctxp->return_temp;
else
{
result = create_tmp_var (TREE_TYPE (result_decl), NULL);
if (TREE_CODE (TREE_TYPE (result)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (result)) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (result) = 1;
result = create_tmp_reg (TREE_TYPE (result_decl), NULL);
/* ??? With complex control flow (usually involving abnormal edges),
we can wind up warning about an uninitialized value for this. Due
......@@ -6351,9 +6365,7 @@ gimplify_omp_atomic (tree *expr_p, gimple_seq *pre_p)
tree type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (addr)));
tree tmp_load;
tmp_load = create_tmp_var (type, NULL);
if (TREE_CODE (type) == COMPLEX_TYPE || TREE_CODE (type) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (tmp_load) = 1;
tmp_load = create_tmp_reg (type, NULL);
if (goa_stabilize_expr (&rhs, pre_p, addr, tmp_load) < 0)
return GS_ERROR;
......@@ -7828,11 +7840,8 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
}
if (need_temp)
{
tree temp = create_tmp_var (TREE_TYPE (lhs), NULL);
tree temp = create_tmp_reg (TREE_TYPE (lhs), NULL);
if (TREE_CODE (TREE_TYPE (lhs)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (lhs)) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (temp) = 1;
if (TREE_CODE (orig_lhs) == SSA_NAME)
orig_lhs = SSA_NAME_VAR (orig_lhs);
......
......@@ -193,11 +193,7 @@ renumber_gimple_stmt_uids_in_blocks (basic_block *blocks, int n_blocks)
tree
make_rename_temp (tree type, const char *prefix)
{
tree t = create_tmp_var (type, prefix);
if (TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (t) = 1;
tree t = create_tmp_reg (type, prefix);
if (gimple_referenced_vars (cfun))
{
......
......@@ -1460,13 +1460,9 @@ static tree
predcom_tmp_var (tree ref, unsigned i, bitmap tmp_vars)
{
tree type = TREE_TYPE (ref);
tree var = create_tmp_var (type, get_lsm_tmp_name (ref, i));
/* We never access the components of the temporary variable in predictive
commoning. */
if (TREE_CODE (type) == COMPLEX_TYPE
|| TREE_CODE (type) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (var) = 1;
tree var = create_tmp_reg (type, get_lsm_tmp_name (ref, i));
add_referenced_var (var);
bitmap_set_bit (tmp_vars, DECL_UID (var));
......@@ -2209,18 +2205,12 @@ reassociate_to_the_same_stmt (tree name1, tree name2)
/* Insert the new statement combining NAME1 and NAME2 before S1, and
combine it with the rhs of S1. */
var = create_tmp_var (type, "predreastmp");
if (TREE_CODE (type) == COMPLEX_TYPE
|| TREE_CODE (type) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (var) = 1;
var = create_tmp_reg (type, "predreastmp");
add_referenced_var (var);
new_name = make_ssa_name (var, NULL);
new_stmt = gimple_build_assign_with_ops (code, new_name, name1, name2);
var = create_tmp_var (type, "predreastmp");
if (TREE_CODE (type) == COMPLEX_TYPE
|| TREE_CODE (type) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (var) = 1;
var = create_tmp_reg (type, "predreastmp");
add_referenced_var (var);
tmp_name = make_ssa_name (var, NULL);
......
......@@ -2537,10 +2537,7 @@ replace_uses_with_default_def_ssa_name (tree ssa)
tree repl, decl = SSA_NAME_VAR (ssa);
if (TREE_CODE (decl) == PARM_DECL)
{
tree tmp = create_tmp_var (TREE_TYPE (decl), "SR");
if (TREE_CODE (TREE_TYPE (tmp)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (tmp)) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (tmp) = 1;
tree tmp = create_tmp_reg (TREE_TYPE (decl), "SR");
get_var_ann (tmp);
add_referenced_var (tmp);
......@@ -3733,10 +3730,7 @@ get_replaced_param_substitute (struct ipa_parm_adjustment *adj)
{
char *pretty_name = make_fancy_name (adj->base);
repl = create_tmp_var (TREE_TYPE (adj->base), "ISR");
if (TREE_CODE (TREE_TYPE (repl)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (repl)) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (repl) = 1;
repl = create_tmp_reg (TREE_TYPE (adj->base), "ISR");
DECL_NAME (repl) = get_identifier (pretty_name);
obstack_free (&name_obstack, pretty_name);
......
......@@ -1226,11 +1226,8 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb,
of the memory touched by the store, if we need to. */
if (!condstoretemp || TREE_TYPE (lhs) != TREE_TYPE (condstoretemp))
{
condstoretemp = create_tmp_var (TREE_TYPE (lhs), "cstore");
condstoretemp = create_tmp_reg (TREE_TYPE (lhs), "cstore");
get_var_ann (condstoretemp);
if (TREE_CODE (TREE_TYPE (lhs)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (lhs)) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (condstoretemp) = 1;
}
add_referenced_var (condstoretemp);
......
......@@ -190,11 +190,8 @@ phiprop_insert_phi (basic_block bb, gimple phi, gimple use_stmt,
{
gcc_assert (TREE_CODE (old_arg) == ADDR_EXPR);
old_arg = TREE_OPERAND (old_arg, 0);
new_var = create_tmp_var (TREE_TYPE (old_arg), NULL);
new_var = create_tmp_reg (TREE_TYPE (old_arg), NULL);
tmp = gimple_build_assign (new_var, unshare_expr (old_arg));
if (TREE_CODE (TREE_TYPE (old_arg)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (old_arg)) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (new_var) = 1;
gcc_assert (is_gimple_reg (new_var));
add_referenced_var (new_var);
new_var = make_ssa_name (new_var, tmp);
......
......@@ -1407,7 +1407,7 @@ get_representative_for (const pre_expr e)
that we will return. */
if (!pretemp || exprtype != TREE_TYPE (pretemp))
{
pretemp = create_tmp_var (exprtype, "pretmp");
pretemp = create_tmp_reg (exprtype, "pretmp");
get_var_ann (pretemp);
}
......@@ -3088,17 +3088,13 @@ create_expression_by_pieces (basic_block block, pre_expr expr,
that we will return. */
if (!pretemp || exprtype != TREE_TYPE (pretemp))
{
pretemp = create_tmp_var (exprtype, "pretmp");
pretemp = create_tmp_reg (exprtype, "pretmp");
get_var_ann (pretemp);
}
temp = pretemp;
add_referenced_var (temp);
if (TREE_CODE (exprtype) == COMPLEX_TYPE
|| TREE_CODE (exprtype) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (temp) = 1;
newstmt = gimple_build_assign (temp, folded);
name = make_ssa_name (temp, newstmt);
gimple_assign_set_lhs (newstmt, name);
......
......@@ -575,13 +575,10 @@ adjust_return_value_with_ops (enum tree_code code, const char *label,
{
tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
tree tmp = create_tmp_var (ret_type, label);
tree tmp = create_tmp_reg (ret_type, label);
gimple stmt;
tree result;
if (TREE_CODE (ret_type) == COMPLEX_TYPE
|| TREE_CODE (ret_type) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (tmp) = 1;
add_referenced_var (tmp);
if (types_compatible_p (TREE_TYPE (acc), TREE_TYPE (op1)))
......@@ -908,12 +905,9 @@ static tree
create_tailcall_accumulator (const char *label, basic_block bb, tree init)
{
tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
tree tmp = create_tmp_var (ret_type, label);
tree tmp = create_tmp_reg (ret_type, label);
gimple phi;
if (TREE_CODE (ret_type) == COMPLEX_TYPE
|| TREE_CODE (ret_type) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (tmp) = 1;
add_referenced_var (tmp);
phi = create_phi_node (tmp, bb);
/* RET_TYPE can be a float when -ffast-maths is enabled. */
......
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