Commit Graph

79 Commits

Author SHA1 Message Date
Diego Novillo 38635499e9 [multiple changes]
2006-12-11  Diego Novillo  <dnovillo@redhat.com>

	* doc/tree-ssa.texi: Update documentation for virtual operands
	and the use of push_stmt_changes/pop_stmt_changes.
	* doc/invoke.texi: Remove documentation for params
	global-var-threshold.
	Update documentation on max-aliased-vops.

	* tree-into-ssa.c: Cleanup comments, variables and
	spacing in various functions.
	(regs_to_rename): Declare.
	(mem_syms_to_rename): Declare.
	(dump_update_ssa): Declare.
	(debug_update_ssa): Declare.
	(dump_names_replaced_by): Declare.
	(debug_names_replaced_by): Declare.
	(dump_def_blocks): Declare.
	(debug_def_blocks): Declare.
	(dump_defs_stack): Declare.
	(debug_defs_stack): Declare.
	(dump_currdefs): Declare.
	(debug_currdefs): Declare.
	(mark_def_sites): Do not handle virtual operands.
	(compute_idf): Rename from find_idf.  Update users.
	(register_new_def): Make local.  Convert second argument
	to 'tree'.
	Use BLOCK_DEFS_STACK directly.
	If pushing a non-register, also push the underlying
	symbol.
	(rewrite_stmt): Do not handle virtual operands.
	(dump_tree_ssa): Call dump_def_blocks, dump_defs_stack,
	dump_currdefs and dump_tree_ssa_stats.
	(dump_tree_ssa_stats): Also dump REPL_TBL.
	(replace_use): Remove.  Update all users to call SET_USE
	instead.
	(rewrite_blocks): Move code to free memory to
	fini_ssa_renamer.
	(mark_def_site_blocks): Move initialization code to
	init_ssa_renamer.
	(init_ssa_renamer): New.
	(fini_ssa_renamer): New.
	(rewrite_into_ssa): Call them.
	(prepare_block_for_update): Process SSA_OP_ALL_USES first
	and SSA_OP_ALL_DEFS later.  Do not process virtual
	operands separately.
	(dump_update_ssa): Call dump_decl_set.
	(init_update_ssa): Initialize regs_to_rename and
	mem_syms_to_rename.
	Call init_ssa_renamer.
	(delete_update_ssa): Call fini_ssa_renamer.
	Free blocks_with_phis_to_rewrite.
	(mark_sym_for_renaming): If the variable has
	sub-variables, also mark them.
	If the variable belongs to a partition, also mark it.
	(mark_set_for_renaming): Call mark_sym_for_renaming on
	every symbol in the set.
	(switch_virtuals_to_full_rewrite): Call
	mark_set_for_renaming.
	(update_ssa): Separate syms_to_rename into regs_to_rename
	and mem_syms_to_rename.

	* tree-dump.c (dump_options): Add TDF_MEMSYMS.
	* tree-pretty-print.c (debug_generic_expr): Add TDF_MEMSYMS.
	(debug_generic_stmt): Likewise.
	(debug_tree_chain): Likewise.
	(dump_symbols): New.
	(dump_generic_node): Check for TDF_MEMSYMS.
	Handle MEMORY_PARTITION_TAG.
	If the statement references memory and TDF_MEMSYMS is
	given, call dump_symbols.
	Indicate default names with (D).
	(dump_vops): Update for new virtual operator format.

	* tree.c (init_ttree): Add MEMORY_PARTITION_TAG to
	tree_contains_struct.
	(tree_code_size): Handle MEMORY_PARTITION_TAG.
	(tree_node_structure): Likewise.
	(needs_to_live_in_memory): Handle SSA names.
	* tree.h (MTAG_P): Likewise.
	(struct tree_memory_partition_tag): Declare.
	(MPT_SYMBOLS): Define.
	(union tree_node): Add field 'mpt'.
	* treestruct.def (TS_MEMORY_PARTITION_TAG): Define.
	* tree.def (MEMORY_PARTITION_TAG): Define.

	* tree-pass.h (TDF_MEMSYMS): Define.

	* params.h (GLOBAL_VAR_THRESHOLD): Remove.

	* tree-ssa-alias.c: Include pointer-set.h
	(struct alias_map_d): Remove fields total_alias_vops,
	grouped_p and may_aliases.  Update all users.
	(struct mp_info_def): Declare.
	(mp_info_t): New type.
	(get_smt_for): Rename from get_tmt_for.  Update all
	users.
	(add_may_alias): Add argument ALREADY_ADDED.  If given,
	use it to avoid adding duplicate entries to alias sets.
	(replace_may_alias): Remove.  Update all users.
	(total_alias_vops_cmp): Remove.  Update all users.
	(group_aliases_into): Remove.  Update all users.
	(tree_pointer_compare): Remove.  Update all users.
	(compact_name_tags): Remove.  Update all users.
	(group_aliases): Remove.  Update all users.
	(mark_non_addressable): Move from tree-flow-inline.h.
	Remove the symbol from the partition holding it, if
	needed.
	(dump_mp_info): New.
	(debug_mp_info): New.
	(sort_mp_info): New.
	(create_partition_for): New.
	(rewrite_alias_set_for): New.
	(compute_memory_partitions): New.
	(compute_may_aliases): Call it.
	(init_alias_info): If computing aliases for the first
	time, mark every memory symbol for renaming.
	(have_common_aliases_p): New.
	(compute_flow_insensitive_aliasing): Call it.
	(setup_pointers_and_addressables): Do not cache
	num_referenced_vars.
	For register promoted symbols, mark their former
	partition for renaming.
	(maybe_create_global_var): Only create .GLOBAL_VAR if
	there are no call-clobbered variables and a mix of pure
	and non-pure functions were found.
	(may_alias_p): Tidy comments.
	(create_tag_raw): Remove unused variable new_type.
	(dump_alias_info): call dump_memory_partitions.
	(dump_points_to_info_for): Call dump_decl_set.
	(may_be_aliased): Tidy comments and formatting.

	* timevar.def (TV_MEMORY_PARTITIONING): Define.
	* tree-vectorizer.c (vect_memsyms_to_rename): Rename from
	vect_vnames_to_rename.  Set DECL_UIDs instead of SSA name
	versions in it.
	(slpeel_update_phi_nodes_for_guard1): Ignore memory PHIs.
	* tree-vect-transform.c (vect_transform_loop): Call
	mark_set_for_renaming with vect_memsyms_to_rename.
	* tree-flow-inline.h (zero_imm_uses_p): New.
	(memory_partition): New.
	(set_memory_partition): New.
	(factoring_name_p): New.
	(symbol_mem_tag): New.  Update every function that used
	to access the annotation directly.
	(set_symbol_mem_tag): Likewise.

	* tree-ssa-copy.c (may_propagate_copy): Allow copies
	between a partition and a symbol as long as the symbol
	belongs to the partition.
	(merge_alias_info): Ignore merge requests when memory
	partitions are involved.

	* tree-ssa.c (verify_ssa_name): Check that default
	definitions have empty defining statements.
	(verify_use): Remove argument IS_VIRTUAL.
	Don't call verify_ssa_name.
	(verify_phi_args): Call verify_ssa_name.
	(verify_flow_insensitive_alias_info): Handle MPTs.
	(verify_flow_sensitive_alias_info): Likewise.
	(verify_name_tags): Likewise.
	(verify_call_clobbering): Likewise.
	(verify_ssa): Check for VOPs only after aliasing
	information is available.
	Check virtuals and real operands separately.
	Call verify_ssa_name on every operand.
	(stmt_references_memory_p): Move to tree-ssa-operands.c.
	(walk_use_def_chains_1): Guard against NULL PHI
	arguments.

	* tree-ssa-operands.c (stmt_references_memory_p): Move from
	tree-ssa.c.
	(get_mpt_for): New.
	(dump_memory_partitions): New.
	(debug_memory_partitions): New.

	* tree-flow.h (struct var_ann_d): Add field mpt.
	(struct stmt_ann_d): Add bitfield references_memory.
	* Makefile.in (tree-ssa-structalias.o): Include
	pointer-set.h
	(tree-ssa-alias.o): Likewise.
	* tree-ssa-structalias.c: (update_alias_info): Use
	STORED_SYMS to determine which variables are being
	written to by the store operation.
	* tree-ssa-structalias.h (struct alias_info)
	<total_alias_vops>: Remove.  Update all users.
	<written_vars>: Change to a pointer set.  Update all
	users.
	<dereferenced_ptrs_store>: Likewise.
	<dereferenced_ptrs_load>: Likewise.
	(NUM_REFERENCES): Remove.  Update all users.
	(NUM_REFERENCES_CLEAR): Remove.  Update all users.
	(NUM_REFERENCES_INC): Remove.  Update all users.
	(NUM_REFERENCES_SET): Remove.  Update all users.

	* params.def (PARAM_GLOBAL_VAR_THRESHOLD): Remove.
	Update all users.
	(PARAM_MAX_ALIASED_VOPS): Set to 10.
	* tree-ssanames.c (make_ssa_name): Initialize
	SSA_NAME_IS_DEFAULT_DEF to 0.

2006-12-11  Aldy Hernandez  <aldyh@redhat.com>

	* tree-ssa-dse.c (aggregate_vardecl_d): New.
	(dse_global_data): Add aggregate_vardecl field.
	(dse_possible_dead_store_p): New.
	Add prev_defvar variable.
	Allow immediate uses and previous immediate uses to differ
	if they are setting different parts of the whole.
	(get_aggregate_vardecl): New.
	(dse_record_partial_aggregate_store): New.
	(dse_whole_aggregate_clobbered_p): New.
	(dse_partial_kill_p): New.
	(dse_optimize_stmt): Abstract code checking a possible dead store
	into new function dse_possible_dead_store_p().
	Call dse_maybe_record_aggregate_store().
	When checking whether a STMT and its USE_STMT refer to the
	same memory address, check also for partial kills that clobber
	the whole.
	Move some variable definitions to the block where they are used.
	(aggregate_vardecl_hash): New.
	(aggregate_vardecl_eq): New.
	(aggregate_vardecl_free): New.
	(aggregate_whole_store_p): New.
	(tree_ssa_dse): Initialize and free aggregate_vardecl.
	Mark which aggregate stores we care about.

2006-12-11  Andrew Macleod  <amacleod@redhat.com>

	* tree-ssa-operands.h (struct vuse_element_d): Declare.
	(vuse_element_t): Declare.
	(struct vuse_vec_d): Declare.
	(vuse_vec_p): Declare.
	(VUSE_VECT_NUM_ELEM): Define.
	(VUSE_VECT_ELEMENT_NC): Define.
	(VUSE_ELEMENT_PTR_NC): Define.
	(VUSE_ELEMENT_VAR_NC): Define.
	(VUSE_VECT_ELEMENT): Define.
	(VUSE_ELEMENT_PTR): Define.
	(VUSE_ELEMENT_VAR): Define.
	(struct maydef_optype_d) <use_var>: Remove.
	<use_ptr>: Remove.
	<usev>: Add.
	(struct vuse_optype_d) <kill_var>: Remove.
	<use_ptr>: Remove.
	<usev>: Add.
	(struct mustdef_optype_d) <kill_var>: Remove.
	<use_ptr>: Remove.
	<usev>: Add.
	(VUSE_OP_PTR): Add argument.  Use VUSE_ELEMENT_PTR.
	(VUSE_OP): Add argument.  Use VUSE_ELEMENT_PTR.
	(VUSE_NUM): Define.
	(VUSE_VECT): Define.
	(MAYDEF_OP_PTR): Add argument.  Use VUSE_OP_PTR.
	(MAYDEF_OP): Add argument.  Use VUSE_OP.
	(MAYDEF_NUM): Define.
	(MAYDEF_VECT): Define.
	(MUSTDEF_KILL_PTR): Use VUSE_OP_PTR.
	(MUSTDEF_KILL): Use VUSE_OP.
	(MUSTDEF_NUM): Define.
	(MUSTDEF_VECT): Define.
	(realloc_maydef): Declare.
	(realloc_vuse): Declare.
	(struct ssa_operand_iterator_d) <vuse_index>: Add.
	<mayuse_index>: Add.
	(LOADED_SYMS): Define.
	(STORED_SYMS): Define.
	(FOR_EACH_SSA_MUSTDEF_OPERAND): Call op_iter_next_mustdef.
	* tree-into-ssa.c: Adapt for multi-operand V_MAY_DEF and VUSE
	operators.
	* tree-pretty-print.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-flow-inline.h: Likewise.
	(op_iter_next_mustdef): New.
	* tree-ssa-operands.c: Likewise.
	(ALLOC_OPTYPE): Remove.
	Update all users.
	(alloc_def): New.
	(alloc_use): New.
	(alloc_maydef): New.
	(alloc_vuse): New.
	(alloc_mustdef): New.
	(realloc_maydef): New.
	(realloc_vuse): New.

2006-12-11  Aldy Hernandez  <aldyh@redhat.com>

	* tree-ssa-operands.c: Remove build_v_must_defs.
	(init_ssa_operands): Delete build_v_must_defs.
	(finalize_ssa_v_must_def_ops): Remove.
	(finalize_ssa_v_must_defs): Remove.
	(finalize_ssa_stmt_operands): Do not call
	finalize_ssa_v_must_defs.
	(start_ssa_stmt_operands): Do not check build_v_must_defs.
	(append_v_must_def): Delete.
	(copy_virtual_operands): Do not copy V_MUST_DEFs.
	(get_modify_expr_operands): Remove reference to V_MUST_DEF from
	comment.  Remove opf_kill_def.
	(build_ssa_operands): Remove references to v_must_defs.
	(copy_virtual_operands): Same.
	(copy_virtual_operands): Same.
	(fini_ssa_operands): Same.
	(free_ssa_operands): Same.
	(add_mustdef_op): Remove.
	Remove mustdef_optype_p.
	(alloc_mustdef): Remove.
	Remove references to V_MUST_DEFs in comment at top of file.
	(get_expr_operands): Remove opf_kill_def.
	(opf_kill_def): Remove.
	(add_virtual_operand): Remove opf_kill_def.
	(get_indirect_ref_operands): Same.
	(get_tmr_operands): Same.

	* tree-vectorizer.c (rename_variables_in_bb): Remove
	SSA_OP_ALL_KILLS.

	* tree-ssa-loop-manip.c (find_uses_to_rename_stmt): Remove
	SSA_OP_ALL_KILLS.
	(check_loop_closed_ssa_stmt): Same.

	* tree-ssa.c (verify_def): Remove V_MUST_DEF from comment.
	(verify_use): Same.
	(verify_ssa): Remove V_MUST_DEFs traces.
	(verify_ssa): Remove SSA_OP_ALL_KILLS.

	* tree-into-ssa.c (mark_def_sites): Change SSA_OP_VMUSTDEF to
	SSA_OP_VMAYDEF.
	(rewrite_update_stmt): Remove SSA_OP_VIRTUAL_KILLS.
	(rewrite_stmt): Remove SSA_OP_ALL_KILLS.

	* tree-ssa-operands.h (struct stmt_operands_d): Remove V_MUST_DEF
	references.
	(MUSTDEF_OPS): Remove.
	(SSA_OP_VMUSTDEF): Remove.
	(FOR_EACH_SSA_MUSTDEF_OPERAND): Remove.
	(struct mustdef_optype_d): Remove.
	Remove mustdef_optype_p.
	(struct stmt_operands_d): Remove mustdef_ops.
	(ssa_operand_iterator_d): Remove mustdefs and mustkills.
	(SSA_OP_VIRTUAL_DEFS): Remove SSA_OP_VMUSTDEF.
	(MUSTDEF_RESULT_PTR): Remove.
	(MUSTDEF_RESULT): Remove.
	(MUSTDEF_KILL_PTR): Remove.
	(MUSTDEF_KILL): Remove.
	(MUSTDEF_NUM): Remove.
	(MUSTDEF_VECT): Remove.
	(SSA_OP_VIRTUAL_KILLS): Remove.
	(SSA_OP_ALL_VIRTUALS): Remove SSA_OP_VIRTUAL_KILLS.
	(SSA_OP_VMUSTKILL): Remove.
	(SSA_OP_ALL_KILLS): Remove.
	(SSA_OP_ALL_OPERANDS): Remove SSA_OP_ALL_KILLS.

	* tree-flow-inline.h (op_iter_init_def): Remove
	SSA_OP_VIRTUAL_KILLS.
	(delink_stmt_imm_use): Remove SSA_OP_ALL_KILLS.

	* tree-ssa-pre.c (compute_rvuse_and_antic_safe): Remove
	SSA_OP_VIRTUAL_KILLS.

	* tree-ssa-loop-im.c (determine_max_movement): Remove
	SSA_OP_VIRTUAL_KILLS.
	(gather_mem_refs_stmt): Same.
	(gather_mem_refs_stmt): Same.

	* tree-ssa-dce.c (mark_really_necessary_kill_operand_phis): Delete.
	(perform_tree_ssa_dce): Remove call to
	mark_really_necessary_kill_operand_phis.

	* tree-flow-inline.h (op_iter_init): Remove setting of mustdefs
	and mustkills.
	(op_iter_next_use): Do not check mustkills.
	(op_iter_next_def): Do not check mustdefs.
	(op_iter_next_tree): Do not check mustkills or mustdefs.
	(clear_and_done_ssa_iter): Do not set mustdefs or mustkills.
	(op_iter_next_maymustdef): Do not check mustkills.
	(op_iter_init_must_and_may_def): Remove SSA_OP_VMUSTKILL.
	(op_iter_init_mustdef): Remove.

	* tree-ssa-live.c (create_ssa_var_map): Change SSA_OP_VMUSTDEF to
	SSA_OP_VMAYDEF.

	* tree-ssa-dse.c (dse_optimize_stmt): Remove SSA_OP_VMUSTDEF.

	* tree-ssa-ccp.c: Remove V_MUST_DEF traces from comments.
	(visit_assignment): Same.

	* tree-ssa-copy.c (copy_prop_visit_assignment): Same.

	* tree-sra.c (mark_all_v_defs_1): Remove V_MUST_DEF from comment.

	* tree-outof-ssa.c (check_replaceable): Remove SSA_OP_VMUSTDEF.

	* tree-pretty-print.c (dump_vops): Remove printing of V_MUST_DEF.
	Remove kill_p variable.

	* tree-dfa.c (struct dfa_stats_d): Remove num_v_must_defs.
	(dump_dfa_stats): Remove code related to V_MUST_DEFs.
	(collect_dfa_stats_r): Do not set num_v_must_defs.
	(mark_new_vars_to_rename): Remove v_must_defs_{before,after}
	code.

	* tree-into-ssa.c (mark_def_sites): Change SSA_OP_VMUSTKILL to
	SSA_OP_VMAYUSE.

	* tree-ssa-pre.c (compute_rvuse_and_antic_safe): Remove
	SSA_OP_VMUSTDEF and SSA_OP_VMUSTKILL.

	* tree-ssa-propagate.c (stmt_makes_single_store): Remove
	SSA_OP_VMUSTDEF.

