Commit 67386041 by Richard Guenther Committed by Richard Biener

tree.h (SSA_VAR_P): Simplify.

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

	* tree.h (SSA_VAR_P): Simplify.
	* tree-ssanames.c (make_ssa_name_fn): Strengthen assert.
	* fold-const.c (fold_comparison): Check for default def first
	before checking for PARM_DECL.
	* tree-complex.c (get_component_ssa_name): Likewise.
	* tree-inline.c (remap_ssa_name): Likewise.
	* tree-ssa-loop-ivopts.c (parm_decl_cost): Likewise.
	* tree-ssa-structalias.c (get_fi_for_callee): Likewise.
	(find_what_p_points_to): Likewise.
	* tree-ssa-operands.c (add_stmt_operand): Simplify.

From-SVN: r190250
parent 4531d13a
2012-08-09 Richard Guenther <rguenther@suse.de>
* tree.h (SSA_VAR_P): Simplify.
* tree-ssanames.c (make_ssa_name_fn): Strengthen assert.
* fold-const.c (fold_comparison): Check for default def first
before checking for PARM_DECL.
* tree-complex.c (get_component_ssa_name): Likewise.
* tree-inline.c (remap_ssa_name): Likewise.
* tree-ssa-loop-ivopts.c (parm_decl_cost): Likewise.
* tree-ssa-structalias.c (get_fi_for_callee): Likewise.
(find_what_p_points_to): Likewise.
* tree-ssa-operands.c (add_stmt_operand): Simplify.
2012-08-08 Joseph Myers <joseph@codesourcery.com> 2012-08-08 Joseph Myers <joseph@codesourcery.com>
* simplify-rtx.c (simplify_binary_operation_1): Do not simplify * simplify-rtx.c (simplify_binary_operation_1): Do not simplify
......
...@@ -8940,16 +8940,16 @@ fold_comparison (location_t loc, enum tree_code code, tree type, ...@@ -8940,16 +8940,16 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
&& auto_var_in_fn_p (base0, current_function_decl) && auto_var_in_fn_p (base0, current_function_decl)
&& !indirect_base1 && !indirect_base1
&& TREE_CODE (base1) == SSA_NAME && TREE_CODE (base1) == SSA_NAME
&& TREE_CODE (SSA_NAME_VAR (base1)) == PARM_DECL && SSA_NAME_IS_DEFAULT_DEF (base1)
&& SSA_NAME_IS_DEFAULT_DEF (base1)) && TREE_CODE (SSA_NAME_VAR (base1)) == PARM_DECL)
|| (TREE_CODE (arg1) == ADDR_EXPR || (TREE_CODE (arg1) == ADDR_EXPR
&& indirect_base1 && indirect_base1
&& TREE_CODE (base1) == VAR_DECL && TREE_CODE (base1) == VAR_DECL
&& auto_var_in_fn_p (base1, current_function_decl) && auto_var_in_fn_p (base1, current_function_decl)
&& !indirect_base0 && !indirect_base0
&& TREE_CODE (base0) == SSA_NAME && TREE_CODE (base0) == SSA_NAME
&& TREE_CODE (SSA_NAME_VAR (base0)) == PARM_DECL && SSA_NAME_IS_DEFAULT_DEF (base0)
&& SSA_NAME_IS_DEFAULT_DEF (base0))) && TREE_CODE (SSA_NAME_VAR (base0)) == PARM_DECL))
{ {
if (code == NE_EXPR) if (code == NE_EXPR)
return constant_boolean_node (1, type); return constant_boolean_node (1, type);
......
...@@ -495,8 +495,8 @@ get_component_ssa_name (tree ssa_name, bool imag_p) ...@@ -495,8 +495,8 @@ get_component_ssa_name (tree ssa_name, bool imag_p)
is used in an abnormal phi, and whether it's uninitialized. */ is used in an abnormal phi, and whether it's uninitialized. */
SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ret) SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ret)
= SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ssa_name); = SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ssa_name);
if (TREE_CODE (SSA_NAME_VAR (ssa_name)) == VAR_DECL if (SSA_NAME_IS_DEFAULT_DEF (ssa_name)
&& SSA_NAME_IS_DEFAULT_DEF (ssa_name)) && TREE_CODE (SSA_NAME_VAR (ssa_name)) == VAR_DECL)
{ {
SSA_NAME_DEF_STMT (ret) = SSA_NAME_DEF_STMT (ssa_name); SSA_NAME_DEF_STMT (ret) = SSA_NAME_DEF_STMT (ssa_name);
set_ssa_default_def (cfun, SSA_NAME_VAR (ret), ret); set_ssa_default_def (cfun, SSA_NAME_VAR (ret), ret);
......
...@@ -187,8 +187,8 @@ remap_ssa_name (tree name, copy_body_data *id) ...@@ -187,8 +187,8 @@ remap_ssa_name (tree name, copy_body_data *id)
if (processing_debug_stmt) if (processing_debug_stmt)
{ {
if (TREE_CODE (SSA_NAME_VAR (name)) == PARM_DECL if (SSA_NAME_IS_DEFAULT_DEF (name)
&& SSA_NAME_IS_DEFAULT_DEF (name) && TREE_CODE (SSA_NAME_VAR (name)) == PARM_DECL
&& id->entry_bb == NULL && id->entry_bb == NULL
&& single_succ_p (ENTRY_BLOCK_PTR)) && single_succ_p (ENTRY_BLOCK_PTR))
{ {
......
...@@ -4642,8 +4642,8 @@ parm_decl_cost (struct ivopts_data *data, tree bound) ...@@ -4642,8 +4642,8 @@ parm_decl_cost (struct ivopts_data *data, tree bound)
STRIP_NOPS (sbound); STRIP_NOPS (sbound);
if (TREE_CODE (sbound) == SSA_NAME if (TREE_CODE (sbound) == SSA_NAME
&& SSA_NAME_IS_DEFAULT_DEF (sbound)
&& TREE_CODE (SSA_NAME_VAR (sbound)) == PARM_DECL && TREE_CODE (SSA_NAME_VAR (sbound)) == PARM_DECL
&& gimple_nop_p (SSA_NAME_DEF_STMT (sbound))
&& data->body_includes_call) && data->body_includes_call)
return COSTS_N_INSNS (1); return COSTS_N_INSNS (1);
......
...@@ -615,19 +615,11 @@ add_virtual_operand (gimple stmt ATTRIBUTE_UNUSED, int flags) ...@@ -615,19 +615,11 @@ add_virtual_operand (gimple stmt ATTRIBUTE_UNUSED, int flags)
static void static void
add_stmt_operand (tree *var_p, gimple stmt, int flags) add_stmt_operand (tree *var_p, gimple stmt, int flags)
{ {
tree var, sym; tree var = *var_p;
gcc_assert (SSA_VAR_P (*var_p)); gcc_assert (SSA_VAR_P (*var_p));
var = *var_p; if (is_gimple_reg (var))
sym = (TREE_CODE (var) == SSA_NAME ? SSA_NAME_VAR (var) : var);
/* Mark statements with volatile operands. */
if (!(flags & opf_no_vops)
&& TREE_THIS_VOLATILE (sym))
gimple_set_has_volatile_ops (stmt, true);
if (is_gimple_reg (sym))
{ {
/* The variable is a GIMPLE register. Add it to real operands. */ /* The variable is a GIMPLE register. Add it to real operands. */
if (flags & opf_def) if (flags & opf_def)
...@@ -636,7 +628,15 @@ add_stmt_operand (tree *var_p, gimple stmt, int flags) ...@@ -636,7 +628,15 @@ add_stmt_operand (tree *var_p, gimple stmt, int flags)
append_use (var_p); append_use (var_p);
} }
else else
add_virtual_operand (stmt, flags); {
/* Mark statements with volatile operands. */
if (!(flags & opf_no_vops)
&& TREE_THIS_VOLATILE (var))
gimple_set_has_volatile_ops (stmt, true);
/* The variable is a memory access. Add virtual operands. */
add_virtual_operand (stmt, flags);
}
} }
/* Mark the base address of REF as having its address taken. /* Mark the base address of REF as having its address taken.
......
...@@ -3976,9 +3976,9 @@ get_fi_for_callee (gimple call) ...@@ -3976,9 +3976,9 @@ get_fi_for_callee (gimple call)
if (!fn || TREE_CODE (fn) != SSA_NAME) if (!fn || TREE_CODE (fn) != SSA_NAME)
return get_varinfo (anything_id); return get_varinfo (anything_id);
if ((TREE_CODE (SSA_NAME_VAR (fn)) == PARM_DECL if (SSA_NAME_IS_DEFAULT_DEF (fn)
|| TREE_CODE (SSA_NAME_VAR (fn)) == RESULT_DECL) && (TREE_CODE (SSA_NAME_VAR (fn)) == PARM_DECL
&& SSA_NAME_IS_DEFAULT_DEF (fn)) || TREE_CODE (SSA_NAME_VAR (fn)) == RESULT_DECL))
fn = SSA_NAME_VAR (fn); fn = SSA_NAME_VAR (fn);
return get_vi_for_tree (fn); return get_vi_for_tree (fn);
...@@ -5915,9 +5915,9 @@ find_what_p_points_to (tree p) ...@@ -5915,9 +5915,9 @@ find_what_p_points_to (tree p)
/* 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 (p) == SSA_NAME if (TREE_CODE (p) == SSA_NAME
&& SSA_NAME_IS_DEFAULT_DEF (p)
&& (TREE_CODE (SSA_NAME_VAR (p)) == PARM_DECL && (TREE_CODE (SSA_NAME_VAR (p)) == PARM_DECL
|| TREE_CODE (SSA_NAME_VAR (p)) == RESULT_DECL) || TREE_CODE (SSA_NAME_VAR (p)) == RESULT_DECL))
&& SSA_NAME_IS_DEFAULT_DEF (p))
lookup_p = SSA_NAME_VAR (p); lookup_p = SSA_NAME_VAR (p);
vi = lookup_vi_for_tree (lookup_p); vi = lookup_vi_for_tree (lookup_p);
......
...@@ -118,7 +118,9 @@ make_ssa_name_fn (struct function *fn, tree var, gimple stmt) ...@@ -118,7 +118,9 @@ make_ssa_name_fn (struct function *fn, tree var, gimple stmt)
tree t; tree t;
use_operand_p imm; use_operand_p imm;
gcc_assert (DECL_P (var)); gcc_assert (TREE_CODE (var) == VAR_DECL
|| TREE_CODE (var) == PARM_DECL
|| TREE_CODE (var) == RESULT_DECL);
/* If our free list has an element, then use it. */ /* If our free list has an element, then use it. */
if (!VEC_empty (tree, FREE_SSANAMES (fn))) if (!VEC_empty (tree, FREE_SSANAMES (fn)))
......
...@@ -2635,16 +2635,13 @@ struct GTY (()) tree_binfo { ...@@ -2635,16 +2635,13 @@ struct GTY (()) tree_binfo {
/* Define fields and accessors for nodes representing declared names. */ /* Define fields and accessors for nodes representing declared names. */
/* Nonzero if DECL represents a variable for the SSA passes. */ /* Nonzero if DECL represents an SSA name or a variable that can possibly
have an associated SSA name. */
#define SSA_VAR_P(DECL) \ #define SSA_VAR_P(DECL) \
(TREE_CODE (DECL) == VAR_DECL \ (TREE_CODE (DECL) == VAR_DECL \
|| TREE_CODE (DECL) == PARM_DECL \ || TREE_CODE (DECL) == PARM_DECL \
|| TREE_CODE (DECL) == RESULT_DECL \ || TREE_CODE (DECL) == RESULT_DECL \
|| (TREE_CODE (DECL) == SSA_NAME \ || TREE_CODE (DECL) == SSA_NAME)
&& (TREE_CODE (SSA_NAME_VAR (DECL)) == VAR_DECL \
|| TREE_CODE (SSA_NAME_VAR (DECL)) == PARM_DECL \
|| TREE_CODE (SSA_NAME_VAR (DECL)) == RESULT_DECL)))
......
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