diff options
author | Diego Novillo <dnovillo@redhat.com> | 2006-12-11 20:15:53 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@gcc.gnu.org> | 2006-12-11 15:15:53 -0500 |
commit | cfaab3a92418d34e14bb0fa447c052fce9f6057b (patch) | |
tree | 79969bcc52ffc34edcced0521bbe67cd20e564f5 /gcc/tree-dfa.c | |
parent | 7f46c638e6be449fcd80c08babdfaee63b70278e (diff) | |
download | gcc-cfaab3a92418d34e14bb0fa447c052fce9f6057b.tar.gz |
tree-ssa-operands.h (create_ssa_artificial_load_stmt): Rename from create_ssa_artficial_load_stmt.
* tree-ssa-operands.h (create_ssa_artificial_load_stmt):
Rename from create_ssa_artficial_load_stmt. Update all users.
* tree-into-ssa.c (register_new_def): Make static.
* tree.c (is_global_var): Handle SSA_NAMEs.
* tree.h (SSA_NAME_IS_DEFAULT_DEF): Define. Update all users
that used to call gimple_default_def.
* tree-ssa-operands.c (push_stmt_changes): New.
(pop_stmt_changes): New. Update every pass that modifies
statements to bracket modifications with
push_stmt_changes/pop_stmt_changes.
(discard_stmt_changes): New.
* tree-ssa-dom.c (stmts_to_rescan): Change to stack of
'tree *' instead of 'tree'. Update all users.
* tree-flow-inline.h (zero_imm_uses_p): New.
(symbol_mem_tag): New. Update every function that used
to access the annotation directly.
(set_symbol_mem_tag): Likewise.
* tree-dfa.c (dump_variable): Always show the escape mask.
(mark_symbols_for_renaming): Rename from
mark_new_vars_to_rename. Update all users.
Only mark to rename naked symbols in real and virtual
operands.
From-SVN: r119746
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r-- | gcc/tree-dfa.c | 124 |
1 files changed, 40 insertions, 84 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index b2d09f4b031..9c7afceccab 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -334,33 +334,30 @@ dump_variable (FILE *file, tree var) if (is_call_clobbered (var)) { + var_ann_t va = var_ann (var); + unsigned int escape_mask = va->escape_mask; + fprintf (file, ", call clobbered"); - if (dump_flags & TDF_DETAILS) - { - var_ann_t va = var_ann (var); - unsigned int escape_mask = va->escape_mask; - - fprintf (file, " ("); - if (escape_mask & ESCAPE_STORED_IN_GLOBAL) - fprintf (file, ", stored in global"); - if (escape_mask & ESCAPE_TO_ASM) - fprintf (file, ", goes through ASM"); - if (escape_mask & ESCAPE_TO_CALL) - fprintf (file, ", passed to call"); - if (escape_mask & ESCAPE_BAD_CAST) - fprintf (file, ", bad cast"); - if (escape_mask & ESCAPE_TO_RETURN) - fprintf (file, ", returned from func"); - if (escape_mask & ESCAPE_TO_PURE_CONST) - fprintf (file, ", passed to pure/const"); - if (escape_mask & ESCAPE_IS_GLOBAL) - fprintf (file, ", is global var"); - if (escape_mask & ESCAPE_IS_PARM) - fprintf (file, ", is incoming pointer"); - if (escape_mask & ESCAPE_UNKNOWN) - fprintf (file, ", unknown escape"); - fprintf (file, " )"); - } + fprintf (file, " ("); + if (escape_mask & ESCAPE_STORED_IN_GLOBAL) + fprintf (file, ", stored in global"); + if (escape_mask & ESCAPE_TO_ASM) + fprintf (file, ", goes through ASM"); + if (escape_mask & ESCAPE_TO_CALL) + fprintf (file, ", passed to call"); + if (escape_mask & ESCAPE_BAD_CAST) + fprintf (file, ", bad cast"); + if (escape_mask & ESCAPE_TO_RETURN) + fprintf (file, ", returned from func"); + if (escape_mask & ESCAPE_TO_PURE_CONST) + fprintf (file, ", passed to pure/const"); + if (escape_mask & ESCAPE_IS_GLOBAL) + fprintf (file, ", is global var"); + if (escape_mask & ESCAPE_IS_PARM) + fprintf (file, ", is incoming pointer"); + if (escape_mask & ESCAPE_UNKNOWN) + fprintf (file, ", unknown escape"); + fprintf (file, " )"); } if (gimple_default_def (cfun, var)) @@ -688,8 +685,12 @@ set_default_def (tree var, tree def) else { h = (struct int_tree_map *) *loc; + SSA_NAME_IS_DEFAULT_DEF (h->to) = false; h->to = def; } + + /* Mark DEF as the default definition for VAR. */ + SSA_NAME_IS_DEFAULT_DEF (def) = true; } /* Add VAR to the list of referenced variables if it isn't already there. */ @@ -751,72 +752,27 @@ get_virtual_var (tree var) return var; } -/* Mark all the non-SSA variables found in STMT's operands to be - processed by update_ssa. */ +/* Mark all the naked symbols in STMT for SSA renaming. + + NOTE: This function should only be used for brand new statements. + If the caller is modifying an existing statement, it should use the + combination push_stmt_changes/pop_stmt_changes. */ void -mark_new_vars_to_rename (tree stmt) +mark_symbols_for_renaming (tree stmt) { + tree op; ssa_op_iter iter; - tree val; - bitmap vars_in_vops_to_rename; - bool found_exposed_symbol = false; - int v_may_defs_before, v_may_defs_after; - int v_must_defs_before, v_must_defs_after; - - if (TREE_CODE (stmt) == PHI_NODE) - return; - - get_stmt_ann (stmt); - vars_in_vops_to_rename = BITMAP_ALLOC (NULL); - - /* Before re-scanning the statement for operands, mark the existing - virtual operands to be renamed again. We do this because when new - symbols are exposed, the virtual operands that were here before due to - aliasing will probably be removed by the call to get_stmt_operand. - Therefore, we need to flag them to be renamed beforehand. - - We flag them in a separate bitmap because we don't really want to - rename them if there are not any newly exposed symbols in the - statement operands. */ - v_may_defs_before = NUM_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF); - v_must_defs_before = NUM_SSA_OPERANDS (stmt, SSA_OP_VMUSTDEF); - FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, - SSA_OP_VMAYDEF | SSA_OP_VUSE | SSA_OP_VMUSTDEF) - { - if (!DECL_P (val)) - val = SSA_NAME_VAR (val); - bitmap_set_bit (vars_in_vops_to_rename, DECL_UID (val)); - } - - /* Now force an operand re-scan on the statement and mark any newly - exposed variables. */ update_stmt (stmt); - v_may_defs_after = NUM_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF); - v_must_defs_after = NUM_SSA_OPERANDS (stmt, SSA_OP_VMUSTDEF); - - FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, SSA_OP_ALL_OPERANDS) - if (DECL_P (val)) - { - found_exposed_symbol = true; - mark_sym_for_renaming (val); - } - - /* If we found any newly exposed symbols, or if there are fewer VDEF - operands in the statement, add the variables we had set in - VARS_IN_VOPS_TO_RENAME to VARS_TO_RENAME. We need to check for - vanishing VDEFs because in those cases, the names that were formerly - generated by this statement are not going to be available anymore. */ - if (found_exposed_symbol - || v_may_defs_before > v_may_defs_after - || v_must_defs_before > v_must_defs_after) - mark_set_for_renaming (vars_in_vops_to_rename); - - BITMAP_FREE (vars_in_vops_to_rename); + /* Mark all the operands for renaming. */ + FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_ALL_OPERANDS) + if (DECL_P (op)) + mark_sym_for_renaming (op); } + /* Find all variables within the gimplified statement that were not previously visible to the function and add them to the referenced variables list. */ @@ -845,7 +801,7 @@ find_new_referenced_vars (tree *stmt_p) } -/* If REF is a handled component reference for a structure, return the +/* If EXP is a handled component reference for a structure, return the base variable. The access range is delimited by bit positions *POFFSET and *POFFSET + *PMAX_SIZE. The access size is *PSIZE bits. If either *PSIZE or *PMAX_SIZE is -1, they could not be determined. If *PSIZE |