From-SVN: r119760
2006-12-11 20:48:51 -05:00
Diego Novillo cfaab3a924 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
2006-12-11 15:15:53 -05:00
Aldy Hernandez 07beea0df3 Merge gimple-tuples-branch into mainline.
From-SVN: r119546
2006-12-05 17:26:05 +00:00
Jan Hubicka 5cd4ec7f24 Privatize SSA variables into gimple_df.
* tree-flow-inline.h
	(gimple_in_ssa_p, gimple_aliases_computed_p, gimple_addressable_vars,
	gimple_call_clobbered_vars, gimple_referenced_vars, gimple_global_var,
	gimple_nonlocal_all): New accessors.
	(first_referenced_var): Update.
	(mark_stmt_modified): Update.
	(is_call_clobbered): Update.
	(mark_call_clobbered): Update.
	(clear_call_clobbered): Update.
	(mark_non_addressable): Update.
	* tree-vrp.c (get_value_range): Update.
	* tree-into-ssa.c (in_ssa_p): Kill.
	(get_default_def_for): Update.
	(rewrite_into_ssa): Update.
	* tree-complex.c (init_parameter_lattice_values): Update.
	(update_complex_assignment): Update.
	(update_parameter_components): Update.
	(expand_complex_libcall): Update.
	(expand_complex_operations_1): Update.
	* tree-tailcall.c (arg_needs_copy_p): Update.
	(add_virtual_phis): Update.
	(tree_optimize_tail_calls_1): Update.
	* tree-ssa-dse.c (memory_ssa_name_same): Update.
	* tree-ssa-copyrename.c
	(copy_rename_partition_coalesce): Update.
	* tree-ssa-math-opts.c (execute_cse_reciprocals): Update.
	* tree-ssa-propagate.c (set_rhs): Update.
	* tree-ssa-alias.c (aliases_computed_p, call_clobbered_vars,
	addressable_vars, global_var):Kill.
	(set_initial_properties): Update.
	(init_alias_info): Update.
	(finalize_ref_all_pointers): Update.
	(setup_pointers_and_addressables): Update.
	(maybe_create_global_var): Update.
	(create_global_var): Update.
	(dump_points_to_info): Update.
	* function.h (struct gimple_df): Forward declare.
	(struct function): Add GIMPLE_DF field.
	* gimplify.c (force_gimple_operand): Update.
	* tree-dfa.c (referenced_vars, default_defs): KIll.
	(make_rename_temp): Update.
	(dump_variable): Update.
	(referenced_var_lookup): Update.
	(referenced_var_check_and_insert): Update.
	(default_def): Rename to ...
	(gimple_default_def): ... this one; accept cfun argument.
	(set_default_def): Update.
	* tree-cfgcleanup.c (modified_noreturn_calls): Kill.
	(cleanup_control_flow): Update.
	* tree-ssa-pre.c (compute_avail): Update
	* tree-ssa-live.c (calculate_live_on_entry): Update.
	* tree-ssa.c (verify_use): Update.
	(verify_call_clobbering): Update.
	(verify_call_clobbering): Update.
	(init_tree_ssa): Update.
	(delete_tree_ssa): Update.
	* tree-outof-ssa.c (coalesce_ssa_name): Update.
	(rewrite_out_of_ssa): Update.
	* tree-flow.h (gimple_df): New structure collecting dataflow variables.
	(FREE_SSANAMES, SSANAMES, MODIFIED_NORETURN_CALLS, DEFAULT_DEFS): New
	private accessors.
	(in_ssa_p, modified_noreturn_calls, referenced_vars, default_defs,
	ssa_names, global_var, nonlocal_all, call_clobbered_vars,
	addressable_vars, aliases_computed_p): Kill.
	(default_def): Rename to...
	(gimple_default_def): ... this one.
	(defaule_def_fn): Kill.
	(num_referenced_vars, ssa_names, num_ssa_names): Update.
	* tree-ssa-structalias.c (nonlocal_all): Kill.
	(get_constraint_exp_from_ssa_var): Update.
	(create_nonlocal_var): Update.
	(get_constraint_for): Update.
	(update_alias_info): Update.
	(find_global_initializers): Update.
	(intra_create_variable_infos): Update.
	(intra_create_variable_infos):
	(find_what_p_points_to): Update.
	(init_alias_heapvars): Update.
	* tree-cfg.c (remove_bb): Update.
	(gimplify_val): Update.
	* tree-ssa-reassoc.c (get_rank): Update.
	(init_reassoc): Update.
	* tree-ssanames.c: Do not include gt-tree-ssanames.h
	(ssa_names, free_ssanames): Kill.
	(init_ssanames): Update.
	(make_ssa_name): Update.
	(release_ssa_name): Update.
	(release_defs): Update.
	(replace_ssa_name_symbol): Update.
	* tree-ssa-operands.c (access_can_touch_variable): Update.
	(add_virtual_operand): Update.
	(add_call_clobber_ops): Update.
	(add_call_read_ops): Update.
	(get_call_expr_operands): Update.
	(get_asm_expr_operands): Update.

From-SVN: r119294
2006-11-28 14:42:37 +00:00
Zdenek Dvorak 8f8bb1d200 tree-flow.h (name_mappings_registered_p): Declare.
* tree-flow.h (name_mappings_registered_p): Declare.
	* tree-into-ssa.c (name_mappings_registered_p): New function.
	* tree-cfg.c (tree_can_merge_blocks_p): Check
	name_mappings_registered_p instead of need_ssa_update_p.

From-SVN: r118732
2006-11-12 20:59:28 +00:00
Zdenek Dvorak 1e5787ef86 re PR tree-optimization/28839 (ICE in tree-vectorizer.c with -O2 -ftree-vectorize -funswitch-loops)
PR tree-optimization/28839
	* tree-into-ssa.c (prune_unused_phi_nodes): Take into account kills in
	blocks in that phi arguments appear.

	* gcc.dg/pr28839.c: New test.

From-SVN: r116605
2006-08-31 19:33:56 +00:00
Zdenek Dvorak f074ff6cc0 re PR middle-end/28071 (A file that can not be compiled in reasonable time/space)
PR rtl-optimization/28071
	* basic-block.h (bb_dom_dfs_in, bb_dom_dfs_out): Declare.
	* dominance.c (bb_dom_dfs_in, bb_dom_dfs_out): New functions.
	* tree-into-ssa.c (struct dom_dfsnum): New.
	(cmp_dfsnum, find_dfsnum_interval, prune_unused_phi_nodes): New
	functions.
	(insert_phi_nodes_for): Use prune_unused_phi_nodes instead of
	compute_global_livein.
	(prepare_block_for_update, prepare_use_sites_for): Mark the uses
	in phi nodes in the correct blocks.

From-SVN: r116190
2006-08-16 21:25:39 +00:00
Zdenek Dvorak 95dd309793 re PR tree-optimization/26830 (Repeated SSA update during loop header copying)
PR tree-optimization/26830
	* tree-into-ssa.c (struct ssa_name_info): Add age field.
	(info_for_ssa_name, current_info_for_ssa_name_age,
	blocks_to_update): New variables.
	(get_ssa_name_ann): Use info_for_ssa_name instead of SSA_NAME_AUX.
	(clear_ssa_name_info, initialize_flags_in_bb,
	mark_block_for_update): New functions.
	(mark_def_sites, rewrite_stmt): Assert that blocks_to_update is NULL.
	(insert_phi_nodes_for, mark_use_interesting, prepare_block_for_update,
	prepare_def_site_for): Use mark_block_for_update.
	(mark_def_interesting): Assert that the processed block is marked in
	blocks_to_update.  Do not take blocks argument.
	(prepare_use_sites_for, prepare_names_to_update): Do not take blocks
	argument.
	(rewrite_update_init_block, rewrite_update_stmt): Only process
	blocks with statements to rewrite.
	(delete_update_ssa): Do not clear SSA_NAME_AUX.
	(update_ssa): Initialize and free blocks_to_update.  Do not
	clear flags on statements.  Do not use blocks bitmap.
	* tree.h (SSA_NAME_AUX): Removed.
	(struct tree_ssa_name): Removed aux field.
	* print-tree.c (print_node): Do not print SSA_NAME_AUX.

From-SVN: r113799
2006-05-15 18:24:55 +00:00
Zdenek Dvorak 2ce798794d tree-into-ssa.c (phis_to_rewrite, [...]): New variables.
* tree-into-ssa.c (phis_to_rewrite, blocks_with_phis_to_rewrite): New
	variables.
	(mark_phi_for_rewrite): New function.
	(insert_phi_nodes_for, mark_use_interesting): Call
	mark_phi_for_rewrite.
	(rewrite_update_phi_arguments): Traverse only phis in phis_to_rewrite.
	(update_ssa): Initialize and free phis_to_rewrite.

From-SVN: r113431
2006-05-01 20:52:21 +00:00
Kazu Hirata e3df376d22 Makefile.in (tree-into-ssa.o, [...]): Depend on vecprim.h.
* Makefile.in (tree-into-ssa.o, tree-outof-ssa.o,
	tree-ssa-live.o, tree-ssa-alias.o, function.o, df-problems.o,
	global.o, cfglayout.o, lambda-code.o, reg-stack.o,
	build/genextract.o): Depend on vecprim.h.
	* cfglayout.c, df-problems.c, function.c, genextract.c,
	global.c, lambda-code.c, reg-stack.c, tree-into-ssa.c,
	tree-outof-ssa.c, tree-ssa-alias.c, tree-ssa-live.c: Include
	vecprim.h.
	* vecprim.h: New.

