tree-vect-loop-manip.c (vect_can_advance_ivs_p): Query is_gimple_reg on the SSA name, not its variable.

2012-08-03  Richard Guenther  <rguenther@suse.de>

	* tree-vect-loop-manip.c (vect_can_advance_ivs_p): Query
	is_gimple_reg on the SSA name, not its variable.
	(vect_update_ivs_after_vectorizer): Likewise.
	* tree-ssa-copyrename.c (rename_ssa_copies): Likewise.
	* tree-if-conv.c (if_convertible_phi_p): Likewise.
	(predicate_scalar_phi): Likewise.
	* tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
	(vect_analyze_scalar_cycles_1): Likewise.
	* tree-ssa-live.c (register_ssa_partition_check): Likewise.
	* tree-outof-ssa.c (eliminate_useless_phis): Likewise.
	* tree-ssa-reassoc.c (phi_rank): Likewise.
	* tree-parloops.c (separate_decls_in_region_name): Use
	replace_ssa_name_symbol.
	* tree-predcom.c (base_names_in_chain_on): Likewise.
	* matrix-reorg.c (update_type_size): Query the type of the SSA name,
	not its variable.
	* gimple-ssa-strength-reduction.c (create_mul_ssa_cand): Likewise.
	(create_mul_imm_cand): Likewise.
	(create_add_ssa_cand): Likewise.
	(create_add_imm_cand): Likewise.
	(slsr_process_add): Likewise.
	* tree-inline.c (remap_ssa_name): Do not set the type of the
	new SSA_NAME.
	* tree-ssa-structalias.c (get_constraint_for_ssa_var): Clarify
	assert.  Check for default def first.

From-SVN: r190116
This commit is contained in:
Richard Guenther 2012-08-03 08:55:43 +00:00 committed by Richard Biener
parent 1b03a96df6
commit b2ec94d440
14 changed files with 55 additions and 29 deletions

View File

@ -1,3 +1,31 @@
2012-08-03 Richard Guenther <rguenther@suse.de>
* tree-vect-loop-manip.c (vect_can_advance_ivs_p): Query
is_gimple_reg on the SSA name, not its variable.
(vect_update_ivs_after_vectorizer): Likewise.
* tree-ssa-copyrename.c (rename_ssa_copies): Likewise.
* tree-if-conv.c (if_convertible_phi_p): Likewise.
(predicate_scalar_phi): Likewise.
* tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
(vect_analyze_scalar_cycles_1): Likewise.
* tree-ssa-live.c (register_ssa_partition_check): Likewise.
* tree-outof-ssa.c (eliminate_useless_phis): Likewise.
* tree-ssa-reassoc.c (phi_rank): Likewise.
* tree-parloops.c (separate_decls_in_region_name): Use
replace_ssa_name_symbol.
* tree-predcom.c (base_names_in_chain_on): Likewise.
* matrix-reorg.c (update_type_size): Query the type of the SSA name,
not its variable.
* gimple-ssa-strength-reduction.c (create_mul_ssa_cand): Likewise.
(create_mul_imm_cand): Likewise.
(create_add_ssa_cand): Likewise.
(create_add_imm_cand): Likewise.
(slsr_process_add): Likewise.
* tree-inline.c (remap_ssa_name): Do not set the type of the
new SSA_NAME.
* tree-ssa-structalias.c (get_constraint_for_ssa_var): Clarify
assert. Check for default def first.
2012-08-04 Steven Bosscher <steven@gcc.gnu.org> 2012-08-04 Steven Bosscher <steven@gcc.gnu.org>
* cfgrtl.c (print_rtl_with_bb): Do not print a newline between insns. * cfgrtl.c (print_rtl_with_bb): Do not print a newline between insns.

View File