From-SVN: r112830
2006-04-10 19:26:18 +00:00
Daniel Berlin c2924966db tree-vrp.c (execute_vrp): Return value.
2006-03-02  Daniel Berlin <dberlin@dberlin.org>

	* gcc/tree-vrp.c (execute_vrp): Return value.
	* gcc/regrename.c (rest_of_handle_regrename): Ditto.
	* gcc/tree-into-ssa.c (rewrite_into_ssa): Ditto.
	* gcc/tree-complex.c (tree_lower_complex): Ditto.
	(tree_lower_complex_O0): Ditto.
	* gcc/tracer.c (rest_of_handle_tracer): Ditto.
	* gcc/postreload-gcse.c (rest_of_handle_gcse2): Ditto.
	* gcc/postreload.c (rest_of_handle_postreload): Ditto.
	* gcc/tree-tailcall.c (execute_tail_recursion): Ditto.
	(execute_tail_calls): Ditto.
	* gcc/tree-ssa-loop-ch.c (copy_loop_headers): Ditto.
	* gcc/tree.h (init_function_for_compilation): Ditto.
	* gcc/ipa-cp.c (ipcp_driver): Ditto.
	* gcc/tree-scalar-evolution.c (scev_const_prop): Ditto.
	* gcc/tree-scalar-evolution.h (scev_const_prop): Ditto.
	* gcc/final.c (compute_alignments): Ditto.
	(rest_of_handle_final): Ditto.
	(rest_of_handle_shorten_branches): Ditto.
	(rest_of_clean_state): Ditto.
	* gcc/omp-low.c (execute_expand_omp): Ditto.
	(execute_lower_omp): Ditto.
	* gcc/tree-ssa-dse.c (tree_ssa_dse): Ditto.
	* gcc/ipa-reference.c (static_execute): Ditto.
	* gcc/tree-ssa-uncprop.c (tree_ssa_uncprop): Ditto.
	* gcc/reorg.c (rest_of_handle_delay_slots): Ditto.
	(rest_of_handle_machine_reorg): Ditto.
	* gcc/cgraphunit.c (rebuild_cgraph_edges): Ditto.
	* gcc/flow.c (recompute_reg_usage): Ditto.
	(rest_of_handle_remove_death_notes): Ditto.
	(rest_of_handle_life): Ditto.
	(rest_of_handle_flow2): Ditto.
	* gcc/tree-ssa-copyrename.c (rename_ssa_copies): Ditto.
	* gcc/tree-ssa-ccp.c (do_ssa_ccp): Ditto.
	(do_ssa_store_ccp): Ditto.
	(execute_fold_all_builtins): Ditto.
	* gcc/mode-switching.c (rest_of_handle_mode_switching): Ditto.
	* gcc/modulo-sched.c (rest_of_handle_sms): Ditto.
	* gcc/ipa-pure-const.c (static_execute): Ditto.
	* gcc/cse.c (rest_of_handle_cse): Ditto.
	(rest_of_handle_cse2): Ditto.
	* gcc/web.c (rest_of_handle_web): Ditto.
	* gcc/tree-stdarg.c (execute_optimize_stdarg): Ditto.
	* gcc/tree-ssa-math-opts.c (execute_cse_reciprocals): Ditto.
	* gcc/tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto.
	* gcc/tree-nrv.c (tree_nrv): Ditto.
	(execute_return_slot_opt): Ditto.
	* gcc/tree-ssa-alias.c (compute_may_aliases): Ditto.
	(create_structure_vars): Ditto.
	* gcc/loop-init.c (rtl_loop_init): Ditto.
	(rtl_loop_done): Ditto.
	(rtl_move_loop_invariants): Ditto.
	(rtl_unswitch): Ditto.
	(rtl_unroll_and_peel_loops): Ditto.
	(rtl_doloop): Ditto.
	* gcc/gimple-low.c (lower_function_body): Ditto.
	(mark_used_blocks): Ditto.
	* gcc/tree-ssa-sink.c (execute_sink_code): Ditto.
	* gcc/ipa-inline.c (cgraph_decide_inlining): Ditto.
	(cgraph_early_inlining): Ditto.
	* gcc/global.c (rest_of_handle_global_alloc): Ditto.
	* gcc/jump.c (cleanup_barriers): Ditto.
	(purge_line_number_notes): Ditto.
	* gcc/ifcvt.c (rest_of_handle_if_conversion): Ditto.
	(rest_of_handle_if_after_reload): Ditto.
	* gcc/tree-ssa-loop.c (tree_ssa_loop_init): Ditto.
	(tree_ssa_loop_im): Ditto.
	(tree_ssa_loop_unswitch): Ditto.
	(tree_vectorize): Ditto.
	(tree_linear_transform): Ditto.
	(tree_ssa_loop_ivcanon): Ditto.
	(tree_ssa_empty_loop): Ditto.
	(tree_ssa_loop_bounds): Ditto.
	(tree_complete_unroll): Ditto.
	(tree_ssa_loop_prefetch): Ditto.
	(tree_ssa_loop_ivopts): Ditto.
	(tree_ssa_loop_done): Ditto.
	* gcc/predict.c (tree_estimate_probability): Ditto.
	* gcc/recog.c (split_all_insns_noflow): Ditto.
	(rest_of_handle_peephole2): Ditto.
	(rest_of_handle_split_all_insns): Ditto.
	* gcc/tree-eh.c (lower_eh_constructs): Ditto.
	* gcc/regmove.c (rest_of_handle_regmove): Ditto.
	(rest_of_handle_stack_adjustments): Ditto.
	* gcc/local-alloc.c (rest_of_handle_local_alloc): Ditto.
	* gcc/function.c (instantiate_virtual_regs): Ditto.
	(init_function_for_compilation): Ditto.
	(rest_of_handle_check_leaf_regs): Ditto.
	* gcc/gcse.c (rest_of_handle_jump_bypass): Ditto.
	(rest_of_handle_gcse): Ditto.
	* gcc/ipa-type-escape.c (type_escape_execute): Ditto.
	* gcc/alias.c (rest_of_handle_cfg): Ditto.
	* gcc/tree-if-conv.c (main_tree_if_conversion): Ditto.
	* gcc/profile.c (rest_of_handle_branch_prob): Ditto.
	* gcc/tree-ssa-phiopt.c (tree_ssa_phiopt): Ditto.
	* gcc/rtl-factoring.c (rest_of_rtl_seqabstr): Ditto.
	* gcc/bt-load.c (rest_of_handle_branch_target_load_optimize): Ditto
	* gcc/tree-dfa.c (find_referenced_vars): Ditto.
	* gcc/except.c (set_nothrow_function_flags): Ditto.
	(convert_to_eh_region_ranges): Ditto.
	(rest_of_handle_eh): Ditto.
	* gcc/emit-rtl.c (unshare_all_rtl): Ditto.
	(remove_unnecessary_notes): Ditto.
	* gcc/except.h (set_nothrow_function_flags): Ditto.
	(convert_to_eh_region_ranges): Ditto.
	* gcc/cfgexpand.c (tree_expand_cfg): Ditto.
	* gcc/tree-cfgcleanup.c (merge_phi_nodes): Ditto.
	* gcc/tree-ssa-pre.c (do_pre): Ditto.
	(execute_fre): Ditto.
	* gcc/cfgcleanup.c (rest_of_handle_jump): Ditto.
	(rest_of_handle_jump2): Ditto.
	* gcc/tree-sra.c (tree_sra): Ditto.
	* gcc/tree-mudflap.c (execute_mudflap_function_ops): Ditto.
	(execute_mudflap_function_decls): Ditto.
	* gcc/tree-ssa-copy.c (do_copy_prop): Ditto.
	(do_store_copy_prop): Ditto.
	* gcc/ipa-prop.h (ipcp_driver): Ditto.
	* gcc/cfglayout.c (insn_locators_initialize): Ditto.
	* gcc/tree-ssa-forwprop.c
	(tree_ssa_forward_propagate_single_use_vars): Ditto.
	* gcc/cfglayout.h (insn_locators_initialize): Ditto.
	* gcc/tree-ssa-dce.c (tree_ssa_dce): Ditto.
	* gcc/tree-ssa.c (execute_early_warn_uninitialized): Ditto.
	(execute_late_warn_uninitialized): Ditto.
	* gcc/rtl.h (cleanup_barriers): Ditto.
	(split_all_insns_noflow): Ditto.
	(purge_line_number_notes): Ditto.
	(unshare_all_rtl): Ditto.
	(remove_unnecessary_notes): Ditto.
	(recompute_reg_usage): Ditto.
	(variable_tracking_main): Ditto.
	* gcc/integrate.c (emit_initial_value_sets): Ditto.
	* gcc/integrate.h (emit_initial_value_sets): Ditto.
	* gcc/tree-optimize.c (execute_free_datastructures): Ditto
	(execute_free_cfg_annotations): Ditto.
	(execute_fixup_cfg): Ditto.
	(execute_cleanup_cfg_pre_ipa): Ditto.
	(execute_cleanup_cfg_post_optimizing): Ditto.
	(execute_init_datastructures): Ditto.
	* gcc/tree-object-size.c (compute_object_sizes): Ditto.
	* gcc/combine.c (rest_of_handle_combine): Ditto.
	* gcc/tree-outof-ssa.c (rewrite_out_of_ssa): Ditto.
	* gcc/bb-reorder.c (duplicate_computed_gotos): Ditto.
	(rest_of_handle_reorder_blocks): Ditto.
	(rest_of_handle_partition_blocks): Ditto.
	* gcc/var-tracking.c (variable_tracking_main): Ditto.
	* gcc/tree-profile.c (tree_profiling): Ditto.
	* gcc/tree-vect-generic.c (expand_vector_operations): Ditto.
	* gcc/reg-stack.c (rest_of_handle_stack_regs): Ditto.
	* gcc/sched-rgn.c (rest_of_handle_sched): Ditto.
	(rest_of_handle_sched2): Ditto.
	* gcc/basic-block.h (free_bb_insn): Ditto.
	* gcc/tree-ssa-structalias.c (ipa_pta_execute): Ditto.
	* gcc/tree-cfg.c (execute_build_cfg): Ditto.
	(remove_useless_stmts): Ditto.
	(split_critical_edges): Ditto.
	(execute_warn_function_return): Ditto.
	(execute_warn_function_noreturn): Ditto.
	* gcc/tree-ssa-reassoc.c (execute_reassoc): Ditto.
	* gcc/cfgrtl.c (free_bb_for_insn): Ditto.
	* gcc/passes.c (execute_one_pass): Run additional
	todos returned by execute function.
	* gcc/tree-pass.h (struct tree_opt_pass): Make execute
	return a value.

From-SVN: r111643
2006-03-02 19:00:11 +00:00
Richard Guenther 3f519b3517 tree-pass.h (TODO_remove_unused_locals): Define.
2006-01-05  Richard Guenther  <rguenther@suse.de>
	    Diego Novillo  <dnovillo@redhat.com>

	* tree-pass.h (TODO_remove_unused_locals): Define.
	* gimple-low.c (expand_var_p, remove_useless_vars,
	pass_remove_useless_vars): Remove.  Update all users.
	* tree-ssa-live.c (mark_all_vars_used_1): Handle SSA names.
	(remove_unused_locals): New function.
	* tree-flow.h (remove_unused_locals): Declare.
	* passes.c (execute_todo): Call remove_unused_locals if
	TODO_remove_unused_locals is set.
	* tree-into-ssa.c (pass_build_ssa): Add TODO_remove_unused_locals.
	* tree-ssa-dce.c (pass_dce): Likewise.
	* tree-outof-ssa.c (pass_del_ssa): Likewise.

	* gcc.dg/tree-ssa/loop-11.c: Deal with removed vars pass.
	* gcc.dg/tree-ssa/loop-8.c: Likewise.
	* gcc.dg/tree-ssa/loop-1.c: Likewise.
	* gcc.dg/tree-ssa/pr23294.c: Likewise.
	* gcc.dg/tree-ssa/pr21985.c: Likewise.
	* gcc.dg/tree-ssa/loop-14.c: Likewise.
	* gcc.dg/tree-ssa/loop-2.c: Likewise.
	* gcc.dg/tree-ssa/loop-3.c: Likewise.
	* gcc.dg/tree-ssa/loop-4.c: Likewise.
	* gcc.dg/tree-ssa/pr21171.c: Likewise.
	* gcc.dg/tree-ssa/loop-5.c: Likewise.
	* gcc.dg/tree-ssa/loop-10.c: Likewise.
	* gcc.dg/tree-ssa/loop-6.c: Likewise.
	* treelang/compile/extravar.tree: Likewise.
	* g++.dg/tree-ssa/ssa-cast-1.C: Likewise.
	* g++.dg/tree-ssa/pointer-reference-alias.C: Likewise.
	* g++.dg/tree-ssa/ssa-sra-1.C: Likewise.
	* g++.dg/tree-ssa/ssa-sra-2.C: Likewise.
	* gcc.dg/tree-ssa/20031106-6.c: Disable SRA.

Co-Authored-By: Diego Novillo <dnovillo@redhat.com>

From-SVN: r109379
2006-01-05 13:53:54 +00:00
Gabriel Dos Reis 858904db9e tree-vn.c (vn_add): Use XNEW.
* tree-vn.c (vn_add): Use XNEW.
        * tree-ssa-ccp.c (ccp_initialize): Use XNEWVEC.
        (ccp_fold): Likewise.
        (fold_stmt_r): Use explicit cast to convert from void *.
        * tree-outof-ssa.c (new_temp_expr_table): Use XCNEWVEC.
        (new_temp_expr_table): Likewise.
        * gimplify.c (lookup_tmp_var): Use XNEW.
        (gimplify_asm_expr): Use explcit cast to convert from void *.
        * tree-into-ssa.c (get_ssa_name_ann): Likewise.
        (get_def_blocks_for): Use XNEW.
        (add_to_repl_tbl): Likewise.
        (mark_def_sites): Use explicit cast to convert from void *.
        (def_blocks_free): Likewise.
        (mark_def_sites_initialize_block): Likewise.
        (update_ssa): Use XNEWVEC.
        * tree-dfa.c (create_var_ann): Use GGC_NEW.
        (create_stmt_ann): Likewise.
        (create_tree_ann): Likewise.
        (referenced_var_insert): Likewise.
        (set_default_def): Likewise.
        (referenced_var_lookup_if_exists): Use explicit cast to
        * convert
        from void *.
        (referenced_var_lookup): Likewise.
        (default_def): Likewise.
        (set_default_def): Likewise.
        * tree-cfg.c (create_bb): Likewise.
        (edge_to_cases_cleanup): Likewise.
        (verify_node_sharing): Likewise.
        (record_switch_edge): Use XNEW.
        (cleanup_dead_labels): Use XCNEWVEC.
        (tree_duplicate_sese_region): Use XNEWVEC.
        * tree-scalar-evolution.c (get_instantiated_value): Likewise.
        * tree-ssa.c (verify_ssa): Use XCNEWVEC.
        (int_tree_map_eq): Use explicit cast to convert from void *.
        * libgcov.c (gcov_exit): Use explicit cast to convert from
        * void *.
        (__gcov_execl): Likewise.
        (__gcov_execlp): Likewise.
        (__gcov_execle): Likewise.
        * tree-eh.c (struct_ptr_eq): Likewise.
        (struct_ptr_hash): Likewise.
        (lookup_stmt_eh_region_fn): Likewise.
        (outside_finally_tree): Likewise.
        (find_goto_replacement): Likewise.
        (make_eh_edge): Likewise.
        (mark_eh_edge): Likewise.
        (add_stmt_to_eh_region_fn): Use GGC_NEW.
        (record_in_finally_tree): Use XNEW.
        (maybe_record_in_goto_queue): Use XRESIZEVEC.
        (lower_try_finally_copy): Use XCNEWVEC.

From-SVN: r108736
2005-12-18 01:19:20 +00:00
David S. Miller 77bfa77887 * tree-into-ssa.c (rewrite_into_ssa): Fix comment typo.
From-SVN: r107701
2005-11-29 23:06:54 -08:00
Ranjit Mathew 7b71de2644 tree-into-ssa.c (mark_def_sites): Correct minor typo in function comment.
* tree-into-ssa.c (mark_def_sites): Correct minor typo in function
	comment.

From-SVN: r105435
2005-10-15 12:17:16 +00:00
Volker Reichelt 206048bd41 builtins.c: Fix comment typo(s).
* builtins.c: Fix comment typo(s).
	* genautomata.c: Likewise.
	* gimplify.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.

From-SVN: r102491
2005-07-28 16:30:00 +00:00
Ben Elliston dfea6c85d8 bt-load.c (link_btr_uses): Fix uninitialised warnings.
* bt-load.c (link_btr_uses): Fix uninitialised warnings.
	* cfganal.c (find_edge_index): Ditto.
	* combine.c (combine_instructions): Ditto.
	* ddg.c (create_scc): Ditto.
	(find_successors): Ditto.
	(find_predecessors): Ditto.
	(find_nodes_on_paths): Ditto.
	(longest_simple_path): Ditto.
	* flow.c (update_life_info): Ditto.
	(count_or_remove_death_notes): Ditto.
	(clear_log_links): Ditto.
	* modulo-sched.c (generate_reg_moves): Ditto.
	(find_max_asap): Ditto.
	(find_max_hv_min_mob): Ditto.
	(find_max_dv_min_mob): Ditto.
	* sbitmap.c (sbitmap_first_set_bit): Ditto.
	* sched-rgn.c (extract_edgelst): Ditto.
	* tree-into-ssa.c (prepare_names_to_update): Ditto.
	(dump_update_ssa): Ditto.
	(ssa_names_to_replace) Ditto.
	(switch_virtuals_to_full_rewrite): Ditto.
	(update_ssa): Ditto.
	* tree-vect-transform.c (vect_create_epilog_for_reduction): Ditto.

From-SVN: r102151
2005-07-19 14:08:32 +10:00
Daniel Berlin a3648cfc0c [multiple changes]
2005-06-29  Daniel Berlin  <dberlin@dberlin.org>

	* tree-complex.c (complex_variable_components): Now a hashtable.
	(cvc_lookup): Ditto.
	(cvc_insert): Ditto.
	(create_components): Use referenced var iterator.
	Initialize hashtable.	Use cvc_insert/lookup.
	(extract_components): Use cvc_insert/lookup.
	(update_complex_components): Ditto.
	(update_complex_components_on_edge): Ditto.
	* tree-dfa.c (referenced_vars): Now a hashtable.
	(dump_referenced_vars): Use iterator.
	(referenced_var_lookup): New function.
	(referenced_var_insert): Ditto.
	(add_referenced_var): Use referenced_var_insert.
	(mark_new_vars_to_rename): Use DECL_UID.
	* tree-flow-inline.h (first_htab_element): New function.
	(end_htab_p): Ditto.
	(next_htab_element): Ditto.
	(first_referenced_var): Ditto.
	(end_referenced_vars_p): Ditto.
	(next_referenced_var): Ditto.
	(is_call_clobbered): Use DECL_UID.
	(mark_call_clobbered): Ditto.
	(clear_call_clobbered): Ditto.
	(mark_non_addressable): Ditto.
	* tree-flow.h (htab_iterator): New struct.
	(FOR_EACH_HTAB_ELEMENT): New macro.
	(struct int_tree_map): New struct.
	(int_tree_map_hash): Prototype.
	(int_tree_map_eq): Ditto.
	(referenced_var_iterator): Ditto.
	(FOR_EACH_REFERENCED_VAR): New macro.
	(referenced_vars): Now a hashtable.
	* tree-into-ssa.c (symbol_marked_for_renaming): Use DECL_UID.
	(add_new_name_mapping): Ditto.
	(mark_def_sites): Ditto.
	(insert_phi_nodes): Use referenced_var iterator.
	(mark_def_site_blocks): Ditto.
	(mark_sym_for_renaming): Use DECL_UID.
	* tree-sra.c (is_sra_candidate_decl): Use DECL_UID.
	(lookup_element): Ditto.
	(find_candidates_for_sra): Use referenced_vars iterator.
	Use DECL_UID.
	* tree-ssa-alias.c (NUM_REFERENCES): New macro.
	(NUM_REFERENCES_CLEAR): Ditto.
	(NUM_REFERENCES_INC): Ditto.
	(NUM_REFERENCES_SET): Ditto.
	(alias_obstack): New bitmap obstack.
	(struct alias_map_d): Use bitmap, not sbitmap.
	(struct alias_info): Remove num_references.
	(init_alias_info): Use referenced_var iterator.
	Initialize bitmap obstack.
	(delete_alias_info): Use referenced_var iterator.
	Free bitmap obstack.
	(compute_points_to_and_addr_escape): Use DECL_UID.
	Use new NUM_REFERENCES macros.
	(compute_flow_sensitive_aliasing): may_aliases is now a bitmap.
	Use new NUM_REFERENCES macros.
	(group_aliases_into): Update prototype to use bitmap.
	(setup_pointers_and_addressables): Use referenced_vars iterator.
	Use DECL_UID. Use new NUM_REFERENCES macros.
	(add_pointed_to_var): Use DECL_UID.
	(dump_alias_info): Use referenced_var iterator.
	(add_type_alias): Ditto.
	(used_portions): Now a hashtable.
	(used_part_map_eq): New function.
	(used_part_map_hash): Ditto.
	(free_used_part_map): Ditto.
	(up_lookup): Ditto.
	(up_insert): Ditto.
	(get_or_create_used_part_for): Use up_lookup.
	(create_overlap_variables_for): Ditto.
	(find_used_portions): Use up_insert.
	Use DECL_UID.
	(create_structure_vars): Init used_portions hashtable, use
	referenced_vars iterator.
	* tree-ssa-live.c (create_ssa_var_map): sbitmaps became bitmaps.
	Use DECL_UID.
	* tree-ssa-loop-im.c (gather_mem_refs_stmt): Use DECL_UID.
	* tree-ssa-operands.c (get_asm_expr_operands): Ditto.
	(note_addressable): Ditto.
	* tree-ssa-structalias.c (set_uids_in_ptset): Ditto.
	* tree-ssa.c (verify_flow_insensitive_alias_info): Use
	referenced_var iterator.
	Use DECL_UID.
	(delete_tree_ssa): Ditto.
	(int_tree_map_eq): New function.
	(int_tree_map_hash): Ditto.
	* tree-stdarg.c (find_va_list_reference): Use DECL_UID.
	(va_list_ptr_read): Ditto.
	(va_list_counter_struct_op): Ditto.
	(va_list_ptr_write): Ditto.
	(check_va_list_escapes): Ditto.
	(check_all_va_list_escapes): Ditto.
	(execute_optimize_stdarg): Ditto.
	* tree-tailcall.c (suitable_for_tail_opt_p): Used referenced_var
	iterator.
2005-06-30  Daniel Berlin  <dberlin@dberlin.org>

	* hashtab.h (HTAB_DELETED_ENTRY): New macro.
	(HTAB_EMPTY_ENTRY): New macro.

2005-06-30  Daniel Berlin  <dberlin@dberlin.org>

	* hashtab.c (EMPTY_ENTRY): Moved and renamed.
	(DELETED_ENTRY): Ditto.

From-SVN: r101480
2005-06-30 22:18:42 +00:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Kazu Hirata b6e7e9af04 sbitmap.h (sbitmap_iterator, [...]): New.
* sbitmap.h (sbitmap_iterator, sbitmap_iter_init,
	sbitmap_iter_cond, sbitmap_iter_next): New.
	* bt-load.c, cfganal.c, combine.c, ddg.c, flow.c,
	modulo-sched.c, sbitmap.c, sched-rgn.c, tree-into-ssa.c,
	tree-outof-ssa.c, tree-ssa-alias.c, tree-ssa-live.c: Update
	uses of EXECUTE_IF_SET_IN_SBITMAP to the new style.

From-SVN: r100709
2005-06-07 14:30:25 +00:00
Kaveh R. Ghazi 4c714dd4a6 basic-block.h, [...]: Don't include errors.h and include toplev.h if necessary.
* basic-block.h, bb-reorder.c, c-gimplify.c, config/darwin.c,
	config/rs6000/rs6000-c.c, dominance.c, gimple-low.c, gimplify.c,
	lambda-code.c, lambda-trans.c, tree-browser.c, tree-cfg.c,
	tree-chrec.c, tree-data-ref.c, tree-dfa.c, tree-eh.c,
	tree-if-conv.c, tree-into-ssa.c, tree-loop-linear.c,
	tree-mudflap.c, tree-nomudflap.c, tree-outof-ssa.c,
	tree-pretty-print.c, tree-scalar-evolution.c, tree-sra.c,
	tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c,
	tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-live.c,
	tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
	tree-ssa-propagate.c, tree-ssa-sink.c, tree-ssa-threadupdate.c,
	tree-ssa-uncprop.c, tree-ssa.c, tree-vect-analyze.c,
	tree-vect-transform.c, tree-vectorizer.c, vec.c: Don't include
	errors.h and include toplev.h if necessary.

	* rtl.c, varray.c: If we're compiling as a GENERATOR_FILE, include
	errors.h otherwise include toplev.h.

	* Makefile.in: Update dependencies.

ada:
	* misc.c: Don't include errors.h.

fortran:
	* fortran/trans-decl.c: Don't include errors.h.
	* fortran/Make-lang.in: Updates dependencies.

java:
	* java/verify-glue.c: Don't include errors.h and include toplev.h.
	* java/Make-lang.in: Updates dependencies.

treelang:
	* treelang/lex.l, treelang/parse.y: Don't include errors.h and
	include toplev.h.
	* treelang/Make-lang.in: Updates dependencies.

From-SVN: r100420
2005-06-01 02:51:18 +00:00
Nathan Sidwell a0ef884f73 vec.h: Implement integral type vector specialization.
* vec.h: Implement integral type vector specialization.
	(VEC_T): Define a non-GTY structure.
	(VEC_T_GTY): Define a GTY structure.
	(VEC_TA): Rename to ...
	(VEC_TA_GTY): ... here.
	(DEF_VEC_I, DEF_VEC_ALLOC_I): New.
	(DEF_VEC_P, DEF_VEC_ALLOC_P): Adjust.
	(DEF_VEC_FUNC_P, DEF_VEC_ALLOC_FUNC_P): New, broken out of
	DEF_VEC_P and DEF_VEC_ALLOC_P.
	(DEF_VEC_O, DEF_VEC_ALLOC_O): Adjust.
	(DEF_VEC_FUNC_O, DEF_VEC_ALLOC_FUNC_O): New, broken out of
	DEF_VEC_O and DEF_VEC_ALLOC_O.
	* global.c: Use DEF_VEC_I, DEF_VEC_ALLOC_I.
	* lambda-code.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-ssa-live.c: Likewise.

From-SVN: r100251
2005-05-27 13:26:02 +00:00
Kazu Hirata 6e3b9e2787 tree-into-ssa.c (update_ssa): Ensure that the operand cache is up-to-date.
* tree-into-ssa.c (update_ssa): Ensure that the operand cache
	is up-to-date.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Call
	update_stmt_if_modified before calling update_ssa.

From-SVN: r100250
2005-05-27 11:55:36 +00:00
Kazu Hirata 56c0cf75a0 tree-into-ssa.c (rewrite_into_ssa, update_ssa): Replace sizeof (bitmap *) with sizeof (bitmap).
* tree-into-ssa.c (rewrite_into_ssa, update_ssa): Replace
	sizeof (bitmap *) with sizeof (bitmap).

From-SVN: r100152
2005-05-25 15:17:12 +00:00
Kazu Hirata 9caf90a8ea tree-into-ssa.c (update_ssa): Clean up by shortening the live range of DFS.
* tree-into-ssa.c (update_ssa): Clean up by shortening the
	live range of DFS.

From-SVN: r99847
2005-05-17 19:10:19 +00:00
Kazu Hirata 2d4d14ac39 tree-dfa.c (referenced_vars, [...]): Use VEC instead of VARRAY.
* tree-dfa.c (referenced_vars, add_referenced_var): Use VEC
	instead of VARRAY.
	* tree-flow.h (num_referenced_var, referenced_var): Likewise.
	* tree-into-ssa.c (mark_def_site_blocks): Likewise.
	* tree-ssa.c (init_tree_ssa, delete_tree_ssa): Likewise.
	* tree-tailcall.c (suitable_for_tail_opt_p): Likewise.

From-SVN: r99393
2005-05-08 15:07:23 +00:00
Andrew MacLeod f47c96aac5 lambda-code.c (gcc_loop_to_lambda_loop, [...]): Use generic operand interface.
2005-05-03  Andrew MacLeod  <amacleod@redhat.com>

	* lambda-code.c (gcc_loop_to_lambda_loop,
	lambda_loopnest_to_gcc_loopnest, phi_loop_edge_uses_def,
	stmt_is_bumper_for_loop, perfect_nest_p, replace_uses_of_x_with_y): Use
	generic operand interface.
	* tree-data-ref.c (find_data_references_in_loop): Use generic interface.
	* tree-dfa.c (collect_dfa_stats_r, mark_new_vars_to_rename): Use
	generic operand interface.
	* tree-flow-inline.h (delink_imm_use, link_imm_use_to_list,
	link_imm_use, link_imm_use_stmt, relink_imm_use, relink_imm_use_stmt,
	next_safe_imm_use, has_zero_uses, has_single_use, single_imm_use,
	num_imm_uses): Use ssa_use_operand_t.
	(get_def_ops, get_use_ops, get_v_may_def_ops, get_vuse_ops,
	get_v_must_def_ops): Delete.
	(get_def_from_ptr, get_phi_result_ptr): Get def directly now.
	(get_use_op_ptr, get_def_op_ptr, get_v_may_def_result_ptr,
	get_v_may_def_op_ptr, get_vuse_op_ptr, get_v_must_def_result_ptr,
	get_v_must_def_kill_ptr): Delete.
	(delink_stmt_imm_use): Move and use new operand interface.
	(op_iter_next_use, op_iter_next_def, op_iter_next_tree, op_iter_init,
	op_iter_next_tree): Use new operand implementation.
	(clear_and_done_ssa_iter): New.  Initialize a blank operand iterator.
	(op_iter_init_use, op_iter_init_def, op_iter_init_tree): Add iterator
	type check.
	(op_iter_next_mustdef, op_iter_next_maydef,
	op_iter_next_must_and_may_def): Delete. Replace with...
	(op_iter_next_maymustdef): New.  Combine must and may next operations.
	(op_iter_init_maydef, op_iter_init_mustdef,
	op_iter_init_must_and_may_def): Use new interface.
	(single_ssa_tree_operand ): New.  Process single operands only as trees.
	(single_ssa_use_operand): New.  Process single operands only as uses.
	(single_ssa_def_operand): New.  Process single operands only as defs.
	(zero_ssa_operands): New.  Return TRUE if there are zero operands of the
	specified types.
	(num_ssa_operands): New.  Count the number of specified operands.
	(compare_ssa_operands_equal): New.  Compare two statements' operands.
	(single_phi_def): New.  Return true if PHI has one def of the specified
	operand type.
	(op_iter_init_phiuse): New.  Initialize the iterator for PHI arguments.
	(op_iter_init_phidef): New.  Initialize the iterator for the PHI def.
	* tree-flow.h (struct immediate_use_iterator_d): Use ssa_use_operand_t.
	(struct stmt_ann_d): Operands field no longer require GTY().
	(vn_compute, vn_lookup_or_add, vn_add, vn_lookup): Change prototype.
	* tree-into-ssa.c (mark_def_sites): Use SSA_OP_VMUSTKILL.
	* tree-outof-ssa.c (check_replaceable, find_replaceable_in_bb,
	dump_replaceable_exprs, rewrite_trees): Use generic interface.
	* tree-phinodes.c (make_phi_node, release_phi_node, resize_phi_node):
	Use use_operand_p instead of ssa_imm_use_t *.
	* tree-pretty-print.c (dump_vops): check if operands are active before
	dumping virtual operands.
	* tree-sra.c (sra_walk_function): Use ZERO_SSA_OPERANDS.
	* tree-ssa-ccp.c (likely_value): Use ZERO_SSA_OPERANDS.
	(ccp_fold): Use new interface.
	(ccp_visit_stmt): Remove unused variables and code.
	(convert_to_gimple_builtin): Insert statements before calling
	mark_new_vars_to_rename.
	* tree-ssa-copy.c (stmt_may_generate_copy): Use ZERO_SSA_OPERANDS.
	(copy_prop_visit_cond_stmt): Use generic interface.
	* tree-ssa-dom.c (struct expr_hash_elt): Use stmt pointer, not the
	annotation in table.
	(thread_across_edge): Use generic interface.
	(initialize_hash_element): Initialzie with stmt, not annotation.
	(eliminate_redundant_computations): Use generic interface.
	(record_equivalences_from_stmt): Pass stmt, not annotation.
	(avail_expr_hash, real_avail_expr_hash, avail_expr_eq): Use generic
	interface.
	* tree-ssa-dse.c (dse_optimize_stmt): Use ZERO_SSA_OPERANDS.
	* tree-ssa-loop-ivopts.c (find_invariants_stmt,
	find_interesting_uses_stmt, protect_loop_closed_ssa_form_use): Use
	generic operand interface.
	* tree-ssa-loop-niter.c (chain_of_csts_start, get_val_for): Use generic
	interface.
	* tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Use Generic operand
	Interface.
	* tree-ssa-operands.c (struct opbuild_list_d): New.  Operand build type.
	(build_defs, build_uses, build_v_may_defs, build_vuses,
	build_v_must_defs): Change type to struct opbuild_list_d.
	(ops_active): New.  Operands active boolean.
	(operand_memory, operand_memory_index): New.  Operand memory managers.
	(allocate_def_optype, allocate_use_optype, allocate_v_may_def_optype,
	allocate_vuse_optype, allocate_v_must_def_optype): Delete.
	(free_uses, free_defs, free_vuses, free_v_may_defs, free_v_must_defs):
	Change from functions to static variable list heads.
	(opbuild_initialize_virtual): New.  Initialize a virtual build list.
	(opbuild_initialize_real): New.  Initialize a virtual build list.
	(opbuild_free): New.  Free a build list.
	(opbuild_num_elems): New.  Number of items in a list.
	(opbuild_append_real): New.  Add a real (tree *) operand.
	(opbuild_append_virtual): New.  Add and sort a virtual (tree) operand.
	(opbuild_first): New.  Return first element index in a list.
	(opbuild_next): New.  Return next element in a list.
	(opbuild_elem_real): New.  Return real element.
	(opbuild_elem_virtual): New.  Return virtual element.
	(opbuild_elem_uid): New.  Return UID of virtual element.
	(opbuild_clear): New.  Reset an operand list.
	(opbuild_remove_elem): New.  Remove an element form a list.
	(ssa_operands_active): New.  Return true if operand cache is active.
	(init_ssa_operands, fini_ssa_operands): Initialize new implementation.
	(ssa_operand_alloc): New.  Allocate memory from an operand chunk.
	(correct_use_link): Use use_operand_p.
	(finalize_ssa_uses, finalize_ssa_v_may_defs, finalize_ssa_defs,
	finalize_ssa_vuses, finalize_ssa_v_must_defs): New implmentation.
	(cleanup_v_may_defs): Use new implmentation.
	(finalize_ssa_stmt_operands, start_ssa_stmt_operands): New
	implementation.
	(append_def, append_use, append_v_may_def, append_vuse,
	append_v_must_def): Call opbuild_append routine instead of using varray.
	(build_ssa_operands): Simplify to simply use stmt, don't maintain a
	global parse_old_ops variable.
	(free_ssa_operands): New implementation.
	(update_stmt_operands): Move.  Change argument to build_ssa_operands.
	(copy_virtual_operands): Move. New generic implementation.
	(create_ssa_artficial_load_stmt): Move. New implementation.
	(swap_tree_operands): Update for new implementation.
	(get_expr_operands): Add stmt parameter to calls to swap_tree_operands.
	(add_call_clobber_ops, add_call_read_ops): Initialize opbuild list
	rather than a varray.
	(verify_imm_links): Use use_operand_p.
	(dump_immediate_uses_for): If the immediate use variable is a virtual
	variable, show the virtual ops in the stmt.
	* tree-ssa-operands.h (def_operand_p): No longer a structure.
	(NULL_DEF_OPERAND_P): Now a #define.
	(def_optype_d, use_optype_d, v_def_use_operand_type, v_may_def_optype_d,
	vuse_operand_type, vuse_optype_d, v_must_def_optype_d): Delete.
	(def_optype_d, use_optype_d, maydef_optype_d, vuse_optype_d,
	mustdef_optype_d): New.  Use Linked list representation.
	(SSA_OPERAND_MEMORY_SIZE): New.  Size of operand memory chunk.
	(struct ssa_operand_memory_d): New.  Allocated Chunk node.
	(struct stmt_operands_d): Change to new pointers that are not GTY.
	(STMT_USE_OPS, NUM_USES, SET_USE_OP, STMT_DEF_OPS, NUM_DEFS, SET_DEF_OP,
	STMT_V_MAY_DEF_OPS, NUM_V_MAY_DEFS, SET_V_MAY_DEF_RESULT,
	SET_V_MAY_DEF_OP, STMT_VUSE_OPS, NUM_VUSES, SET_VUSE_OP,
	STMT_V_MUST_DEF_OPS, NUM_V_MUST_DEFS, SET_V_MUST_DEF_RESULT,
	SET_V_MUST_DEF_KILL): Delete.
	(V_MAY_DEF_OPS, V_MAY_DEF_RESULT_PTR, V_MAY_DEF_RESULT,
	V_MAY_DEF_OP_PTR, V_MAY_DEF_OP): Rename to MAYDEF_*.
	(V_MUST_DEF_OPS, V_MUST_DEF_RESULT_PTR, V_MUST_DEF_RESULT,
	V_MUST_DEF_KILL_PTR, V_MUST_DEF_KILL): Rename to MUSTDEF_*.
	(enum ssa_op_iter_type): Operand iterator typechecking values.
	(struct ssa_operand_iterator_d): Use linked lists of operands.
	(SSA_OP_VMUSTDEFKILL): Rename to SSA_OP_VMUSTKILL.
	(FOR_EACH_SSA_MAYDEF_OPERAND, FOR_EACH_SSA_MUSTDEF_OPERAND,
	FOR_EACH_SSA_MUST_AND_MAY_DEF_OPERAND): Use op_iter_next_maymustdef.
	(FOR_EACH_PHI_ARG): New.  Iterate over PHI arguments.
	(FOR_EACH_PHI_OR_STMT_USE): New.  Iterate over PHI or stmt uses.
	(FOR_EACH_PHI_OR_STMT_DEF): New.  Iterate over PHI or stmt defs.
	(SINGLE_SSA_TREE_OPERAND, SINGLE_SSA_USE_OPERAND,
	SINGLE_SSA_DEF_OPERAND, ZERO_SSA_OPERANDS, NUM_SSA_OPERANDS): New.
	* tree-ssa-opfinalize.h: New.  Function templates for expansion.
	(FINALIZE_ALLOC): Expands into alloc_def, alloc_use, alloc_maydef,
	alloc_vuse, and alloc_mustdef.
	(FINALIZE_FUNC): Expands into finalize_ssa_def_ops,
	finalize_ssa_use_ops, finalize_ssa_v_may_def_ops, finalize_ssa_vuse_ops,
	and finalize_ssa_v_must_def_ops.
	* tree-ssa-pre.c (add_to_sets): Pass tree to vn_add.
	(create_value_expr_from): Use stmt not vuse_optype as a parameter. Pass
	stmt around.
	(compute_avail): Use generic iterator interface.
	* tree-ssa-propagate.c (first_vdef): Use generic operand interface.
	(stmt_makes_single_load, stmt_makes_single_store): Use
	ZERO_SSA_OPERANDS.
	* tree-ssa-sink.c (is_hidden_global_store): Use ZERO_SSA_OPERANDS.
	(statement_sink_location): Use generic interface.
	* tree-ssa.c (verify_ssa):  Use %p in fprintf.  Use generic interface.
	(delete_tree_ssa): Don't call release_defs.  Call release_ssa_name and
	reset the immediate use link nodes.
	(stmt_references_memory_p): Use ZERO_SSA_OPERANDS.
	* tree-ssanames.c (make_ssa_name): Use use_operand_p.
	* tree-tailcall.c (find_tail_calls): Use ZERO_SSA_OPERANDS.
	(eliminate_tail_call): Use generic operand interface.
	* tree-vect-analyze.c (vect_analyze_data_refs): Use ZERO_SSA_OPERANDS.
	(vect_mark_relevant, vect_mark_stmts_to_be_vectorized): Use generic
	interface.
	* tree-vect-transform.c (update_vuses_to_preheader): Use generic
	interface.
	* tree-vectorizer.c (rename_variables_in_bb): Use generic interface.
	* tree-vn.c (struct val_expr_pair_d): Cache statment pointer instead of
	vuse_optype.
	(vn_compute, val_expr_pair_hash, vn_add, vn_lookup, vn_lookup_or_add):
	Use statement pointer instead of vuse_optype.  Use generic interface.
	* tree-vrp.c (maybe_add_assert_expr): Use generic interface.
	(stmt_interesting_for_vrp, vrp_visit_stmt): Use ZERO_SSA_OPERANDS.
	* tree.h (struct ssa_imm_use_d): Renamed to ssa_use_operand_d.
	(tree_ssa_name, phi_arg_d): Use ssa_use_operand_d.
	* doc/tree-ssa.texi: Update documentation for operand interface.