@ -656,7 +656,7 @@ create_mul_ssa_cand (gimple gs, tree base_in, tree stride_in, bool speed)
base = base_in; base = base_in;
index = double_int_zero; index = double_int_zero;
stride = stride_in; stride = stride_in;
ctype = TREE_TYPE (SSA_NAME_VAR (base_in)); ctype = TREE_TYPE (base_in);
} }
c = alloc_cand_and_find_basis (CAND_MULT, gs, base, index, stride, c = alloc_cand_and_find_basis (CAND_MULT, gs, base, index, stride,
@ -744,7 +744,7 @@ create_mul_imm_cand (gimple gs, tree base_in, tree stride_in, bool speed)
base = base_in; base = base_in;
index = double_int_zero; index = double_int_zero;
stride = stride_in; stride = stride_in;
ctype = TREE_TYPE (SSA_NAME_VAR (base_in)); ctype = TREE_TYPE (base_in);
} }
c = alloc_cand_and_find_basis (CAND_MULT, gs, base, index, stride, c = alloc_cand_and_find_basis (CAND_MULT, gs, base, index, stride,
@ -828,7 +828,7 @@ create_add_ssa_cand (gimple gs, tree base_in, tree addend_in,
if (subtract_p) if (subtract_p)
index = double_int_neg (index); index = double_int_neg (index);
stride = addend_cand->base_expr; stride = addend_cand->base_expr;
ctype = TREE_TYPE (SSA_NAME_VAR (base_in)); ctype = TREE_TYPE (base_in);
if (has_single_use (addend_in)) if (has_single_use (addend_in))
savings = (addend_cand->dead_savings savings = (addend_cand->dead_savings
+ stmt_cost (addend_cand->cand_stmt, speed)); + stmt_cost (addend_cand->cand_stmt, speed));
@ -877,7 +877,7 @@ create_add_ssa_cand (gimple gs, tree base_in, tree addend_in,
index = tree_to_double_int (subtrahend_cand->stride); index = tree_to_double_int (subtrahend_cand->stride);
index = double_int_neg (index); index = double_int_neg (index);
stride = subtrahend_cand->base_expr; stride = subtrahend_cand->base_expr;
ctype = TREE_TYPE (SSA_NAME_VAR (base_in)); ctype = TREE_TYPE (base_in);
if (has_single_use (addend_in)) if (has_single_use (addend_in))
savings = (subtrahend_cand->dead_savings savings = (subtrahend_cand->dead_savings
+ stmt_cost (subtrahend_cand->cand_stmt, speed)); + stmt_cost (subtrahend_cand->cand_stmt, speed));
@ -903,7 +903,7 @@ create_add_ssa_cand (gimple gs, tree base_in, tree addend_in,
base = base_in; base = base_in;
index = subtract_p ? double_int_minus_one : double_int_one; index = subtract_p ? double_int_minus_one : double_int_one;
stride = addend_in; stride = addend_in;
ctype = TREE_TYPE (SSA_NAME_VAR (base_in)); ctype = TREE_TYPE (base_in);
} }
c = alloc_cand_and_find_basis (CAND_ADD, gs, base, index, stride, c = alloc_cand_and_find_basis (CAND_ADD, gs, base, index, stride,
@ -968,7 +968,7 @@ create_add_imm_cand (gimple gs, tree base_in, double_int index_in, bool speed)
base = base_in; base = base_in;
index = index_in; index = index_in;
stride = integer_one_node; stride = integer_one_node;
ctype = TREE_TYPE (SSA_NAME_VAR (base_in)); ctype = TREE_TYPE (base_in);
} }
c = alloc_cand_and_find_basis (kind, gs, base, index, stride, c = alloc_cand_and_find_basis (kind, gs, base, index, stride,
@ -990,7 +990,7 @@ slsr_process_add (gimple gs, tree rhs1, tree rhs2, bool speed)
/* First record an interpretation assuming RHS1 is the base expression /* First record an interpretation assuming RHS1 is the base expression
and RHS2 is the stride. But it doesn't make sense for the and RHS2 is the stride. But it doesn't make sense for the
stride to be a pointer, so don't record a candidate in that case. */ stride to be a pointer, so don't record a candidate in that case. */
if (!POINTER_TYPE_P (TREE_TYPE (SSA_NAME_VAR (rhs2)))) if (!POINTER_TYPE_P (TREE_TYPE (rhs2)))
{ {
c = create_add_ssa_cand (gs, rhs1, rhs2, subtract_p, speed); c = create_add_ssa_cand (gs, rhs1, rhs2, subtract_p, speed);
@ -1007,7 +1007,7 @@ slsr_process_add (gimple gs, tree rhs1, tree rhs2, bool speed)
/* Otherwise, record another interpretation assuming RHS2 is the /* Otherwise, record another interpretation assuming RHS2 is the
base expression and RHS1 is the stride, again provided that the base expression and RHS1 is the stride, again provided that the
stride is not a pointer. */ stride is not a pointer. */
if (!POINTER_TYPE_P (TREE_TYPE (SSA_NAME_VAR (rhs1)))) if (!POINTER_TYPE_P (TREE_TYPE (rhs1)))
{ {
c2 = create_add_ssa_cand (gs, rhs2, rhs1, false, speed); c2 = create_add_ssa_cand (gs, rhs2, rhs1, false, speed);
if (c) if (c)

View File

@ -976,11 +976,10 @@ update_type_size (struct matrix_info *mi, gimple stmt, tree ssa_var,
{ {
lhs = gimple_assign_lhs (stmt); lhs = gimple_assign_lhs (stmt);
gcc_assert (POINTER_TYPE_P gcc_assert (POINTER_TYPE_P
(TREE_TYPE (SSA_NAME_VAR (TREE_OPERAND (lhs, 0))))); (TREE_TYPE (TREE_OPERAND (lhs, 0))));
type_size = type_size =
int_size_in_bytes (TREE_TYPE int_size_in_bytes (TREE_TYPE
(TREE_TYPE (TREE_TYPE (TREE_OPERAND (lhs, 0))));
(SSA_NAME_VAR (TREE_OPERAND (lhs, 0)))));
} }
else else
type_size = int_size_in_bytes (TREE_TYPE (ssa_var)); type_size = int_size_in_bytes (TREE_TYPE (ssa_var));

View File

@ -425,7 +425,7 @@ if_convertible_phi_p (struct loop *loop, basic_block bb, gimple phi)
/* When the flag_tree_loop_if_convert_stores is not set, check /* When the flag_tree_loop_if_convert_stores is not set, check
that there are no memory writes in the branches of the loop to be that there are no memory writes in the branches of the loop to be
if-converted. */ if-converted. */
if (!is_gimple_reg (SSA_NAME_VAR (gimple_phi_result (phi)))) if (!is_gimple_reg (gimple_phi_result (phi)))
{ {
imm_use_iterator imm_iter; imm_use_iterator imm_iter;
use_operand_p use_p; use_operand_p use_p;
@ -1277,7 +1277,7 @@ predicate_scalar_phi (gimple phi, tree cond,
res = gimple_phi_result (phi); res = gimple_phi_result (phi);
/* Do not handle virtual phi nodes. */ /* Do not handle virtual phi nodes. */
if (!is_gimple_reg (SSA_NAME_VAR (res))) if (!is_gimple_reg (res))
return; return;
bb = gimple_bb (phi); bb = gimple_bb (phi);

View File

@ -237,7 +237,6 @@ remap_ssa_name (tree name, copy_body_data *id)
insert_decl_map (id, name, new_tree); insert_decl_map (id, name, new_tree);
SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_tree) SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_tree)
= SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name); = SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name);
TREE_TYPE (new_tree) = TREE_TYPE (SSA_NAME_VAR (new_tree));
/* At least IPA points-to info can be directly transferred. */ /* At least IPA points-to info can be directly transferred. */
if (id->src_cfun->gimple_df if (id->src_cfun->gimple_df
&& id->src_cfun->gimple_df->ipa_pta && id->src_cfun->gimple_df->ipa_pta

View File

@ -762,7 +762,7 @@ eliminate_useless_phis (void)
{ {
gimple phi = gsi_stmt (gsi); gimple phi = gsi_stmt (gsi);
result = gimple_phi_result (phi); result = gimple_phi_result (phi);
if (!is_gimple_reg (SSA_NAME_VAR (result))) if (!is_gimple_reg (result))
{ {
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
size_t i; size_t i;
@ -772,7 +772,7 @@ eliminate_useless_phis (void)
{ {
tree arg = PHI_ARG_DEF (phi, i); tree arg = PHI_ARG_DEF (phi, i);
if (TREE_CODE (arg) == SSA_NAME if (TREE_CODE (arg) == SSA_NAME
&& is_gimple_reg (SSA_NAME_VAR (arg))) && is_gimple_reg (arg))
{ {
fprintf (stderr, "Argument of PHI is not virtual ("); fprintf (stderr, "Argument of PHI is not virtual (");
print_generic_expr (stderr, arg, TDF_SLIM); print_generic_expr (stderr, arg, TDF_SLIM);

View File

@ -837,7 +837,7 @@ separate_decls_in_region_name (tree name,
copy = name; copy = name;
} }
SSA_NAME_VAR (copy) = var_copy; replace_ssa_name_symbol (copy, var_copy);
return copy; return copy;
} }

View File

@ -1862,7 +1862,7 @@ base_names_in_chain_on (struct loop *loop, tree name, tree var)
gimple stmt, phi; gimple stmt, phi;
imm_use_iterator iter; imm_use_iterator iter;
SSA_NAME_VAR (name) = var; replace_ssa_name_symbol (name, var);
while (1) while (1)
{ {
@ -1880,7 +1880,7 @@ base_names_in_chain_on (struct loop *loop, tree name, tree var)
return; return;
name = PHI_RESULT (phi); name = PHI_RESULT (phi);
SSA_NAME_VAR (name) = var; replace_ssa_name_symbol (name, var);
} }
} }

View File

@ -332,7 +332,7 @@ rename_ssa_copies (void)
res = gimple_phi_result (phi); res = gimple_phi_result (phi);
/* Do not process virtual SSA_NAMES. */ /* Do not process virtual SSA_NAMES. */
if (!is_gimple_reg (SSA_NAME_VAR (res))) if (!is_gimple_reg (res))
continue; continue;
for (i = 0; i < gimple_phi_num_args (phi); i++) for (i = 0; i < gimple_phi_num_args (phi); i++)

View File

@ -1199,7 +1199,7 @@ void
register_ssa_partition_check (tree ssa_var) register_ssa_partition_check (tree ssa_var)
{ {
gcc_assert (TREE_CODE (ssa_var) == SSA_NAME); gcc_assert (TREE_CODE (ssa_var) == SSA_NAME);
if (!is_gimple_reg (SSA_NAME_VAR (ssa_var))) if (!is_gimple_reg (ssa_var))
{ {
fprintf (stderr, "Illegally registering a virtual SSA name :"); fprintf (stderr, "Illegally registering a virtual SSA name :");
print_generic_expr (stderr, ssa_var, TDF_SLIM); print_generic_expr (stderr, ssa_var, TDF_SLIM);

View File

@ -234,7 +234,7 @@ phi_rank (gimple stmt)
/* Ignore virtual SSA_NAMEs. */ /* Ignore virtual SSA_NAMEs. */
res = gimple_phi_result (stmt); res = gimple_phi_result (stmt);
if (!is_gimple_reg (SSA_NAME_VAR (res))) if (!is_gimple_reg (res))
return bb_rank[bb->index]; return bb_rank[bb->index];
/* The phi definition must have a single use, and that use must be /* The phi definition must have a single use, and that use must be

View File

@ -2736,14 +2736,14 @@ get_constraint_for_ssa_var (tree t, VEC(ce_s, heap) **results, bool address_p)
varinfo_t vi; varinfo_t vi;
/* We allow FUNCTION_DECLs here even though it doesn't make much sense. */ /* We allow FUNCTION_DECLs here even though it doesn't make much sense. */
gcc_assert (SSA_VAR_P (t) || DECL_P (t)); gcc_assert (TREE_CODE (t) == SSA_NAME || DECL_P (t));
/* For parameters, get at the points-to set for the actual parm /* For parameters, get at the points-to set for the actual parm
decl. */ decl. */
if (TREE_CODE (t) == SSA_NAME if (TREE_CODE (t) == SSA_NAME
&& SSA_NAME_IS_DEFAULT_DEF (t)
&& (TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL && (TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL
|| TREE_CODE (SSA_NAME_VAR (t)) == RESULT_DECL) || TREE_CODE (SSA_NAME_VAR (t)) == RESULT_DECL))
&& SSA_NAME_IS_DEFAULT_DEF (t))
{ {
get_constraint_for_ssa_var (SSA_NAME_VAR (t), results, address_p); get_constraint_for_ssa_var (SSA_NAME_VAR (t), results, address_p);
return; return;

View File

@ -1658,7 +1658,7 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo)
/* Skip virtual phi's. The data dependences that are associated with /* Skip virtual phi's. The data dependences that are associated with
virtual defs/uses (i.e., memory accesses) are analyzed elsewhere. */ virtual defs/uses (i.e., memory accesses) are analyzed elsewhere. */
if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi)))) if (!is_gimple_reg (PHI_RESULT (phi)))
{ {
if (vect_print_dump_info (REPORT_DETAILS)) if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "virtual phi. skip."); fprintf (vect_dump, "virtual phi. skip.");
@ -1788,7 +1788,7 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters,
} }
/* Skip virtual phi's. */ /* Skip virtual phi's. */
if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi)))) if (!is_gimple_reg (PHI_RESULT (phi)))
{ {
if (vect_print_dump_info (REPORT_DETAILS)) if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "virtual phi. skip."); fprintf (vect_dump, "virtual phi. skip.");

View File

@ -555,7 +555,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
/* Skip virtual phi's. The data dependences that are associated with /* Skip virtual phi's. The data dependences that are associated with
virtual defs/uses (i.e., memory accesses) are analyzed elsewhere. */ virtual defs/uses (i.e., memory accesses) are analyzed elsewhere. */
if (!is_gimple_reg (SSA_NAME_VAR (def))) if (!is_gimple_reg (def))
continue; continue;
STMT_VINFO_DEF_TYPE (stmt_vinfo) = vect_unknown_def_type; STMT_VINFO_DEF_TYPE (stmt_vinfo) = vect_unknown_def_type;
@ -604,7 +604,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM); print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
} }
gcc_assert (is_gimple_reg (SSA_NAME_VAR (def))); gcc_assert (is_gimple_reg (def));
gcc_assert (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_unknown_def_type); gcc_assert (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_unknown_def_type);
nested_cycle = (loop != LOOP_VINFO_LOOP (loop_vinfo)); nested_cycle = (loop != LOOP_VINFO_LOOP (loop_vinfo));