From-SVN: r99155
2005-05-03 12:19:56 +00:00
Diego Novillo 84d658141e [multiple changes]
2005-04-22  Diego Novillo  <dnovillo@redhat.com>

	* Makefile.in (tree-into-ssa.o): Add dependency on PARAMS_H.
	* lambda-code.c (perfect_nestify): Mark virtual operands in
	the moved statement for renaming.
	* params.def (PARAM_MIN_VIRTUAL_MAPPINGS): Define.
	(PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO): Define.
	* params.h (MIN_VIRTUAL_MAPPINGS): Define.
	(VIRTUAL_MAPPINGS_TO_SYMS_RATIO): Define.
	* tree-flow.h (struct var_ann_d): Update comments.
	(rewrite_to_new_ssa_names_bb, rewrite_to_new_ssa_names,
	allocate_ssa_names, find_phi_node_for, dump_tree_ssa,
	debug_tree_ssa, debug_def_blocks, dump_tree_ssa_stats,
	debug_tree_ssa_stats, rewrite_ssa_into_ssa,
	dump_repl_tbl, debug_repl_tbl, dump_names_replaced_by,
	debug_names_replaced_by): Remove declarations.
	(delete_update_ssa, get_current_def, set_current_def): Declare.
	(rewrite_into_loop_closed_ssa): Add new argument.  Update
	all callers.
	* tree-into-ssa.c: Include params.h.
	(old_virtual_ssa_names): Remove.  Update all users.
	(need_to_replace_names_p): Remove.  Update all users.
	(struct update_ssa_stats_d): Declare.
	(update_ssa_stats): New local.
	(dump_tree_ssa, debug_tree_ssa, debug_def_blocks,
	dump_tree_ssa_stats, debug_tree_ssa_stats,
	dump_update_ssa, debug_update_ssa,
	dump_names_replaced_by, debug_names_replaced_by): Declare.
	(get_current_def, set current_def): Make extern.
	(is_old_name, is_new_name): Protect against references
	past the end of the sets.
	(add_new_name_mapping): Assert that OLD and NEW are
	different SSA names for the same symbol.
	When adding a virtual mapping, update stats for virtual
	mapping heuristic.
	(insert_phi_nodes_for): If UPDATE_P is true, create the
	LHS of the new PHI by duplicating SSA name VAR.
	(insert_phi_nodes_1): Remove.  Update all users.
	(insert_phi_nodes): Remove second argument.  Update all
	users.
	(maybe_replace_use, maybe_replace_def): New.
	(rewrite_update_stmt): Call them.
	(mark_def_interesting): Remove calls to is_gimple_reg.
	(prepare_phi_args_for_update): Remove.  Update all users.
	(prepare_block_for_update): Only process virtual operands
	and GIMPLE registers in normal form.
	(prepare_use_sites_for): New.
	(prepare_names_to_update): Rename from prepare_def_sites.
	Call prepare_use_sites_for.
	(dump_update_ssa): Rename from dump_repl_tbl.
	Update all users.
	Show statistics for virtual mapping heuristic.
	(debug_update_ssa): Rename from debug_debug_repl_tbl.
	(init_update_ssa): Initialize UPDATE_SSA_STATS.
	(delete_update_ssa): Make extern.
	(mark_set_for_renaming): If the set is empty, do nothing.
	(release_ssa_name_after_update_ssa): Update comment.
	(insert_updated_phi_nodes_for): Do not remove existing
	PHI nodes for symbols.
	(switch_virtuals_to_full_rewrite_p): New.
	(switch_virtuals_to_full_rewrite): New.
	(update_ssa): Call them.
	Clear REWRITE_THIS_STMT and REGISTER_DEFS_IN_THIS_STMT
	for every statement before updating.
	If all the names in NEW_SSA_NAMES have been marked for
	removal, do nothing.
	Only start at the top of the CFG if there are symbols in
	SYMS_TO_RENAME.
	(ssa_rewrite_finalize_block): Remove.
	(ssa_register_new_def): Remove.
	(ssa_rewrite_stmt): Remove.
	(ssa_rewrite_phi_arguments): Remove.
	(ssa_rewrite_initialize_block): Remove.
	(ssa_mark_def_sites): Remove.
	(ssa_mark_def_sites_initialize_block): Remove.
	(ssa_mark_phi_uses): Remove.
	(rewrite_ssa_into_ssa): Remove.
	* tree-phinodes.c (find_phi_node_for): Remove.
	* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely):
	Call update_ssa.
	* tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops):
	Remove calls to verify_dominators and
	verify_loop_structure.
	(tree_unswitch_single_loop): Call update_ssa.
	* tree-ssa.c (verify_ssa): Assert that need_ssa_update_p
	returns false.
	Call verify_stmts.
	(delete_tree_ssa): Assert that need_ssa_update_p returns
	false.
	* tree-vect-transform.c (vect_transform_loop): Call update_ssa.
	* tree-vectorizer.c (allocate_new_names, rename_def_op,
	free_new_names): Remove.  Update all users.
	(rename_use_op): Call get_current_def.
	(rename_variables_in_bb): Do not handle any real or
	virtual definition.
	(slpeel_update_phis_for_duplicate_loop): Call
	get_current_def and set_current_def instead of using
	SSA_NAME_AUX.
	(slpeel_update_phi_nodes_for_guard2): Reformat comments.
	(slpeel_can_duplicate_loop_p): Call need_ssa_update_p,
	ssa_names_to_replace and delete_update_ssa.
	* doc/invoke.texi: Document --param min-virtual-mappings
	and --param virtual-mappings-ratio.

2005-04-22  Zdenek Dvorak  <dvorakz@suse.cz>
	    Diego Novillo  <dnovillo@redhat.com>

	* tree-cfg.c (tree_duplicate_bb): Call create_new_def_for
	for newly created PHI nodes.
	Call create_new_def_for for every new V_MAY_DEF and
	V_MUST_DEF on the copied statement.
	(struct ssa_name_map_entry): Remove.
	(ssa_name_map_entry_hash): Remove.
	(ssa_name_map_entry_eq): Remove.
	(allocate_ssa_names): Remove.
	(rewrite_to_new_ssa_names_def): Remove.
	(rewrite_to_new_ssa_names_use): Remove.
	(rewrite_to_new_ssa_names_bb): Remove.
	(rewrite_to_new_ssa_names): Remove.
	(tree_duplicate_sese_region): Remove variables ver,
	definitions, phi, ssa_name_map and bi.
	Call need_ssa_update_p instead of any_marked_for_rewrite_p.
	Call update_ssa.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Call
	update_ssa instead of rewrite_ssa_into_ssa.
	* tree-ssa-loop-manip.c (add_exit_phis_edge): Call
	create_new_def_for.
	(find_uses_to_rename_use): Add argument 'need_phis'.
	(find_uses_to_rename_stmt): Do not scan virtual operands.
	(find_uses_to_rename): Only scan PHI nodes for
	non-virtual names.
	(rewrite_into_loop_closed_ssa): Call update_ssa.
	(check_loop_closed_ssa_use): Ignore virtual operands.
	(check_loop_closed_ssa_stmt): Likewise.
	(verify_loop_closed_ssa): Do nothing if CURRENT_LOOPS is
	NULL.
	(rename_variables, set_phi_def_stmts): Remove.
	(tree_duplicate_loop_to_header_edge): Reformat comment.
	Remove variables BB, I and DEFINITIONS.
	Call need_ssa_update_p.
	Call update_ssa.
	(lv_adjust_loop_header_phi): Reformat comment.
	* tree-ssanames.c (ssa_names_to_rewrite): Remove.
	(marked_for_rewrite_p, any_marked_for_rewrite_p,
	mark_for_rewrite, unmark_all_for_rewrite,
	marked_ssa_names): Remove.  Update all users.
	(release_ssa_name): If VAR has been registered for SSA
	updating, do nothing.
	* tree-vrp.c (new_ssa_names, old_ssa_names): Remove.
	(build_assert_expr_for): Call register_new_name_mapping.
	(insert_range_assertions): Update call to update_ssa.
	* tree.h (mark_for_rewrite, unmark_all_for_rewrite,
	marked_for_rewrite_p, any_marked_for_rewrite_p,
	marked_ssa_names): Remove.

From-SVN: r98599
2005-04-22 20:59:54 -04:00
Zdenek Dvorak 9885da8e1b Makefile.in (LIBGCOV): Add _gcov_interval_profiler, _gcov_pow2_profiler and _gcov_one_value_profiler.
* Makefile.in (LIBGCOV): Add _gcov_interval_profiler,
	_gcov_pow2_profiler and _gcov_one_value_profiler.
	(tree-profile.o): Add GGC_H and gt-tree-profile.h dependency.
	(GTFILES): Add $(srcdir)/tree-profile.c.
	* gcov-io.h (__gcov_interval_profiler, __gcov_pow2_profiler,
	__gcov_one_value_profiler): Declare.
	* gimplify.c (force_gimple_operand): Check whether the statements
	should be produced in ssa form.
	(force_gimple_operand_bsi): New function.
	* libgcov.c (__gcov_interval_profiler, __gcov_pow2_profiler,
	__gcov_one_value_profiler): New functions.
	* rtl-profile.c (rtl_gen_pow2_profiler): Only measure whether
	the profiled value is a power of two or not.
	* tree-cfg.c (tree_block_ends_with_condjump_p): Handle empty blocks.
	* tree-flow.h (in_ssa_p): Declare.
	(force_gimple_operand_bsi): Declare.
	* tree-into-ssa.c (in_ssa_p): New variable.
	(rewrite_into_ssa): Set in_ssa_p.
	* tree-outof-ssa.c (rewrite_out_of_ssa): Set in_ssa_p.
	* tree-profile.c: Include ggc.h and gt-tree-profile.h.
	(gcov_type_node, tree_interval_profiler_fn, tree_pow2_profiler_fn,
	tree_one_value_profiler_fn): New variables.
	(tree_init_edge_profiler): Initialize the profiler function decls.
	(tree_gen_edge_profiler): Use global gcov_type_node.
	(prepare_instrumented_value): New function.
	(tree_gen_interval_profiler, tree_gen_interval_profiler,
	tree_gen_one_value_profiler): Call the library functions instead of
	creating instrumentation code.
	* tree.c (build_fn_decl): New function.
	* tree.h (build_fn_decl): Declare.
	* value-prof.c (rtl_divmod_values_to_profile,
	rtl_find_values_to_profile, rtl_mod_pow2_value_transform,
	tree_mod_pow2_value_transform, tree_find_values_to_profile):
	Do not handle may_be_other and precise values of exponents at pow2
	profiler.
	(tree_mod_subtract_transform): Reflect that value field of
	histogram has changed meaning.
	(tree_divmod_values_to_profile): Record the values correctly.
	(tree_values_to_profile): Update comment.
	* value-prof.h (struct histogram_value_t): Remove pow2 data.

From-SVN: r98555
2005-04-22 10:57:04 +00:00
Nathan Sidwell d4e6fecb8f vec.h: Update API to separate allocation mechanism from type.
* vec.h: Update API to separate allocation mechanism from type.
	(VEC_safe_grow): New.
	* vec.c (calculate_allocation): New.
	(vec_gc_o_reserve, vec_heap_o_reserve): Adjust.
	(vec_gc_free, vec_heap_free): Remove.
	* gengtype-lex.l (DEF_VEC_): Process mult-argument macros.  Adjust.
	(VEC): Likewise.
	(mangle_macro_name): New.
	(struct macro_def): New.
	(struct macro): Add multiple argument values.
	(macro_expans_end): New.
	(push_macro_expansion):  Chain on new macro. Process multiple
	args, create follow on expansion. Return follow on argument.
	(macro_input): Deal with multiple arguments.

	* tree.h: Define VEC(tree,heap) and VEC(tree,gc).
	(struct tree_binfo): Adjust.
	* basic-block.h: Define VEC(edge,gc).
	(struct edge_def): Adjust.
	(struct basic_block_def, struct edge_iterator): Likewise.
	(ei_container, ei_start_1, ei_last_1): Likewise.
	* cfg.c (connect_src, connect_dest): Likewise.
	* cfgrtl.c (force_nonfallthru_and_redirect)
	* dbxout.c (dbxout_type)
	* dwarf2out.c (gen_member_die)
	* lambda-code.c: Define VEC(int,gc), VEC(lambda_loop,gc).
	(gcc_tree_to_linear_expression): Adjust.
	(gcc_loop_to_lambda_loop, gcc_loopnest_to_lambda_loopnest,
	lbv_to_gcc_expression, lle_to_gcc_expression,
	lambda_loopnest_to_gcc_loopnest, can_convert_to_perfect_nest,
	perfect_nestify): Likewise.
	* lambda.h (gcc_loopnest_to_lambda_loopnest,
	lambda_loopnest_to_gcc_loopnest): Adjust prototypes.
	* profile.c (instrument_values): Adjust.
	* tree-cfg.c (modified_noreturn_calls): Adjust.
	(remove_fallthru_edge): Likewise.
	* tree-dump.c (dequeue_and_dump): Adjust.
	* tree-flow-inline.h (mark_stmt_modified): Adjust.
	* tree-flow.h (modified_noreturn_calls): Adjust.
	(tree_on_heap): Remove. (yay!)
	(register_new_def): Adjust.
	* tree-into-ssa.c: Define VEC(int,heap).
	(block_defs_stack): Adjust.
	(find_idf, insert_phi_nodes, register_new_def,
	rewrite_initialize_block, rewrite_finalize_block,
	register_new_update_single, rewrite_update_init_block,
	rewrite_update_fini_block, rewrite_blocks,
	ssa_rewrite_finalize_block, ssa_register_new_def,
	ssa_rewrite_initialize_block, rewrite_ssa_into_ssa): Likewise.
	* tree-loop-linear.c (linear_transform_loops): Adjust.
	* tree-ssa-alias.c: Define VEC(fieldoff_t,heap).
	(push_fields_onto_fieldstack, create_overlap_variables_for): Adjust.
	* tree-ssa-dom.c (avail_exprs_stack, block_defs_stack,
	stmts_to_rescan, const_and_copies_stack, nonzero_vars_stack,
	vrp_variables_stack): Adjust declarations.
	(tree_ssa_dominator_optimize): Adjust.
	(dom_opt_initialize_block, remove_local_expressions_from_table,
	restore_nonzero_vars_to_original_value,
	restore_vars_to_original_value,
	restore_currdefs_to_original_value, dom_opt_finalize_block,
	record_var_is_nonzero, record_cond, record_const_or_copy_1,
	optimize_stmt, update_rhs_and_lookup_avail_expr,
	lookup_avail_expr, record_range): Likewise.
	* tree-ssa-pre.c: Define VEC(basic_block,heap).
	(compute_antic_aux): Adjust.
	(inserted_exprs, create_expression_by_pieces,
	insert_into_preds_of_block, eliminate, mark_operand_necessary,
	remove_dead_inserted_code, fini_pre): Likewise.
	* tree-ssa-propagate.c (interesting_ssa_edges): Adjust.
	(varying_ssa_edges, add_ssa_edge, process_ssa_edge_worklist.
	ssa_prop_init): Likewise.
	* tree-ssa.c: Define VEC(bitmap,heap).
	(verify_name_tags): Adjust.
	* value-prof.c (rtl_divmod_values_to_profile): Adjust.
	(insn_prefetch_values_to_profile, rtl_find_values_to_profile,
	tree_divmod_values_to_profile, tree_find_values_to_profile,
	value_profile_transformations): Likewise.
	* value-prof.h: Define VEC(histogram_value,heap).
	* varasm.c: Remove alias_pair pointer typedef, define
	VEC(alias_pair,gc).
	(finish_aliases_1, finish_aliases_2, assemble_alias): Adjust.

	* config/pa/pa.c (typedef extern_symbol): Typedef the structure,
	not a pointer to it.  Create an object vector.
	(extern_symbols): Turn into an object vector.
	(pa_hpux_asm_output_external, pa_hpux_file_end): Adjust.

	* cp/cp-tree.h: Adjust for new VEC API.
	Define VEC(tree_pair_s,gc).
	(struct save_scope): Adjust.
	(struct lang_type_class): Adjust.
	(unemitted_tinfo_decls): Adjust.
	* cp/class.c (add_method, resort_type_method_vec,
	finish_struct_methods, struct find_final_overrider_data,
	dfs_find_final_overrider_pre, find_final_overrider,
	get_vcall_index, warn_hidden, walk_subobject_offsets,
	check_methods, fixup_inline_methods, end_of_class,
	warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer,
	add_vcall_offset): Adjust.
	* cp/decl.c (xref_basetypes, finish_method): Adjust.
	* cp/decl2.c (check_classfn): Adjust.
	* cp/init.c (sort_mem_initializers, push_base_cleanups): Adjust.
	* cp/method.c (do_build_copy_constructor): Adjust.
	* cp/name-lookup.c (new_class_binding, store_binding,
	store_bindings, store_class_bindings): Adjust.
	* cp/name-lookup.h: Define VEC(cxx_saved_binding,gc),
	VEC(cp_class_binding,gc).
	(struct cp_binding_level): Adjust.
	* cp/parser.c: Define VEC(cp_token_position,heap).
	(struct cp_lexer): Adjust.
	(cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy,
	cp_lexer_save_tokens): Adjust.
	* cp/pt.c (retrieve_specialization,
	check_explicit_specialization): Adjust.
	* cp/rtti.c (unemitted_tinfo_decls): Adjust.
	(init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init,
	get_pseudo_ti_desc): Adjust.
	* cp/search.c (dfs_access_in_type, lookup_conversion_operator,
	lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible,
	dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust.
	* cp/semantics.c: Define VEC(deferred_access,gc).
	(push_deferring_access_checks): Adjust.
	* cp/typeck2.c (abstract_virtuals_error): Adjust.

From-SVN: r98498
2005-04-21 09:18:28 +00:00
Kazu Hirata deac228468 * tree-into-ssa.c: Fix a comment typo.
From-SVN: r98285
2005-04-17 19:05:14 +00:00
Diego Novillo 0bca51f080 backport: copy-prop, incremental SSA updating of FUD chains and newly exposed symbols.
Merge from tree-cleanup-branch: VRP, store CCP, store
	    copy-prop, incremental SSA updating of FUD chains and
	    newly exposed symbols.

	* Makefile.in (tree-ssa-copy.o): Depend on tree-ssa-propagate.h.
	(OBJS-common): Add tree-vrp.o.
	(tree-vrp.o): New rule.
	* basic-block.h (nearest_common_dominator_for_set): Declare.
	* common.opt (ftree-store-ccp): New flag.
	(ftree-copy-prop): New flag.
	(ftree-vrp): New flag.
	(ftree-store-copy-prop): New flag.
	* dominance.c (nearest_common_dominator_for_set): New.
	* domwalk.c (walk_dominator_tree): Only traverse
	statements in blocks marked in walk_data->interesting_blocks.
	* domwalk.h (struct dom_walk_data): Add field interesting_blocks.
	* fold-const.c (fold): Handle ASSERT_EXPR.
	* opts.c (decode_options): Set flag_tree_copy_prop at -O1.
	Set flag_tree_store_ccp, flag_tree_store_copy_prop and
	flag_tree_vrp at -O2.
	* timevar.def (TV_TREE_VRP): Define.
	(TV_TREE_COPY_PROP): Define.
	(TV_TREE_STORE_COPY_PROP): Define.
	(TV_TREE_SSA_INCREMENTAL): Define.
	(TV_TREE_STORE_CCP): Define.
	* tree-cfg.c (tree_can_merge_blocks_p): Remove reference
	to kill_redundant_phi_nodes from comment.
	(verify_expr): Handle ASSERT_EXPR.
	* tree-dfa.c (mark_new_vars_to_rename): Remove second
	argument.  Update all users.
	(mark_call_clobbered_vars_to_rename): Remove.  Update all
	users.
	* tree-flow-inline.h (unmodifiable_var_p): New.
	* tree-flow.h (enum value_range_type): Declare.
	(struct value_range_def): Declare.
	(value_range): Declare.
	(remove_all_phi_nodes_for): Remove.  Update all users.
	(find_phi_node_for): Declare.
	(add_type_alias): Declare.
	(count_uses_and_derefs): Declare.
	(kill_redundant_phi_nodes): Remove.
	(rewrite_into_ssa): Remove.
	(rewrite_def_def_chains): Remove.
	(update_ssa, register_new_name_mapping, create_new_def_for,
	need_ssa_update_p, name_registered_for_update_p,
	release_ssa_name_after_update_ssa, dump_repl_tbl,
	debug_repl_tbl, dump_names_replaced_by,
	debug_names_replaced_by, mark_sym_for_renaming,
	mark_set_for_renaming, get_current_def, set_current_def,
	get_value_range, dump_value_range, debug_value_range,
	dump_all_value_ranges, debug_all_value_ranges,
	expr_computes_nonzero, loop_depth_of_name,
	unmodifiable_var_p): Declare.
	* tree-gimple.c (is_gimple_formal_tmp_rhs): Handle
	ASSERT_EXPR.
	* tree-into-ssa.c (block_defs_stack): Update comment.
	(old_ssa_names, new_ssa_names, old_virtual_ssa_names,
	syms_to_rename, names_to_release, repl_tbl,
	need_to_initialize_update_ssa_p, need_to_update_vops_p,
	need_to_replace_names_p): New locals.
	(NAME_SETS_GROWTH_FACTOR): Define.
	(struct repl_map_d): Declare.
	(struct mark_def_sites_global_data): Add field
	interesting_blocks.
	(enum rewrite_mode): Declare.
	(REGISTER_DEFS_IN_THIS_STMT): Define.
	(compute_global_livein): Use last_basic_block instead of
	n_basic_blocks.
	(set_def_block): Remove last argument.  Update all callers.
	(prepare_use_operand_for_rename): Remove.  Update all callers.
	(prepare_def_operand_for_rename): Remove.  Update all callers.
	(symbol_marked_for_renaming): New.
	(is_old_name): New.
	(is_new_name): New.
	(repl_map_hash): New.
	(repl_map_eq): New.
	(repl_map_free): New.
	(names_replaced_by): New.
	(add_to_repl_tbl): New.
	(add_new_name_mapping): New.
	(mark_def_sites): Assume that all the operands in the
	statement are in normal form.
	(find_idf): Assert that the block in the stack is valid.
	(get_default_def_for): New.
	(insert_phi_nodes_for): Add new argument 'update_p'.
	Add documentation.
	If update_p is true, add a new mapping between the LHS of
	each new PHI and the name that it replaces.
	(insert_phi_nodes_1): Only call find_idf if needed.
	(get_reaching_def): Call get_default_def_for.
	(rewrite_operand): Remove.
	(rewrite_stmt): Do nothing if REGISTER_DEFS_IN_THIS_STMT
	and REWRITE_THIS_STMT are false.
	Assume that all the operands in the statement are in
	normal form.
	(rewrite_add_phi_arguments): Don't use PHI_REWRITTEN.
	(rewrite_virtual_phi_arguments): Remove.
	(invalidate_name_tags): Remove.
	(register_new_update_single, register_new_update_set,
	rewrite_update_init_block, replace_use,
	rewrite_update_fini_block, rewrite_update_stmt,
	rewrite_update_phi_arguments): New.
	rewrite_blocks): Remove argument 'fix_virtual_phis'.
	Add arguments 'entry', 'what' and 'blocks'.
	Initialize the dominator walker according to 'what' and
	'blocks'.
	Start the dominator walk at 'entry'.
	(mark_def_site_blocks): Add argument 'interesting_blocks'.
	Use it to configure the dominator walker.
	(rewrite_into_ssa): Remove argument 'all'.
	Make internal.
	(rewrite_all_into_ssa): Remove.
	(rewrite_def_def_chains): Remove.
	(mark_def_interesting, mark_use_interesting,
	prepare_phi_args_for_update, prepare_block_for_update,
	prepare_def_site_for, prepare_def_sites,
	dump_names_replaced_by, debug_names_replaced_by,
	dump_repl_tbl, debug_repl_tbl, init_update_ssa,
	delete_update_ssa, create_new_def_for,
	register_new_name_mapping, mark_sym_for_renaming,
	mark_set_for_renaming, need_ssa_update_p,
	name_registered_for_update_p, ssa_names_to_replace,
	release_ssa_name_after_update_ssa,
	insert_updated_phi_nodes_for, update_ssa): New.
	* tree-loop-linear.c (linear_transform_loops): Call
	update_ssa instead of rewrite_into_ssa.
	* tree-optimize.c (vars_to_rename): Remove.
	Update all users.
	(init_tree_optimization_passes): Replace
	pass_redundant_phi with pass_copy_prop.
	Add pass_vrp.
	Replace pass_ccp with pass_store_ccp.
	Add pass_store_copy_prop after pass_store_ccp.
	(execute_todo): If the TODO_ flags don't include updating
	the SSA form, assert that it does not need to be updated.
	Call update_ssa instead of rewrite_into_ssa and
	rewrite_def_def_chains.
	If TODO_verify_loops is set, call verify_loop_closed_ssa.
	(tree_rest_of_compilation):
	* tree-pass.h (TODO_dump_func, TODO_ggc_collect,
	TODO_verify_ssa, TODO_verify_flow, TODO_verify_stmts,
	TODO_cleanup_cfg): Renumber.
	(TODO_verify_loops, TODO_update_ssa,
	TODO_update_ssa_no_phi, TODO_update_ssa_full_phi,
	TODO_update_ssa_only_virtuals): Define.
	(pass_copy_prop, pass_store_ccp, pass_store_copy_prop, pass_vrp):
	Declare.
	* tree-phinodes.c (make_phi_node): Update documentation.
	(remove_all_phi_nodes_for): Remove.
	(find_phi_node_for): New.
	* tree-pretty-print.c (dump_generic_node): Handle ASSERT_EXPR.
	* tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Likewise.
	(interpret_rhs_modify_expr): Likewise.
	* tree-sra.c (decide_instantiations): Mark all symbols in
	SRA_CANDIDATES for renaming.
	(mark_all_v_defs_1): Rename from mark_all_v_defs.
	(mark_all_v_defs): New function.  Update all users to call it
	with the whole list of scalarized statements, not just the
	first one.
	* tree-ssa-alias.c (count_ptr_derefs): Make extern.
	(compute_flow_insensitive_aliasing): If the tag is
	unmodifiable and the variable isn't or vice-versa, don't
	make them alias of each other.
	(setup_pointers_and_addressables): If the type tag for
	VAR is about to change, mark the old one for renaming.
	(add_type_alias): New.
	* tree-ssa-ccp.c: Document SSA-CCP and STORE-CCP.
	(ccp_lattice_t): Rename from latticevalue.
	(value): Remove.  Update all users.
	(const_val): New local variable.
	(do_store_ccp): New local variable.
	(dump_lattice_value): Handle UNINITIALIZED.
	(debug_lattice_value): New.
	(get_default_value): Re-write.
	(set_lattice_value): Re-write.
	(def_to_varying): Remove.  Update all users.
	(likely_value): Return VARYING for statements that make
	stores when STORE_CCP is false.
	Return VARYING for any statement other than MODIFY_EXPR,
	COND_EXPR and SWITCH_EXPR.
	(ccp_initialize): Re-write.
	(replace_uses_in, replace_vuse_in, substitute_and_fold):
	Move to tree-ssa-propagate.c.
	(ccp_lattice_meet): Handle memory stores when
	DO_STORE_CCP is true.
	(ccp_visit_phi_node): Likewise.
	(ccp_fold): Likewise.
	(evaluate_stmt): Likewise.
	(visit_assignment): Likewise.
	(ccp_visit_stmt): Likewise.
	(execute_ssa_ccp): Add argument 'store_ccp'.  Copy it
	into DO_STORE_CCP.
	(do_ssa_ccp): New.
	(pass_ccp): Use it.
	(do_ssa_store_ccp): New.
	(gate_store_ccp): New.
	(pass_store_ccp): Declare.
	* tree-ssa-copy.c: Include tree-ssa-propagate.h.
	(may_propagate_copy): Reformat.
	Don't abort if ORIG is a virtual and DEST isn't.
	If NEW does not have alias information but DEST does,
	copy it.
	(copy_of, cached_last_copy_of, do_store_copy_prop, enum
	copy_prop_kind, which_copy_prop): Declare.
	(stmt_may_generate_copy, get_copy_of_val,
	get_last_copy_of, set_copy_of_val, dump_copy_of,
	copy_prop_visit_assignment, copy_prop_visit_cond_stmt,
	copy_prop_visit_stmt, copy_prop_visit_phi_node,
	init_copy_prop, fini_copy_prop, execute_copy_prop,
	gate_copy_prop, do_copy_prop, gate_store_copy_prop,
	store_copy_prop): New.
	(pass_copy_prop, pass_store_copy_prop): Declare.
	* tree-ssa-dom.c (struct opt_stats_d): Add fields
	'num_const_prop' and 'num_copy_prop'.
	(cprop_operand): Update them.
	(dump_dominator_optimization_stats): Dump them.
	(tree_ssa_dominator_optimize): Call update_ssa instead of
	rewrite_into_ssa.
	(loop_depth_of_name): Declare extern.
	(simplify_cond_and_lookup_avail_expr): Guard against NULL
	values for LOW or HIGH.
	(cprop_into_successor_phis): Only propagate if NEW != ORIG.
	(record_equivalences_from_stmt): Call expr_computes_nonzero.
	(cprop_operand): Only propagate if VAL != OP.
	* tree-ssa-dse.c (dse_optimize_stmt): Mark symbols in removed
	statement for renaming.
	* tree-ssa-loop-im.c (move_computations): Call update_ssa.
	* tree-ssa-loop-ivopts.c (rewrite_address_base): Call
	add_type_alias if necessary.
	Call mark_new_vars_to_rename.
	(tree_ssa_iv_optimize): If new symbols need to be renamed,
	mark every statement updated, call update_ssa and
	rewrite_into_loop_closed_ssa.
	* tree-ssa-loop-manip.c (add_exit_phis): Do not remove DEF_BB
	from LIVEIN if VAR is a virtual.
	* tree-ssa-loop.c (tree_loop_optimizer_init): Call update_ssa.
	* tree-ssa-operands.c (get_expr_operands): Handle ASSERT_EXPR.
	(get_call_expr_operands): Reformat statement.
	(add_stmt_operand): Don't create V_MAY_DEFs for read-only
	symbols.
	* tree-ssa-propagate.c (ssa_prop_init): Initialize
	SSA_NAME_VALUE for every name.
	(first_vdef, stmt_makes_single_load, stmt_makes_single_store,
	get_value_loaded_by): New.
	(replace_uses_in, replace_vuses_in, replace_phi_args_in,
	substitute_and_fold): Move from tree-ssa-ccp.c.
	* tree-ssa-propagate.h (struct prop_value_d, prop_value_t,
	first_vdef, stmt_makes_single_load, stmt_makes_single_store,
	get_value_loaded_by, replace_uses_in, substitute_and_fold):
	Declare.
	* tree-ssa.c (verify_use): Fix error message.
	(propagate_into_addr, replace_immediate_uses, get_eq_name,
	check_phi_redundancy, kill_redundant_phi_nodes,
	pass_redundant_phi): Remove.  Update all users.
	* tree-vect-transform.c (vect_create_data_ref_ptr): Call
	add_type_alias, if necessary.
	* tree-vectorizer.h (struct _stmt_vect_info): Update
	documentation for field 'memtag'.
	* tree-vrp.c: New file.
	* tree.def (ASSERT_EXPR): Define.
	* tree.h (ASSERT_EXPR_VAR): Define.
	(ASSERT_EXPR_COND): Define.
	(SSA_NAME_VALUE_RANGE): Define.
	(struct tree_ssa_name): Add field 'value_range'.
	(PHI_REWRITTEN): Remove.
	(struct tree_phi_node): Remove field 'rewritten'.
	* doc/invoke.texi (-fdump-tree-storeccp, -ftree-copy-prop,
	-ftree-store-copy-prop): Document.
	* doc/tree-ssa.texi: Remove broken link to McCAT's compiler.
	Document usage of update_ssa.

testsuite/ChangeLog

	* g++.dg/tree-ssa/pr18178.C: New test.
	* gcc.c-torture/execute/20030216-1.x: Ignore at -O1.
	* gcc.c-torture/execute/20041019-1.c: New test.
	* gcc.dg/tree-ssa/20041008-1.c: New test.
	* gcc.dg/tree-ssa/ssa-ccp-12.c: New test.
	* gcc.dg/tree-ssa/20030731-2.c: Update to use -fdump-tree-store_ccp.
	* gcc.dg/tree-ssa/20030917-1.c: Likewise.
	* gcc.dg/tree-ssa/20030917-3.c: Likewise.
	* gcc.dg/tree-ssa/20040721-1.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ccp-1.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ccp-2.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ccp-3.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ccp-7.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ccp-9.c: Likewise.

From-SVN: r97884
2005-04-08 21:37:54 -04:00
Andrew MacLeod f430bae872 lambda-code.c (lambda_loopnest_to_gcc_loopnest): Use update_stmt.
2005-04-05  Andrew MacLeod  <amacleod@redhat.com>

	* lambda-code.c (lambda_loopnest_to_gcc_loopnest): Use update_stmt.
	Use immediate use iterator.
	(stmt_is_bumper_for_loop): Use immediate use iterator.
	* predict.c (strip_builtin_expect): Use update_stmt.
	* tree-cfg.c (update_modified_stmts): New. Call update_stmt_if_modified
	on all elements of a STATEMENT_LIST.
	(bsi_insert_before, bsi_insert_after): Call update_modified_stmts.
	(bsi_remove): Remove imm_use links and mark the stmt as modified.
	(bsi_replace): Mark stmt as modified and the update it.
	* tree-complex.c (update_complex_assignment): Call mark_stmt_modified.
	(expand_complex_libcal): Call update_stmt.
	(expand_complex_comparison): Call mark_stmt_modified.
	(expand_complex_operations_1): Call update_stmt_if_modified.
	(expand_vector_operations_1): Call mark_stmt_modified.
	* tree-dfa.c (compute_immediate_uses, free_df_for_stmt, free_df,
	compute_immediate_uses_for_phi, compute_immediate_uses_for_stmt,
	add_immediate_use, redirect_immediate_use,
	redirect_immediate_uses, dump_immediate_uses, debug_immediate_uses,
	dump_immediate_uses_for, debug_immediate_uses_for): Delete.
	(mark_new_vars_to_rename): Call update_stmt.
	* tree-dump.c (dump_option_value_in): Add "stmtaddr".
	* tree-flow-inline.h (modify_stmt): Rename to mark_stmt_modified.
	Ignore PHI nodes.
	(unmodify_stmt): Delete.
	(update_stmt): New.  Force an update of a stmt.
	(update_stmt_if_modified): update a stmt if it is out of date.
	(get_stmt_operands): Verify stmt is NOT modified.
	(stmt_modified_p): Update comment.
	(delink_imm_use): Remove a use node from its immuse list.
	(link_imm_use_to_list): Link a use node to a specific list.
	(link_imm_use): Link a node to the correct list.
	(set_ssa_use_from_ptr): Set a use node to a specific value, and insert
	it in the correct list, if appropriate.
	(link_imm_use_stmt): Link a use node, and set the stmt pointer.
	(relink_imm_use): Link a use node in place of another node in a list.
	(relink_imm_use_stmt): LInk a node in place of another node, and set
	the stmt pointer.
	(end_safe_imm_use_traverse): New.  Terminate a safe immuse iterator.
	(end_safe_imm_use_p): New.  Check for the end of a safe immuse iterator.
	(first_safe_imm_use): New.  Initialize a safe immuse iterator.
	(next_safe_imm_use): New.  Proceed to next safe immuse iterator value.
	(end_readonly_imm_use_p): New.  Check for end of a fast immuse iterator.
	(first_readonly_imm_use): New.  Initialize a fast immuse iterator.
	(next_readonly_imm_use): New.  Get the next fast immuse iterator value.
	(has_zero_uses): New.  Return true if there are no uses of a var.
	(has_single_use): New.  Return true if there is only a single use of a
	variable.
	(single_imm_use): New.  Return the simgle immediate use.
	(num_imm_uses): New.  Return the number of immediate uses.
	(get_v_must_def_ops): Use is now a pointer.
	(use_operand_p, get_v_may_def_op_ptr, get_vuse_op_ptr,
	get_v_must_def_kill_ptr, get_phi_arg_def_ptr): Return the address of
	the use node.
	(get_immediate_uses, num_immediate_uses, immediate_use): Delete.
	(delink_stmt_imm_use): Delink all immuses from a stmt.
	(phi_arg_index_from_use): New.  Return a phi arg index for a use.
	* tree-flow.h (struct dataflow_d): Delete.
	(immediate_use_iterator_d): New.  Immediate use iterator struct.
	(FOR_EACH_IMM_USE_FAST): New.  Macro for read only immuse iteration.
	(FOR_EACH_IMM_USE_SAFE): New.  Macro for write-safe immuse iteration.
	(BREAK_FROM_SAFE_IMM_USE): New.  Macro for earlyu exit from write-safe
	iteration.
	(struct stmt_ann_d): Remove dataflow_t from struct.
	* tree-if-conv.c (tree_if_conversion).  Don't call free_df.
	(if_convertible_phi_p): Use FAST immuse iterator.
	(if_convertible_loop_p): Don't call compute_immediate_uses.
	(replace_phi_with_cond_modify_expr): Call update_stmt.
	* tree-into-ssa.c (mark_def_sites, ssa_mark_def_sites): Call
	update_stmt_if_modified.
	(rewrite_all_into_ssa): Initialize ssa operands.
	* tree-loop-linear.c (linear_transform_loops): Don't call free_df or
	compute_immediate_uses.
	* tree-optimize.c (execute_todo): Call verify_ssa whenever the
	ssa_property is available.
	(execute_one_pass):  Change parameters passed to execute_todo.
	* tree-outof-ssa.c (rewrite_trees): Don't call modify_stmt.
	(remove_ssa_form): Call fini_ssa_operands.
	(insert_backedge_copies): Delete call to modify_stmt.
	* tree-phinodes.c (make_phi_node): Initialize use nodes.
	(release_phi_node): Delink any use nodes before releasing.
	(resize_phi_node): Relink any use nodes.
	(remove_phi_arg_num): Delink the use node.
	(remove_phi_node): Release the ssa_name AFTER releasing the phi node.
	(remove_all_phi_nodes_for): Release phi node first.
	* tree-pretty-print.c (dump_generic_node): Print stmt address.
	* tree-sra.c (mark_all_v_defs): Call update_stmt_if_modified.
	(scalarize_use, scalarize_copy): Call update_stmt.
	* tree-ssa-alias.c (compute_may_aliases): Update all modified stmts.
	(compute_points_to_and_addr_escape): Call mark_stmt_modified.
	* tree-ssa-cpp.c (need_imm_uses_for): Delete.
	(ccp_initialize): Remove call to compute_immediate_uses.
	(substitute_and_fold, execute_fold_all_builtins): Call update_stmt.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Update all modified
	stmts.
	(simplify_cond_and_lookup_avail_expr): Call mark_stmt_modified.
	(simplify_switch_and_lookup_avail_expr): Call mark_stmt_modified.
	(eliminate_redundant_computations): Call mark_stmt_modified.
	(cprop_operand): Call mark_stmt_modified.
	(optimize_stmt): Call update_stmt_if_modified and mark_stmt_modified.
	* tree-ssa-dse.c (fix_phi_uses, fix_stmt_v_may_defs): Delete.
	(dse_optimize_stmt): Use new immuse interface.
	(tree_ssa_dse): Remove calls to compute_immediate_uses and free_df.
	* tree-ssa-forwprop.c (need_imm_uses_for): Delete.
	(substitute_single_use_vars): Use new immuse interface.
	(tree_ssa_forward_propagate_single_use_vars): Remove calls to free_df
	and compute_immediate_uses.
	* tree-ssa-loop-im.c (single_reachable_address): Use new immuse
	interface.
	(rewrite_mem_refs): Call update_stmt.
	(determine_lsm): Remove call to compute_imm_uses and free_df.
	* tree-ssa-loop-ivcanon.c (create_canonical_iv): Call update_stmt.
	(try_unroll_loop_completely): Call update_stmt.
	* tree-ssa-loop-ivopts.c (rewrite_address_base): Call update_stmt.
	(rewrite_use_compare): Call update_stmt.
	(compute_phi_arg_on_exit): Insert each stmt before trying to process.
	(rewrite_use) : Call update_stmt.
	* tree-ssa-loop-manip.c (verify_loop_closed_ssa): Add arg to call.
	* tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Call
	update_stmt.
	* tree-ssa-operands.c (NULL_USE_OPERAND_P): Remove declaration.
	(allocate_use_optype, allocate_vuse_optype): Adjust allocation size.
	(free_uses, free_vuses, free_v_may_defs, free_v_must_defs): Delink
	use nodes.
	(initialize_vuse_operand): New.  Initialize a vuse operand.
	(initialize_v_may_def_operand): New.  Initialize a maydef operand.
	(initialize_v_must_def_operand): New.  Initialize a mustdef operand.
	(finalize_ssa_defs): Use stmt parameter.
	(correct_use_link): Ensure a use node is in the correct list, and has
	the correct stmt pointer.
	(finalize_ssa_uses, finalize_ssa_v_may_defs, finalize_ssa_vuses,
	finalize_ssa_v_must_defs): Also initialize use nodes.
	(finalize_ssa_stmt_operands): Pass extra stmt operands.
	(build_ssa_operands): Seperate parsing from final operand construction.
	(parse_ssa_operands): New.  Parse entry point for operand building.
	(swap_tree_operands): New.  Swap 2 tree operands.
	(update_stmt_operands): Ranamed from get_stmt_operands.  Always builds
	operands.
	(get_expr_operands): Call swap_tree_operands when needed.
	(copy_virtual_operands): Use initialize routines for virtual use ops.
	(create_ssa_artficial_load_stmt): Add extra stmt parameter.
	(verify_abort): New.  Issue imm_use error.
	(verify_imm_links): New Verify imm_use links for a var.
	(dump_immediate_uses_for): New.  Dump imm_uses for a var to file.
	(dump_immediate_uses): New.  Dump imm_uses for all vars to file.
	(debug_immediate_uses): New.  Dump imm_uses for all vars to stderr.
	(debug_immediate_uses_for): New.  Dump imm_uses for a var to stderr.
	* tree-ssa-operands.h (struct use_operand_ptr): Delete.
	(NULL_USE_OPERAND_P) Define.
	(use_optype_d, v_def_use_operand_type, vuse_optype_d): Add immediate
	use node.
	(struct vuse_operand_type): New struct.
	(SET_USE): Call set_ssa_use_from_ptr.
	(USE_STMT): Define.
	(PHI_ARG_INDEX_FROM_USE): Define.
	* tree-ssa-phiopt.c (replace_phi_edge_with_variable): Set the phi
	argument via SET_USE, not PHI_ARG_DEF_TREE.
	* tree-ssa-pre.c (eliminate): Call update_stmt.
	* tree-ssa-propagate.c (cfg_blocks_get): Use imm_use iterators.  Don't
	call free_df.
	* tree-ssa-sink.c (all_immediate_uses_same_place): Use imm_use iterator.
	(nearest_common_dominator_of_uses): Use imm_use iterator.
	(statement_sink_location): Use imm_use iterator and interface.
	(execute_sink_code): Don't call compute_immediate_uses or free-df.
	* tree-ssa-threadupdate.c (create_edge_and_update_destination_phis): Use
	PHI_ARG_DEF, not PHI_ARG_DEF_TREE.
	* tree-ssa.c (verify_use, verify_phi_args): Verify some imm_use info.
	(verify_ssa): Ensure no stmt is marked modify after optimization pass
	if new parameter is true.
	(init_tree_ssa): Don't initialize operand cache here.
	(delete_tree_ssa): Don't destroy operand cache here.
	(propagate_into_addr): Pass in a use pointer, return true if anything
	was changed.
	(replace_immediate_uses): Use imm_use iterator, call update_stmt.
	(check_phi_redundancy): Use imm_use iterator.
	(kill_redundant_phi_nodes): Don't call compute_immediate_uses or
	free_df.
	* tree-ssanames.c (make_ssa_name): Initialize imm_use node.
	(release_ssa_name): Delink node and all elements in its imm_use list.
	* tree-tailcall.c (adjust_return_value): Call update_stmt.
	* tree-vect-analyze.c (vect_stmt_relevant_p): Use imm_use iterator.
	* tree-vectorizer.c (need_imm_uses_for): Delete.
	(vectorize_loops): Dont call compute_immediate_uses or free_df.
	* tree.h (struct ssa_imm_use_d): Define.
	(SSA_NAME_IMM_USE_NODE): Define.
	(struct tree_ssa_name): Add imm_use node.
	(PHI_DF): Delete.
	(PHI_ARG_IMM_USE_NODE): Define.
	(struct phi_arg_d): Add imm_use node.
	(struct tree_phi_node): Remove struct dataflow_d element.
	(TDF_STMTADDR): Define.

From-SVN: r97648
2005-04-05 19:05:20 +00:00
Kazu Hirata af5d3a18b5 * tree-into-ssa.c: Remove obsolete comments.
From-SVN: r96813
2005-03-21 17:04:24 +00:00
Kazu Hirata 625da0db0f tree-into-ssa.c (find_idf): Use VEC_quick_push instead of VEC_safe_push.
* tree-into-ssa.c (find_idf): Use VEC_quick_push instead of
	VEC_safe_push.

From-SVN: r96684
2005-03-18 14:02:26 +00:00
Kazu Hirata d357720d41 tree-into-ssa.c (find_idf): Speed up by putting the indexes of basic blocks into work_stack.
* tree-into-ssa.c (find_idf): Speed up by putting the indexes
	of basic blocks into work_stack.

From-SVN: r96367
2005-03-13 13:31:01 +00:00
Kazu Hirata 184d1bb5d7 * tree-into-ssa.c (ann): Remove ann.
From-SVN: r96185
2005-03-09 11:33:22 +00:00
Diego Novillo 736c86ad83 re PR tree-optimization/20204 (miscompilation of asm-declared registers)
PR tree-optimization/20204
	* tree-into-ssa.c (insert_phi_nodes_for): Do not use
	REWRITE_THIS_STMT markers on PHI nodes.
	(rewrite_initialize_block): Likewise.


testsuite/ChangeLog

	PR tree-optimization/20204
	* testsuite/gcc.dg/pr20204.c: New test.

From-SVN: r95547
2005-02-25 16:12:34 -05:00
Diego Novillo 7256233c7a * tree-into-ssa.c: Re-organize internal functions.
From-SVN: r95499
2005-02-24 09:18:46 -05:00
Diego Novillo 554beb3a44 tree-into-ssa.c (rewrite_blocks): Move debug dumps from ...
* tree-into-ssa.c (rewrite_blocks): Move debug dumps from ...
	(rewrite_into_ssa): ... here.

From-SVN: r95395
2005-02-22 10:11:06 -05:00
Nathan Sidwell 8bdbfff57e bitmap.h (BITMAP_XMALLOC, [...]): Remove.
* bitmap.h (BITMAP_XMALLOC, BITMAP_XFREE): Remove.
	* bb-reorder.c (duplicate_computed_gotos): Use BITMAP_ALLOC and
	BITMAP_FREE.
	* bt-load.c (btr_def_live_range, combine_btr_defs,
	migrate_btr_def, migrate_btr_defs): Likewise.
	* cfgcleanup.c (thread_jump): Likewise.
	* cfgloop.c (get_loop_body_in_bfs_order): Likewise.
	* df.c (df_insn_table_realloc, df_bitmaps_alloc, df_bitmaps_free,
	df_alloc, df_free, df_du_chain_create, df_bb_rd_local_compute,
	df_rd_local_compute, df_reg_info_compute): Likewise.
	* dominance.c (init_dom_info, free_dom_info): Likewise.
	* flow.c (init_propagate_block_info,
	free_propagate_block_info): Likewise.
	* gcse.c (alloc_gcse_mem, free_gcse_mem): Likewise.
	* global.c (allocate_bb_info, free_bb_info, calculate_reg_pav,
	modify_reg_pav): Likewise.
	* loop-invariant.c (find_defs, find_invariant_insn,
	find_invariants, free_inv_motion_data): Likewise.
	* predict.c (tree_predict_by_opcode,
	estimate_bb_frequencies): Likewise.
	* stmt.c (expand_case): Likewise.
	* tree-cfg.c (tree_duplicate_sese_region): Likewise.
	* tree-dfa.c (mark_new_vars_to_rename): Likewise.
	* tree-if-conv.c (get_loop_body_in_if_conv_order): Likewise.
	* tree-into-ssa.c (insert_phi_nodes_for, def_blocks_free,
	get_def_blocks_for, mark_def_site_blocks, rewrite_into_ssa,
	rewrite_ssa_into_ssa): Likewise.
	* tree-optimize.c (tree_rest_of_compilation): Likewise.
	* tree-outof-ssa.c (new_temp_expr_table, free_temp_expr_table,
	analyze_edges_for_bb, perform_edge_inserts): Likewise.
	* tree-scalar-evolution.c (scev_initialize, scev_finalize): Likewise.
	* tree-sra.c (tree_sra): Likewise.
	* tree-ssa-alias.c (init_alias_info, delete_alias_info): Likewise.
	* tree-ssa-ccp.c (ccp_fold_builtin): Likewise.
	* tree-ssa-dce.c (tree_dce_init, tree_dce_done): Likewise.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
	* tree-ssa-dse.c (tree_ssa_dse): Likewise.
	* tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_var):
	Likewise.
	* tree-ssa-live.c (new_tree_live_info, delete_tree_live_info,
	calculate_live_on_entry, calculate_live_on_exit,
	build_tree_conflict_graph): Likewise.
	* tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_init, record_use,
	record_important_candidates, set_use_iv_cost, find_depends,
	determine_use_iv_costs, iv_ca_new, iv_ca_free, free_loop_data,
	tree_ssa_iv_optimize_finalize): Likewise.
	* tree-ssa-loop-manip.c (add_exit_phis_var, get_loops_exit,
	find_uses_to_rename_use, rewrite_into_loop_closed_ssa,
	tree_duplicate_loop_to_header_edge): Likewise.
	* tree-ssa-pre.c (init_pre, fini_pre): Likewise.
	* tree-ssa.c (verify_flow_insensitive_alias_info,
	verify_name_tags, verify_ssa, init_tree_ssa,
	delete_tree_ssa): Likewise.
	* tree-ssanames.c (marked_ssa_names, init_ssanames,
	fini_ssanames): Likewise.
	* tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): Likewise.

From-SVN: r95172
2005-02-17 16:19:49 +00:00
Jeff Law 7d793e369d tree-into-ssa.c (mark_def_sites_global_data): Make KILLS bitmap a sparse bitmap instead of a simple bitmap.
* tree-into-ssa.c (mark_def_sites_global_data): Make KILLS
        bitmap a sparse bitmap instead of a simple bitmap.
        (mark_def_sites_initialize_block):  Corresponding changes.
        (ssa_mark_def_sites_initialize_block): Likewise.
        (ssa_mark_phi_uses): Likewise.
        (mark_def_site, ssa_mark_def_sites): Likewise.
        (mark_def_site_blocks): Likewise.
        (rewrite_ssa_into_ssa): Likewise.

From-SVN: r94519
2005-01-31 22:28:23 -07:00
Jeff Law 88af764e45 tree-into-ssa.c (ssa_rewrite_initialize_block): Do not register definitions of SSA_NAMEs which are not being rewritten.
* tree-into-ssa.c (ssa_rewrite_initialize_block): Do not register
        definitions of SSA_NAMEs which are not being rewritten.
        (rewrite_ssa_into_ssa): Only initialize the current definition
        of an SSA_NAME if that SSA_NAME has been marked for rewriting.
        If checking is enabled, assert that SSA_NAME_AUX is clear for all
        SSA_NAMEs before returning.

From-SVN: r94343
2005-01-27 15:33:14 -07:00
Kazu Hirata 3bb18f4921 tree-into-ssa.c (rewrite_ssa_into_ssa): Free SSA_NAME_AUX before we release an SSA_NAME.
* tree-into-ssa.c (rewrite_ssa_into_ssa): Free SSA_NAME_AUX
	before we release an SSA_NAME.

From-SVN: r92031
2004-12-11 15:58:51 +00:00
Diego Novillo 7d5f9cc68f tree-into-ssa.c (REWRITE_THIS_STMT): Define.
* tree-into-ssa.c (REWRITE_THIS_STMT): Define.
	(mark_def_sites): Clear REWRITE_THIS_STMT for statements that
	don't need any operands rewritten.
	(rewrite_stmt): Ignore statements that don't need to be
	rewritten.
	(rewrite_operand): Validate that an existing SSA_NAME is
	identical to the current reaching definition of the operand.


	* tree-dfa.c (mark_call_clobbered_vars_to_rename): New function.
	* tree-vectorizer.c (vectorizable_load): Call it.
	* tree-flow.h (mark_call_clobbered_vars_to_rename): Declare.
	* tree-sra.c (mark_all_v_defs): Also mark VUSEs for renaming.

From-SVN: r92010
2004-12-10 16:54:42 -05:00
Diego Novillo d21d51d099 tree-into-ssa.c (insert_phi_nodes_for): Pass argument WORK_STACK by reference.
* tree-into-ssa.c (insert_phi_nodes_for): Pass argument
	WORK_STACK by reference.
	Call VEC_safe_push instead of VEC_quick_push.
	Update all users.

testsuite/ChangeLog

	* gcc.c-torture/compile/pr18712.c: New test.

From-SVN: r91481
2004-11-29 15:02:09 -05:00
Kazu Hirata d2e398dfc8 tree-phinodes.c (add_phi_arg): Take "tree" instead of "tree *" as the first argument.
* tree-phinodes.c (add_phi_arg): Take "tree" instead of
	"tree *" as the first argument.
	* tree-flow.h: Update the prototype of add_phi_arg.
	* lambda-code.c, tree-cfg.c, tree-into-ssa.c,
	tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa-pre.c,
	tree-ssa-threadupdate.c, tree-ssa.c, tree-tailcall.c,
	tree-vectorizer.c: Update all call sites of add_phi_arg.

From-SVN: r91307
2004-11-25 22:31:09 +00:00
Diego Novillo ceb7eb8f8c tree-into-ssa.c (DEF_VEC_MALLOC_P(basic_block)): Declare.
* tree-into-ssa.c (DEF_VEC_MALLOC_P(basic_block)): Declare.
	(insert_phi_nodes_for): Change third argument to VEC(basic_block).
	* tree-ssa-dom.c (avail_exprs_stack): Change type to VEC(tree_on_heap).
	Update all users.
	(stmts_to_rescan): Likewise.
	(const_and_copies_stack): Likewise.
	(nonzero_vars_stack): Likewise.
	(vrp_variables_stack): Likewise.

From-SVN: r91122
2004-11-23 18:38:12 -05:00
Andrew Pinski 3a2e4b46f5 re PR tree-optimization/18507 (block_defs_stack varrray should not be GC'ed)
2004-11-19  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/18507
        * tree-flow.h (tree2): Typedef because there is already a VEC(tree).
        Define a VEC(tree2) for head.
        (register_new_def): Change second argument to be a VEC(tree2).
        * tree-ssa-dom.c (block_defs_stack): Change to be a VEC(tree2).
        (tree_ssa_dominator_optimize): Initialize block_defs_stack with
        the VEC(tree2) function.  Also free it before returning.
        (dom_opt_initialize_block): Use VEC_safe_push instead of VARRAY_PUSH_TREE
        for block_defs_stack.
        (restore_currdefs_to_original_value): Use VEC_length instead of
        VARRAY_ACTIVE_SIZE. VEC_pop instead of VARRAY_TOP_TREE/VARRAY_POP.
        (dom_opt_finalize_block): Use VEC_safe_push instead of VARRAY_PUSH_TREE
        for block_defs_stack.
        * tree-into-ssa.c (block_defs_stack): Change to be a VEC(tree2).
        (rewrite_initialize_block): Use VEC_safe_push instead of VARRAY_PUSH_TREE
        for block_defs_stack.
        (ssa_register_new_def): Likewise.
        (ssa_rewrite_initialize_block): Likewise.
        (rewrite_finalize_block): Use VEC_length instead of
        VARRAY_ACTIVE_SIZE. VEC_pop instead of VARRAY_TOP_TREE/VARRAY_POP.
        (ssa_rewrite_finalize_block): Likewise.
        (register_new_def): Change second argument to be a VEC(tree2).
        Use VEC_safe_push instead of VARRAY_PUSH_TREE.
        (rewrite_blocks): Initialize block_defs_stack with
        the VEC(tree2) function.  Also free it before returning.
        (rewrite_ssa_into_ssa): Likewise.

From-SVN: r90926
2004-11-19 10:21:44 -08:00
Kazu Hirata bb29d95124 tree-cfg.c, [...]: Replace TREE_CHAIN with PHI_CHAIN where appropriate.
* tree-cfg.c, tree-if-conv.c, tree-into-ssa.c,
	tree-scalar-evolution.c, tree-ssa-loop-im.c,
	tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa.c,
	tree-vectorizer.c: Replace TREE_CHAIN with PHI_CHAIN where
	appropriate.

From-SVN: r90262
2004-11-08 13:54:41 +00:00