Commit Graph

40 Commits

Author SHA1 Message Date
Thomas Neumann c22940cd7c tree-ssa-alias-warnings.c (maybe_add_match): Cast according to the coding conventions.
* tree-ssa-alias-warnings.c (maybe_add_match): Cast according to the
	coding conventions.
	(add_key): Likewise.
	* tree-ssa.c (init_tree_ssa): Use type safe memory macros.
	* tree-ssa-ccp.c (ccp_fold_builtin): Avoid using C++ keywords as
	variable names.
	* tree-ssa-coalesce.c (find_coalesce_pair): Use type safe memory macros.
	(add_cost_one_coalesce): Likewise.
	* tree-ssa-copy.c (merge_alias_info): Avoid using C++ keywords as
	variable names. Rename orig to orig_name for consistency.
	* tree-ssa-dom.c (dom_thread_across_edge): Cast according to the coding
	conventions.
	(cprop_into_successor_phis): Avoid using C++ keywords as variable names.
	(record_equivalences_from_stmt): Likewise.
	* tree-ssa-dse.c (dse_initialize_block_local_data): Cast according to
	the coding conventions.
	(memory_ssa_name_same): Likewise.
	(dse_optimize_stmt): Likewise.
	(dse_record_phis): Likewise.
	(dse_finalize_block): Likewise.
	* tree-ssa-loop-im.c (outermost_invariant_loop_expr): Avoid using C++
	keywords as variable names.
	(may_move_till): Cast according to the coding conventions.
	(force_move_till_expr): Avoid using C++ keywords as variable names.
	(force_move_till): Cast according to the coding conventions.
	(memref_hash): Likewise.
	(memref_eq): Likewise.
	(gather_mem_refs_stmt): Likewise.
	* tree-ssa-loop-ivopts.c (contains_abnormal_ssa_name_p): Avoid using C++
	keywords as variable names.
	(idx_find_step): Cast according to the coding conventions.
	(idx_record_use): Likewise.
	(find_depends): Likewise.
	(prepare_decl_rtl): Likewise.
	(mbc_entry_hash): Likewise.
	(mbc_entry_eq): Likewise.
	* tree-ssa-loop-niter.c (SWAP): Use the correct the type for tmp.
	(simplify_replace_tree): Avoid using C++ keywords as variable names.
	(idx_infer_loop_bounds): Cast according to the coding conventions.
	* tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise.
	* tree-ssa-math-opts.c (occ_new ): Likwise.
	* tree-ssanames.c (duplicate_ssa_name_ptr_info): Use type safe memory
	macros.
	* tree-ssa-operands.c (add_def_op): Avoid using C++ keywords as variable
	names.
	(add_use_op): Likewise.
	(add_vop): Likewise.
	(add_vuse_op): Likewise.
	(add_vdef_op): Likewise.
	(get_expr_operands): Likewise.
	(push_stmt_changes): Use type safe memory macros.
	* tree-ssa-phiopt.c (replace_phi_edge_with_variable): Avoid using C++
	keywords as variable names.
	(conditional_replacement): Likewise.
	(minmax_replacement): Likewise.
	(abs_replacement): Likewise.
	* tree-ssa-pre.c (create_expression_by_pieces): Cast according to the
	coding conventions.
	(insert_fake_stores): Avoid using C++ keywords as variable names.
	* tree-ssa-reassoc.c (add_to_ops_vec): Cast according to the coding
	conventions.
	* tree-ssa-structalias.c (heapvar_lookup): Likewise.
	(heapvar_insert): Use type safe memory macros.
	(new_var_info): Cast according to the coding conventions.
	(new_constraint): Likewise.
	(remove_preds_and_fake_succs): Use type safe memory macros.
	* tree-ssa-threadupdate.c (thread_block): Cast according to the coding
	conventions.
	(thread_single_edge): Likewise.

From-SVN: r125504
2007-06-06 20:18:47 +00:00
Revital Eres 8a8b05f463 Extend dse
From-SVN: r124651
2007-05-13 07:49:47 +00:00
Aldy Hernandez 0f84b06679 re PR tree-optimization/30375 (tree-ssa-dse incorrectly removes struct initialization)
PR tree-optimization/30375
        * tree-ssa-dse.c (dse_possible_dead_store_p): Do not eliminate if
        LHS of statements is not the same.
        * testsuite/gcc.dg/tree-ssa/ssa-dse-10.c: New.

From-SVN: r122758
2007-03-09 20:05:08 +00:00
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
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
Aldy Hernandez 444704336a * tree-ssa-dse.c (dse_optimize_stmt): Remove unused variable USE.
From-SVN: r113274
2006-04-26 10:29:02 +00:00
Jeff Law bfc646bfc0 re PR tree-optimization/26854 (Inordinate compile times on large routines)
PR tree-optimization/26854
	* tree-ssa-dse.c (dse_optimize_stmt): Avoid num_imm_uses when
	checking for zero or one use.
	* tree-ssa-dom.c (propagate_rhs_into_lhs): Similarly.
	* tree-cfgcleanup.c (merge_phi_nodes): Similarly.
	* tree-ssa-reassoc.c (negate_value): Similarly.
	(reassociate_bb): Similarly.

From-SVN: r113120
2006-04-20 10:13:12 -06: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
Jeff Law 736432eedb tree-cfg.c (bsi_replace): Rename final argument from PRESERVE_EH_INFO to UPDATE_EH_INFO.
* tree-cfg.c (bsi_replace): Rename final argument from
	PRESERVE_EH_INFO to UPDATE_EH_INFO.  Fix typo in last
	change (stmt -> orig_stmt).
	* tree-eh.c (verify_eh_throw_stmt_node): New function.
	(bsi_remove): Add new argument.  Remove EH information
	if requested.
	(verify_eh_throw_table_statements): New function.
	(bsi_remove): Add new argument REMOVE_EH_INFO.  All callers
	updated.
	* tree-optimize.c (execute_free_cfg_annotations): Verify
	the EH throw statement table after removing annotations.
	* except.h (verify_eh_throw_table_statements): Prototype.
	* tree-flow.h (bsi_remove): Update prototype.
	* tree-vrp.c (remove_range_assertions): Add new argument to
	bsi_remove call.
	* tree-ssa-loop-im.c (move_computations_stmt): Likewise.
	* tree-complex.c (expand_complex_div_wide): Likewise.
	* tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges): Likewise
	* tree-tailcall.c (eliminate_tailcall): Likewise.
	* tree-ssa-dse.c (dse_optimize_stmt): Likewise.
	* tree-ssa-loop-ivopts.c (remove_statement): Likewise.
	* tree-nrv.c (tree_nrv): Likewise.
	* tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Likewise.
	* tree-if-conv.c (tree_if_convert_cond_expr): Likewise.
	(combine_blocks): Likewise.
	* tree-ssa-phiopt.c (replace_phi_edge_with_variable): Likewise.
	* tree-cfgcleanup.c (cleanup_ctrl_expr_graph): Likewise.
	(cleanup_control_flow): Likewise.
	(remove_forwarder_block): Likewise.
	* tree-ssa-pre.c (remove_dead_inserted_code): Likewise.
	* tree-sra.c (sra_replace): Likewise.
	* tree-ssa-forwprop.c (forward_propagate_into_cond): Likewise.
	(forward_propagate_single_use_vars): Likewise.
	* tree-ssa-dce.c (remove_dead_stmt): Likewise.
	* tree-inline.c (expand_call_inline): Likewise.
	* tree-vect-transform.c (vect_transform_loop): Likewise.
	* tree-outof-ssa.c (rewrite_trees): Likewise.
	* tree-cfg.c (make_goto_expr_edges): Likewise.
	(cleanup_dead_labels): Likewise.
	(tree_merge_blocks, remove_bb, disband_implicit_edges): Likewise.
	(bsi_move_before, bsi_move_after): Likewise.
	(bsi_move_to_bb_end, try_redirect_by_replacing_jump): Likewise
	(tree_redirect_edge_and_branch, tree_split_block): Likewise.

From-SVN: r109421
2006-01-06 10:50:26 -07:00
Jeff Law 7d48c9e2cc tree-ssa-dse.c (dse_optimize_stmt): Correctly handle PHI nodes which represent a use and definition of the same...
* tree-ssa-dse.c (dse_optimize_stmt): Correctly handle PHI nodes which
	represent a use and definition of the same SSA_NAME.

	* gcc.dg/tree-ssa/ssa-dse-8.c: New test.

From-SVN: r108630
2005-12-16 00:03:12 -07:00
Daniel Jacobowitz 6c14b137a9 gcc/
* tree-ssa-dse.c (struct address_walk_data, memory_ssa_name_same)
	(memory_address_same): New.
	(dse_optimize_stmt): Call memory_address_same.
gcc/testsuite/
	* gcc.c-torture/execute/20051110-1.c,
	gcc.c-torture/execute/20051110-2.c: New tests.

From-SVN: r106807
2005-11-11 23:23:15 +00:00
Andrew Pinski 8d09949866 tree-ssa-dse.c (dse_optimize_stmt): Fix up all of V_MAY_DEF and V_MUST_DEF instead of just the first_use_p.
2005-09-12  Andrew Pinski  <pinskia@physics.uc.edu>

        * tree-ssa-dse.c (dse_optimize_stmt): Fix up all of V_MAY_DEF and
        V_MUST_DEF instead of just the first_use_p.
        Don't mark the virtual variables for renaming on the statement which
        is being removed.
        (pass_dse): Remove TODO_update_ssa.

From-SVN: r104172
2005-09-12 06:56:07 -07:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +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
Kazu Hirata ea497bb84c domwalk.c (walk_dominator_tree, [...]): Use VEC instead of VARRAY.
* domwalk.c (walk_dominator_tree, init_walk_dominator_tree,
	fini_walk_dominator_tree): Use VEC instead of VARRAY.
	* domwalk.h (dom_walk_data): Change the type of
	block_data_stack and free_block_data to VEC(void_p,heap)*.
	* tree-ssa-dse.c (dse_initialize_block_local_data,
	dse_optimize_stmt, dse_record_phis, dse_finalize_block): Use
	VEC instead of VARRAY.

From-SVN: r100281
2005-05-27 22:43:05 +00:00
Kazu Hirata 0fa2e4df47 c-common.c, [...]: Fix comment typos.
* c-common.c, c-parser.c, cfgbuild.c, cfghooks.c, cfghooks.h,
	cfgrtl.c, cgraphunit.c, ddg.c, expr.h, gcse.c, ggc-page.c,
	ggc-zone.c, gimplify.c, ipa-inline.c, longlong.h, targhooks.c,
	tree-flow-inline.h, tree-pass.h, tree-ssa-dse.c,
	tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c,
	tree-ssa-operands.c, tree-vect-analyze.c,
	tree-vect-transform.c, tree-vectorizer.c, tree.c,
	config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c,
	config/frv/frv.md, config/i386/i386.c, config/i386/sse.md,
	config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h,
	config/mcore/mcore.c, config/mips/mips.c, config/mips/mips.md,
	config/rs6000/darwin-ldouble.c, config/rs6000/rs6000.c,
	config/rs6000/rs6000.h, config/sh/sh.c, config/sh/sh.md,
	config/sh/ushmedia.h, config/sparc/sparc.c,
	config/sparc/sparc.md, config/stormy16/stormy-abi: Fix comment
	typos.  Follow spelling conventions.
	* doc/invoke.texi, doc/tm.texi, doc/tree-ssa.texi: Fix typos.
	Follow spelling conventions.

From-SVN: r100218
2005-05-26 18:15:27 +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
Jeff Law db30731aa4 tree-flow-inline.h (op_iter_next_must_and_may_def): New.
* tree-flow-inline.h (op_iter_next_must_and_may_def): New.
	(op_iter_init_must_and_may_def): Likewise.
	(unmodifiable_var_p): Move to a later point in the file.
	* tree-ssa-operands.h (FOR_EACH_SSA_MUST_AND_MAY_DEF_OPERAND): New.
	* tree-ssa-dse.c (need_imm_uses_for): Remove, no longer needed.
	(dse_record_phis): Directly check for virtual operands rather than
	using need_imm_uses_for.
	(dse_optimize_stmt): Handle V_MUST_DEF operands.  Handle case where
	store has multiple V_{MAY,MUST}_DEF operands.

From-SVN: r98780
2005-04-26 11:37:33 -06:00
Kazu Hirata 1e6a5d3c8f tree-flow-inline.h (get_stmt_operands): Remove.
* tree-flow-inline.h (get_stmt_operands): Remove.
	* lambda-code.c, tree-ssa-loop-unswitch.c,
	tree-ssa-operands.c, tree-ssa-pre.c, tree-ssa-propagate.c,
	tree-ssa-sink.c, tree-ssa.c, tree-tailcall.c,
	tree-vect-transform.c, tree-vectorizer.c, tree-vrp.c): Remove
	calls to get_stmt_operands.
	* doc/tree-ssa.texi: Don't mention get_stmt_operands.

From-SVN: r98262
2005-04-17 06:42:03 +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
Daniel Berlin 773168c774 tree-ssa-dse.c (dse_optimize_stmt): Fix incorrect comment.
2005-04-07  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-dse.c (dse_optimize_stmt): Fix incorrect comment.

From-SVN: r97793
2005-04-07 18:38:03 +00: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
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
Andrew Pinski 9df935d878 re PR tree-optimization/19768 (ICE: SSA_NAME_OCCURS_IN_ABNORMAL_PHI should be set)
2005-02-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/19768
        * g++.dg/opt/pr19768.C: New test.

2005-02-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/19768
        * tree-ssa-dse.c (fix_phi_uses): Update the occurs in abnormal
        phi flag if the phi is abnormal.

From-SVN: r94660
2005-02-03 07:26:29 -08:00
Kazu Hirata ad616de14c basic-block.h, [...]: Update copyright.
* basic-block.h, c-common.c, c-cppbuiltin.c, c-lang.c,
	c-tree.h, cfgbuild.c, cgraph.c, cgraph.h, collect2.c,
	combine.c, config.gcc, coverage.h, cse.c, cselib.c,
	defaults.h, df.c, dwarf2asm.c, dwarf2out.c, explow.c, expr.c,
	flow.c, fold-const.c, gcse.c, ggc-page.c, gimple-low.c,
	gimplify.c, ifcvt.c, langhooks-def.h, lcm.c, optabs.h,
	output.h, postreload-gcse.c, postreload.c, recog.c,
	resource.c, rtl.def, rtlanal.c, sched-deps.c, sched-rgn.c,
	targhooks.h, toplev.c, tree-data-ref.c, tree-eh.c,
	tree-flow.h, tree-loop-linear.c, tree-mudflap.h, tree-nrv.c,
	tree-optimize.c, tree-outof-ssa.c, tree-pass.h,
	tree-scalar-evolution.c, tree-ssa-copy.c, tree-ssa-dce.c,
	tree-ssa-dse.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c,
	tree-ssa-pre.c, tree-ssa.c, tree-vectorizer.c, tree.def,
	unwind-dw2-fde-darwin.c, var-tracking.c: Update copyright.

From-SVN: r93827
2005-01-18 11:36:31 +00:00
Steven Bosscher 1dff80c064 tree-ssa-dse.c (fix_phi_uses): Use SSA operand iterators.
* tree-ssa-dse.c (fix_phi_uses): Use SSA operand iterators.
	(fix_stmt_v_may_defs): Likewise.

From-SVN: r93614
2005-01-13 22:51:14 +00:00
Diego Novillo e79b60a72c [multiple changes]
2005-01-08  Jeff Law  <law@redhat.com>
	    Diego Novillo  <dnovillo@redhat.com>

	* tree-nrv.c (tree_nrv): Ignore volatile return values.
	* tree-ssa-dse.c (dse_optimize_stmt): Do not optimize
	statements with volatile operands.
	* tree-ssa-operands.c (add_stmt_operand): Do add volatile
	operands after marking a statement with has_volatile_ops.

testsuite/ChangeLog:

2005-01-08  Diego Novillo  <dnovillo@redhat.com>

	* gcc.dg/pr18241-1.c: New test.
	* gcc.dg/pr18241-2.c: New test.
	* gcc.dg/pr18241-3.c: New test.
	* gcc.dg/pr18241-4.c: New test.
	* gcc.dg/pr18241-5.c: New test.

From-SVN: r93088
2005-01-08 13:31:39 -05:00
Zdenek Dvorak 87c476a22c bitmap.h (EXECUTE_IF_SET_IN_BITMAP, [...]): Changed to iterator style.
* bitmap.h (EXECUTE_IF_SET_IN_BITMAP, EXECUTE_IF_AND_COMPL_IN_BITMAP,
	EXECUTE_IF_AND_IN_BITMAP): Changed to iterator style.
	(bitmap_iterator): New type.
	(bmp_iter_common_next_1, bmp_iter_single_next_1, bmp_iter_single_init,
	bmp_iter_end_p, bmp_iter_single_next, bmp_iter_and_not_next_1,
	bmp_iter_and_not_init, bmp_iter_and_not_next, bmp_iter_and_next_1,
	bmp_iter_and_init, bmp_iter_and_next): New functions.
	* basic-block.h (EXECUTE_IF_SET_IN_REG_SET,
	EXECUTE_IF_AND_COMPL_IN_REG_SET, EXECUTE_IF_AND_IN_REG_SET): Changed to
	use iterator-style EXECUTE_IF_IN_BITMAP macros.
	* bitmap.c (bitmap_print): Ditto.
	* bt-load.c (clear_btr_from_live_range, add_btr_to_live_range,
	btr_def_live_range): Ditto.
	* cfganal.c (compute_dominance_frontiers_1) Ditto.
	* cgraphunit.c (convert_UIDs_in_bitmap, cgraph_characterize_statics):
	Ditto.
	* ddg.c (build_inter_loop_deps): Ditto.
	* df.c (FOR_EACH_BB_IN_BITMAP, df_bb_reg_info_compute, df_refs_update):
	Ditto.
	* except.c (remove_eh_handler): Ditto.
	* flow.c (reg_set_to_hard_reg_set): Ditto.
	* gcse.c (clear_modify_mem_tables): Ditto.
	* global.c (build_insn_chain): Ditto.
	* ifcvt.c (dead_or_predicable): Ditto.
	* loop-invariant.c (get_inv_cost, set_move_mark, move_invariant_reg):
	Ditto.
	* ra-build.c (livethrough_conflicts_bb, conflicts_between_webs): Ditto.
	* ra-rewrite.c (reloads_to_loads, rewrite_program2,
	detect_web_parts_to_rebuild, delete_useless_defs, actual_spill): Ditto.
	* tree-cfg.c (allocate_ssa_names, tree_duplicate_sese_region,
	tree_purge_all_dead_eh_edges): Ditto.
	* tree-into-ssa.c (compute_global_livein, insert_phi_nodes,
	insert_phi_nodes_for, debug_def_blocks_r, invalidate_name_tags,
	rewrite_ssa_into_ssa): Ditto.
	* tree-outof-ssa.c (find_replaceable_exprs): Ditto.
	* tree-sra.c (scan_function, decide_instantiations, scalarize_parms):
	Ditto.
	* tree-ssa-alias.c (init_alias_info, compute_points_to_and_addr_escape,
	compute_flow_sensitive_aliasing, maybe_create_global_var,
	dump_points_to_info_for): Ditto.
	* tree-ssa-dce.c (EXECUTE_IF_CONTROL_DEPENDENT): Ditto.
	* tree-ssa-dse.c (dse_finalize_block): Ditto.
	* tree-ssa-live.c (live_worklist, calculate_live_on_entry,
	calculate_live_on_exit, build_tree_conflict_graph, dump_live_info):
	Ditto.
	* tree-ssa-loop-ivopts.c (find_induction_variables,
	find_interesting_uses, add_old_ivs_candidates, alloc_use_cost_map,
	determine_use_iv_costs, determine_set_costs, find_best_candidate,
	set_cost_up_to, create_new_ivs, remove_unused_ivs, free_loop_data):
	Ditto.
	* tree-ssa-loop-manip.c (add_exit_phis_var, add_exit_phis): Ditto.
	* tree-ssa-operands.c (get_asm_expr_operands, add_call_clobber_ops,
	add_call_read_ops): Ditto.
	* tree-ssa-pre.c (bitmap_print_value_set, insert_aux): Ditto.

From-SVN: r88145
2004-09-26 19:53:13 +00:00
Jeff Law a5c965c17e tree-dfa.c (free_df_for_stmt): No longer static.
* tree-dfa.c (free_df_for_stmt): No longer static.
	(free_df): Update comments.
	* tree-flow.h (free_df_for_stmt): Prototype.
	* tree-ssa-dse.c (dse_optimize_stmt): Call free_df_for_stmt.  Also
	call release_defs.

From-SVN: r87531
2004-09-14 22:12:18 -06:00
Zdenek Dvorak 30d396e3d5 tree-cfg.c (set_bb_for_stmt): Use PHI_BB.
* tree-cfg.c (set_bb_for_stmt): Use PHI_BB.
	* tree-dfa.c (compute_immediate_uses, add_immediate_use,
	redirect_immediate_use): Use PHI_DF.
	* tree-flow-inline.h (stmt_ann): Abort on phi nodes.
	(bb_for_stmt): Use PHI_BB.
	(get_immediate_uses): Use PHI_DF.
	* tree-ssa-dse.c (max_stmt_uid): New variable.
	(get_stmt_uid): New function.
	(dse_optimize_stmt, dse_record_phis, tree_ssa_dse): Do not use phi
	node annotations.
	* tree-ssa-loop-im.c (LIM_DATA): Do not use phi statement annotations.
	(max_uid): Renamed to max_stmt_uid.
	(get_stmt_uid): New function.
	(maybe_queue_var, single_reachable_address, determine_lsm): Do not use
	phi node annotations.
	* tree-ssa.c (replace_immediate_uses): Do not use phi node annotations.
	* tree.h (PHI_BB, PHI_DF): New accessor functions.
	(struct tree_phi_node): Add bb and df fields.

From-SVN: r87369
2004-09-11 20:42:06 +00:00
Giovanni Bajo 1e128c5f7b targhooks.c (default_unwind_emit, [...]): Use gcc_assert, gcc_unreachable & internal_error instead of abort.
* targhooks.c (default_unwind_emit, default_scalar_mode_supported_p):
	Use gcc_assert, gcc_unreachable & internal_error instead of abort.
	* timevar.c (timevar_push, timevar_pop, timevar_start,
	timevar_stop): Likewise.
	* toplev.c (default_pch_valid_p): Likewise.
	* tracer.c (tail_duplicate): Likewise.
	* tree-alias-common.c (get_alias_var_decl,
	get_values_from_constructor, create_alias_var, delete_alias_vars,
	empty_points_to_set, same_points_to_set, ptr_may_alias_var):
	Likewise.
	* tree.c (tree_size, make_node_stat, copy_node_stat,
	build_int_cst_wide, integer_all_onesp, list_length, chainon,
	tree_node_structure, type_contains_placeholder_p, substitute_in_expr,
	substitute_placeholder_in_expr, tabilize_reference_1, build0_stat,
	build1_stat, build2_stat, build3_stat, build4_stat, is_attribute_p,
	lookup_attribute, type_hash_canon, host_integerp, iterative_hash_expr,
	build_method_type_directly, decl_type_context, get_callee_fndecl,
	get_set_constructor_bits, build_vector_type_for_mode, int_cst_value,
	tree_fold_gcd): Likewise.
	* tree-cfg.c (create_bb, make_ctrl_stmt_edges, make_exit_edges,
	make_cond_expr_edges, group_case_labels, tree_merge_blocks,
	cleanup_control_expr_graph, find_taken_edge,
	find_taken_edge_switch_expr, phi_alternatives_equal,
	is_ctrl_altering_stmt, disband_implicit_edges, set_bb_for_stmt,
	stmt_for_bsi, tree_find_edge_insert_loc, bsi_insert_on_edge_immediate,
	tree_split_edge, tree_verify_flow_info, thread_jumps,
	tree_redirect_edge_and_branch, tree_flow_call_edges_add): Likewise.
	* tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly,
	chrec_fold_multiply_poly_poly): Likewise.
	* tree-complex.c (extract_component, expand_complex_division,
	expand_complex_comparison, expand_complex_operations_1,
	build_replicated_const, expand_vector_operations_1): Likewise.
	* tree-data-ref.c (tree_fold_bezout, build_classic_dist_vector,
	build_classic_dir_vector): Likewise.
	* tree-dfa.c (compute_immediate_uses_for_phi,
	compute_immediate_uses_for_stmt, create_var_ann, create_stmt_ann,
	create_tree_ann, collect_dfa_stats, get_virtual_var): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-eh.c (record_stmt_eh_region, add_stmt_to_eh_region,
	record_in_finally_tree, replace_goto_queue_1,
	maybe_record_in_goto_queue, verify_norecord_switch_expr,
	do_return_redirection): Likewise.
	* tree-if-conv.c (tree_if_convert_stmt, tree_if_convert_cond_expr,
	add_to_dst_predicate_list, find_phi_replacement_condition,
	replace_phi_with_cond_modify_expr, get_loop_body_in_if_conv_order):
	Likewise.
	* tree-inline.c (remap_decl, remap_type, remap_decls, copy_body_r,
	initialize_inlined_parameters, declare_return_variable,
	estimate_num_insns_1, expand_call_inline, expand_calls_inline,
	optimize_inline_calls, copy_tree_r): Likewise.
	* tree-into-ssa.c (rewrite_initialize_block_local_data, rewrite_stmt,
	ssa_rewrite_stmt, rewrite_into_ssa): Likewise.
	* tree-iterator.c (alloc_stmt_list, tsi_link_before, tsi_link_after,
	tsi_split_statement_list_after, tsi_split_statement_list_before):
	Likewise.
	* tree-mudflap.c (mf_varname_tree): Likewise.
	* tree-nested.c (create_tmp_var_for, lookup_field_for_decl,
	lookup_tramp_for_decl, convert_all_function_calls): Likewise.
	* tree-optimize.c (tree_rest_of_compilation): Likewise.
	* tree-outof-ssa.c (create_temp, eliminate_build, eliminate_phi,
	coalesce_abnormal_edges, coalesce_ssa_name, eliminate_virtual_phis,
	free_temp_expr_table, add_dependance, finish_expr, rewrite_trees):
	Likewise.
	* tree-phinodes.c (resize_phi_node, add_phi_arg,
	remove_all_phi_nodes_for): Likewise.
	* tree-pretty-print.c (op_prio, print_call_name): Likewise.
	* tree-profile.c (tree_gen_interval_profiler, tree_gen_pow2_profiler,
	tree_gen_one_value_profiler, tree_gen_const_delta_profiler): Likewise.
	* tree-sra.c (type_can_instantiate_all_elements, sra_hash_tree,
	sra_elt_eq, sra_walk_expr, instantiate_missing_elements,
	generate_one_element_ref, generate_element_copy,
	generate_element_zero, scalarize_copy, scalarize_init,
	scalarize_ldst): Likewise.
	* tree-ssa-alias.c (delete_alias_info, group_aliases, may_alias_p,
	add_may_alias, add_pointed_to_expr, add_pointed_to_var,
	collect_points_to_info_r, get_tmt_for, get_ptr_info): Likewise.
	* tree-ssa.c (walk_use_def_chains, check_phi_redundancy): Likewise.
	* tree-ssa-ccp.c (dump_lattice_value, get_default_value, get_value,
	set_lattice_value, likely_value, ccp_visit_phi_node, visit_assignment,
	widen_bitfield, ccp_fold_builtin): Likewise.
	* tree-ssa-copy.c (may_propagate_copy, merge_alias_info,
	replace_exp_1, propagate_tree_value): Likewise.
	* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise.
	* tree-ssa-dce.c (set_control_dependence_map_bit,
	find_control_dependence, find_pdom, mark_operand_necessary,
	mark_stmt_if_obviously_necessary,
	mark_control_dependent_edges_necessary, remove_dead_stmt): Likewise.
	* tree-ssa-dom.c (dom_opt_initialize_block_local_data,
	simplify_switch_and_lookup_avail_expr, cprop_into_successor_phis,
	eliminate_redundant_computations, avail_expr_eq): Likewise.
	* tree-ssa-dse.c (fix_stmt_v_may_defs): Likewise.
	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p,
	duplicate_blocks): Likewise.
	* tree-ssa-loop-im.c (for_each_index, set_level,
	is_call_clobbered_ref): Likewise.
	* tree-ssa-loop-ivopts.c (dump_use, divide, stmt_after_ip_normal_pos,
	stmt_after_increment, set_iv, contains_abnormal_ssa_name_p,
	find_interesting_uses_outer_or_nonlin, add_derived_ivs_candidates,
	peel_address, ptr_difference_cost, may_replace_final_value,
	determine_use_iv_cost, rewrite_use_nonlinear_expr, rewrite_use_outer,
	rewrite_use, rewrite_uses): Likewise.
	* tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa,
	check_loop_closed_ssa_use): Likewise.
	* tree-ssanames.c (make_ssa_name): Likewise.
	* tree-ssa-operands.c (finalize_ssa_defs, finalize_ssa_uses,
	finalize_ssa_v_must_defs, finalize_ssa_stmt_operands,
	get_stmt_operands, get_expr_operands, get_asm_expr_operands,
	get_indirect_ref_operands, add_stmt_operand): Likewise.
	* tree-ssa-pre.c (value_exists_in_set_bitmap,
	value_remove_from_set_bitmap, bitmap_insert_into_set, insert_into_set,
	phi_translate, valid_in_set, compute_antic,
	find_or_generate_expression, create_expression_by_pieces, insert_aux,
	create_value_expr_from, eliminate): Likewise.
	* tree-ssa-propagate.c (cfg_blocks_get): Likewise.
	* tree-ssa-threadupdate.c (remove_last_stmt_and_useless_edges):
	Likewise.
	* tree-tailcall.c (independent_of_stmt_p, adjust_return_value,
	eliminate_tail_call): Likewise.
	* tree-vectorizer.c (vect_create_index_for_array_ref,
	vect_align_data_ref, vect_create_data_ref,
	vect_create_destination_var, vect_get_vec_def_for_operand,
	vect_finish_stmt_generation, vect_transform_stmt,
	vect_transform_loop_bound, vect_transform_loop,
	vect_analyze_operations): Likewise.
	* tree-vn.c (vn_compute, set_value_handle, get_value_handle):
	Likewise.
	* tree-flow-inline.h (var_ann, get_var_ann, get_def_from_ptr,
	get_use_op_ptr, immediate_use, phi_ssa_name_p, bsi_start,
	bsi_after_labels, bsi_last): Likewise.
	* tree-ssa-live.c (var_union, change_partition_var,
	create_ssa_var_map, calculate_live_on_entry, root_var_init,
	type_var_init, add_coalesce, sort_coalesce_list, pop_best_coalesce):
	Likewise.
	* tree-ssa-live.h (partition_is_global, live_entry_blocks,
	tpa_find_tree): Likewise.
	(register_ssa_partition_check): Declare.
	(register_ssa_partition): use it.
	* tree-ssa-live.c: Include errors.h.
	(register_ssa_partition_check): New.
	* tree-ssa-operands.c: Include errors.h.
	* Makefile.in (tree-ssa-operands.o): Depend on errors.h.

Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>

From-SVN: r87223
2004-09-09 07:54:12 +00:00
Paolo Bonzini 9f8628bacd Unify the management of RTL and tree-level dump files.
2004-09-06  Paolo Bonzini  <bonzini@gnu.org>

	Unify the management of RTL and tree-level dump files.

	* cfgexpand.c (tree_expand_cfg): Fix incorrect comment.
	Don't print function name to the dump file, the pass manager
	would do this for us. Add code from the top of
	rest_of_compilation, up to the initial RTL dump.
	* passes.c (rest_of_handle_jump): Call fixup_tail_calls and
	close the DFI_sibling dump file.
	(rest_of_compilation): Don't do that here.  Remove code up to the
	initial RTL dump.
	(init_optimization_passes): Remove.
	(pass_rest_of_compilation): Change pass name to NULL.
	* toplev.c (lang_dependent_init): Do not use an empty dump file prefix.
	Do not call init_optimization_passes.
	* toplev.h (init_optimization_passes): Remove.

	* graph.c (print_rtl_graph_with_bb, clean_graph_dump_file,
	finish_graph_dump_file): Remove SUFFIX parameter.
	* graph.h (print_rtl_graph_with_bb, clean_graph_dump_file,
	finish_graph_dump_file): Likewise.

	* tree-pass.h (struct tree_opt_pass): Add `letter' field.
	* cfgexpand.c (pass_expand): Adjust.
	* gimple-low.c (pass_lower_cf, pass_remove_useless_vars): Adjust.
	* passes.c (pass_rest_of_compilation): Adjust.
	* predict.c (pass_profile): Adjust.
	* tree-alias-common.c (pass_build_pta, pass_del_pta): Adjust.
	* tree-cfg.c (pass_build_cfg, pass_remove_useless_stmts,
	pass_split_crit_edges, pass_warn_function_return): Adjust.
	* tree-complex.c (pass_lower_vector_ssa, pass_pre_expand): Adjust.
	* tree-dfa.c (pass_referenced_vars): Adjust.
	* tree-eh.c (pass_lower_eh): Adjust.
	* tree-if-conv.c (pass_build_ssa): Adjust.
	* tree-into-ssa.c (pass_build_ssa): Adjust.
	* tree-mudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust.
	* tree-nomudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust.
	* tree-nrv.c (pass_nrv): Adjust.
	* tree-optimize.c (pass_gimple, pass_all_optimizations,
	pass_cleanup_cfg_post_optimizing, pass_free_datastructures,
	pass_init_datastructures): Adjust.
	* tree-outof-ssa.c (pass_del_ssa): Adjust.
	* tree-profile.c (pass_tree_profile): Adjust.
	* tree-sra.c (pass_sra): Adjust.
	* tree-ssa-alias.c (pass_may_alias): Adjust.
	* tree-ssa-ccp.c (pass_ccp, pass_fold_builtins): Adjust.
	* tree-ssa-copyrename.c (pass_rename_ssa_copies): Adjust.
	* tree-ssa-dce.c (pass_dce, pass_cd_dce): Adjust.
	* tree-ssa-dom.c (pass_dominator): Adjust.
	* tree-ssa-dse.c (pass_dse): Adjust.
	* tree-ssa-forwprop.c (pass_forwprop): Adjust.
	* tree-ssa-if-conv.c (pass_if_conversion): Adjust.
	* tree-ssa-loop-ch.c (pass_ch): Adjust.
	* tree-ssa-loop.c (pass_loop, pass_loop_init, pass_lim,
	pass_loop_done, pass_complete_unroll, pass_iv_canon,
	pass_iv_optimize, pass_vectorize): Adjust.
	* tree-ssa-phiopt.c (pass_phiopt): Adjust.
	* tree-ssa-pre.c (pass_pre, pass_fre): Adjust.
	* tree-ssa.c (pass_redundant_phi, pass_early_warn_uninitialized,
	pass_late_warn_uninnitialized): Adjust.
	* tree-tailcall.c (pass_tail_recursion, pass_tail_calls): Adjust.

	* Makefile.in (tree-dump.o): Add new dependencies.
	* cgraph.c (cgraph_remove_node): TDF_all -> TDF_tree_all.
	* cgraphunit.c (cgraph_preserve_function_body_p, cgraph_optimize):
	Likewise.
	* toplev.c (dump_file_name): New.
	* tree-dump.c (dump_enable_all): Add LETTER parameter.
	(struct dump_file_info): Add NUM and LETTER fields.
	(dump_files): Adjust and add RTL dump files.
	(dump_register): Add NUM and LETTER fields.
	(get_dump_file_name, dump_initialized_p, enable_rtl_dump_file): New.
	(dump_begin): Use get_dump_file_name.
	(dump_switch_p_1): Adjust call to dump_enable_all.
	* tree-dump.h (dump_register): Adjust prototype.
	* tree-optimize.c (register_one_dump_file): Take dump file index.
	Support flags for RTL dumps.
	(register_dump_files): Fill in NUM field of struct dump_file_info.
	Track properties both when the gate is executed and when it is not.
	(execute_todo): Dump RTL.  Add PROPERTIES parameter.
	(execute_one_pass): Pass properties to execute_todo.  Handle VCG
	dumps of RTL.
	* tree-pass.h (dump_file_name): New.
	* tree.h (TDF_TREE, TDF_RTL, get_dump_file_name, dump_initialized_p):
	New.

	* Makefile.in (passes.o): Add new dependencies.
	* passes.c (struct dump_file_info, enum dump_file_index,
	dump_file_tbl, init_optimization_passes): Remove.
	(open_dump_file, close_dump_file): Use tree-dumping infrastructure.
	(rest_of_handle_new_regalloc, rest_of_handle_old_regalloc): Use
	dump_enabled_p.
	(finish_optimization_passes): Update finish_graph_dump_file loop.
	(enable_rtl_dump_file): Remove.
	* tree-dump.c (dump_files): Adjust and add RTL dump files.
	(enable_rtl_dump_file): Add here.
	* tree.h (enum tree_dump_index): Add RTL dump file indices.
	* doc/invoke.texi (Debugging options): Document new RTL debugging
	options.  Update.

From-SVN: r87113
2004-09-06 10:08:17 +00:00
Diego Novillo c1b763fa9a tree-optimize.c (init_tree_optimization_passes): Schedule pass_may_alias right after the program is renamed into SSA.
* tree-optimize.c (init_tree_optimization_passes): Schedule
	pass_may_alias right after the program is renamed into SSA.
	* tree-pass.h (PROP_alias): Define.
	* tree-outof-ssa.c (pass_del_ssa): Require PROP_alias.
	* tree-sra.c (pass_sra): Likewise.
	* tree-ssa-ccp.c (pass_ccp): Likewise.
	* tree-ssa-copyrename.c (pass_rename_ssa_ccp): Likewise.
	* tree-ssa-dce.c (pass_dce): Likewise.
	* tree-ssa-dom.c (pass_dominator): Likewise.
	* tree-ssa-dse.c (pass_dse): Likewise.
	* tree-ssa-forwprop.c (pass_forwprop): Likewise.
	* tree-ssa-loop-ch.c (pass_ch): Likewise.
	* tree-ssa-phiopt.c (pass_phiopt): Likewise.
	* tree-ssa-pre.c (pass_pre): Likewise.
	* tree-tailcall.c (pass_tail_recursion): Likewise.
	* tree-ssa.c (pass_redundant_phi): Likewise.
	* tree-ssa-alias.c (aliases_computed_p): Remove.
	Update all users.
	(init_alias_info): Do not mark all type tags for renaming
	unconditionally.
	Clear may_aliases from every symbol.
	(setup_pointers_and_addressables): If a pointer has not been
	dereferenced and it had a type tag, clear it and mark the old
	tag for renaming.


testsuite/ChangeLog

	* gcc.dg/tree-ssa/20030714-2.c: Adjust number of expected
	conditionals.
	* gcc.dg/tree-ssa/20031022-1.c: Adjust number of expected
	loads.
	* gcc.dg/tree-ssa/ssa-dom-cse-1.c: Expect optimization in
	DOM1.

From-SVN: r85255
2004-07-28 01:13:10 -04:00
Richard Henderson cd7097527e tree-cfg.c (make_exit_edges): Use get_call_expr_in.
* tree-cfg.c (make_exit_edges): Use get_call_expr_in.
        (remove_useless_stmts_1, is_ctrl_altering_stmt): Likewise.
        (tree_block_ends_with_call_p, need_fake_edge_p): Likewise.
        * tree-eh.c (lower_eh_constructs_1): Likewise.
        * tree-sra.c (sra_walk_modify_expr): Likewise.
        * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
        (eliminate_unnecessary_stmts): Likewise.
        * tree-ssa-dse.c (dse_optimize_stmt): Likewise.
        * tree-tailcall.c (optimize_tail_call): Likewise.
        * tree-ssa-ccp.c (get_rhs, set_rhs): Reorg to use switch.

From-SVN: r84298
2004-07-08 09:16:41 -07:00
Kazu Hirata 61ada8ae18 c-typeck.c, [...]: Fix comment typos.
* c-typeck.c, cfgexpand.c, ddg.c, ddg.h, df.c, fold-const.c,
	gcov.c, gimplify.c, modulo-sched.c, passes.c, tree-cfg.c,
	tree-mudflap.c, tree-nrv.c, tree-outof-ssa.c, tree-ssa-dom.c,
	tree-ssa-dse.c, tree-ssa-operands.c, tree-ssa-pre.c,
	tree-tailcall.c: Fix comment typos.  Follow spelling
	conventions.

From-SVN: r83703
2004-06-26 05:03:55 +00:00
Andrew MacLeod d00ad49ba1 tree-cfg.c (tree_make_forwarder_block): Use SET_PHI_RESULT.
2004-06-16  Andrew MacLeod  <amacleod@redhat.com>

	* tree-cfg.c (tree_make_forwarder_block):  Use SET_PHI_RESULT.
	* tree-flow-inline.h (get_use_op_ptr):  Return a use_operand_p.
	(get_use_from_ptr, get_def_from_ptr):  New.  Return operand pointers.
	(get_def_op_ptr):  Return a def_operand_p instead of a 'tree *'.
	(get_v_may_def_result_ptr):  Return a def_operand_p.
	(get_v_may_def_op_ptr, get_vuse_op_ptr):   Return a use_operand_p.
	(get_v_must_def_op_ptr):  Return a def_operand_p.
	(get_phi_result_ptr):  New.  Return a pointer to the result of a PHI.
	(get_phi_arg_def_ptr):  New.  Return a pointer to an argument of a PHI.
	(phi_element_for_edge):  Remove.
	* tree-flow.h (propagate_value, replace_exp):  Change prototype.
	(propagate_tree_value):  Add new prototype.
	(phi_element_for_edge):  Remove prototype.
	* tree-into-ssa.c (mark_def_sites):  Use new operand types.
	(prepare_operand_for_rename):  Split into two functions.
	(prepare_use_operand_for_rename):  Prepare use operands.
	(prepare_def_operand_for_rename):  Prepare def operands.
	(rewrite_stmt):  Use new operand types.
	(rewrite_operand):  Use new operand types, change parameter type.
	* tree-outof-ssa.c (replace_variable):  Split into two functions.
	(replace_use_variable):  Rewrite uses.
	(replace_def_variable):  Rewrite defs.
	(rewrite_trees, rewrite_vars_out_of_ssa):  Use new operand types.
	* tree-phinodes.c (make_phi_node, resize_phi_node):  Use new types.
	(add_phi_arg, remove_phi_arg_num):  Use new operand types.
	* tree-ssa-ccp.c (substitute_and_fold):  Use new operand types.
	(ccp_fold, replace_uses_in):  Use new operand types.
	* tree-ssa-copy.c (replace_ssa_names):  Rename to replace_ssa_names_ann
	and no longer set the value, change parameter type.
	(replace_exp_1):  Use new operand types.
	(propagate_value):  Change parameter type, use new operand types.
	(propagate_tree_value):  Propagate_value without SSA operands.
	(replace_exp, cprop_operand, cprop_into_stmt):  Use new operand types.
	(cprop_into_successor_phis):  Use new operand types.
	* tree-ssa-dom.c (thread_across_edge):  Use new operand types.
	(eliminate_redundant_computations):  Use new operand types.
	* tree-ssa-dse.c (fix_phi_uses):  Use new operand_types.
	(fix_stmt_v_may_defs):  Use new operand_types.
	* tree-ssa-live.c (create_ssa_var_map):  Use new operand_types.
	(build_tree_conflict_graph):  Use new operand_types.
	* tree-ssa-loop.c (duplicate_blocks):  Use PHI_ARG_DEF_FROM_EDGE.
	* tree-ssa-operands.c (struct freelist_d):  Remove.
	(check_optype_freelist, add_optype_freelist):  Remove.
	(allocate_def_optype, allocate_use_optype, allocate_v_may_def_optype,
	allocate_vuse_optype, allocate_v_must_def_optype):  Call ggc_alloc.
	(free_uses, free_defs, free_vuses, free_v_may_defs, free_v_must_defs):
	Call ggc_free instead of add_optype_freelist.
	(init_ssa_operands, fini_ssa_operands):  Remove free list code.
	(finalize_ssa_defs, finalize_ssa_uses):  Set new use/def operands.
	* tree-ssa-operands.h (struct def_optype_d):  Change underlying type.
	(struct use_optype_d):  Change underlying type.
	(def_operand_p, use_operand_p):  New types for pointers to operands.
	(USE_OP, DEF_OP, V_MAY_DEF_RESULT, V_MAY_DEF_OP, VUSE_OP,
	V_MUST_DEF_OP):  Use new pointer type instead of dereferencing directly.
	(USE_FROM_PTR, DEF_FROM_PTR):  New macros to "dereference" operand
	pointer types.
	(SET_USE, SET_DEF):  New macros to set operands from their pointer.
	(SET_USE_OP, SET_DEF_OP, SET_V_MAY_DEF_RESULT, SET_V_MAY_DEF_OP,
	SET_VUSE_OP, SET_V_MUST_DEF_OP): New SET routines for operands.
	(PHI_RESULT_PTR, PHI_RESULT, SET_PHI_RESULT):  Macros to manage the
	PHI result as an operand.
	(PHI_ARG_DEF_PTR, PHI_ARG_DEF, SET_PHI_ARG_DEF, PHI_ARG_DEF_FROM_EDGE,
	PHI_ARG_DEF_PTR_FROM_EDGE):  Macros to manage the PHI arguments.
	* tree-ssa-pre.c (eliminate):  Call propagate_tree_value.
	* tree-tailcall.c (independent_of_stmt_p, propagate_through_phis):  Use
	PHI_ARG_DEF_FROM_EDGE.
	* tree.h (PHI_RESULT):  Renamed to PHI_RESULT_TREE.
	(PHI_ARG_DEF):  Renamed to PHI_ARG_DEF_TREE.

From-SVN: r83298
2004-06-17 18:13:20 +00:00
Steven Bosscher 1719288464 tree.h (PHI_CHAIN): New.
* tree.h (PHI_CHAIN): New.
	* (tree-cfg.c, tree-dfa.c, tree-flow-inline.h, tree-into-ssa.c,
	tree-outof-ssa.c, tree-phinodes.c, tree-pretty-print.c,
	tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-dom.c, tree-ssa-dse.c,
	tree-ssa-live.c, tree-ssa-loop.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
	tree-ssa.c, tree-tailcall.c): Use PHI_CHAIN instead of TREE_CHAIN
	when traversing a list of PHI_NODEs.

From-SVN: r83273
2004-06-16 23:03:34 +00:00
Brian Booth a32b97a20d tree-ssa.texi: Remove references to VDEF and add descriptions of V_MAY_DEF and V_MUST_DEF.
* doc/tree-ssa.texi: Remove references to VDEF and add descriptions
	of V_MAY_DEF and V_MUST_DEF.
	* tree-dfa.c (dfa_stats_d): Add num_v_must_defs and rename
	num_vdefs to num_v_may_defs.
	(compute_immediate_uses_for_stmt): Rename occurences of vdef
	to v_may_def.
	(redirect_immediate_uses): Ditto.
	(dump_dfa_stats): Ditto. Also added code to dump num_v_must_defs.
	(collect_dfa_stats_r): Rename occurences of vdef to v_may_def.
	Also add code to sum up the number of v_must_defs.
	(vdefs_disappeared_p): Replace with...
	(v_may_defs_disappeared_p): This.
	(v_must_defs_disappeared_p): New function.
	(mark_new_vars_to_rename): Rename occurences of vdef to v_may_def.
	Also add code to mark new variables found in V_MUST_DEFs for
	renameing.
	* tree-flow.h (stmt_ann_d): Add v_must_def_ops and replace
	vdef_ops to v_may_def_ops.
	(get_vdef_ops): Replace with...
	(get_v_may_def_ops): This.
	* tree-flow-inline.h (get_vdef_ops): Replace with...
	(get_v_may_def_ops): This.
	(get_v_must_def_ops): New function.
	(get_vdef_result_ptr): Replace with...
	(get_v_may_def_result_ptr): This.
	(get_vdef_op_ptr): Ditto with...
	(get_v_may_def_op_ptr); This.
	(get_v_must_def_op_ptr): New function.
	* tree-into-ssa.c (mark_def_sites): Rename occurences of vdef
	to v_may_def. Also add code to mark statements with
	V_MUST_DEFs as definition sites.
	(rewrite_stmt): Rename occurences of vdef to v_may_def. Also
	add code to register new V_MUST_DEFs made by the statement.
	* tree-outof-ssa.c (VIRTUAL_PARTITION): Update comments.
	(check_replaceable): Rename occurences of vdef to v_may_def. Also
	add check for V_MUST_DEFs.
	(find_replaceable_in_bb): Ditto.
	* tree-pretty-print.c (dump_vops): Rename occurences of vdef
	to v_may_def. Also add code to dump V_MUST_DEFs.
	* tree-sra.c (mark_all_vdefs): Replace with...
	(mark_all_v_may_defs): This.
	(mark_all_v_must_defs): New function.
	(create_scalar_copies): Replace call to mark_all_vdefs with
	calls to mark_all_v_may_defs and mark_all_v_must_defs.
	(scalarize_structures): Rename occurences of vdef to v_may_def.
	Also add a check for V_MUST_DEFs.
	(scalarize_modify_expr): Rename occurences of vdef to v_may_def.
	* tree-ssa-alias.c (global_var): Update comment.
	(compute_may_aliases): Ditto.
	(compute_points_to_and_addr_escape): Rename occurences of vdef
	to v_may_def. Also add code to mark variables in V_MUST_DEF
	operands as being written to.
	(group_aliases): Update comment.
	(maybe_create_global_var): Ditto.
	* tree-ssa.c (verify_ssa): Rename occurences of vdef to v_may_def.
	Also add a check for V_MUST_DEFs on GIMPLE registers.
	(replace_immediate_uses): Rename occurences of vdef to v_may_def.
	* tree-ssa-ccp.c (visit_stmt): Rename occurences of vdef
	to v_may_def. Also add code to mark all V_MUST_DEF operands
	VARYING.
	(initialize): Ditto.
	(set_rhs): Rename occurences of vdef to v_may_def. Also add
	code to update SSA_NAMEs in V_MUST_DEFs.
	* tree-ssa-copy.c (cprop_into_stmt): Rename occurences of vdef
	to v_may_def.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Rename
	occurences of vdef to v_may_def. Also add code to mark statements
	with V_MUST_DEFs as necessary.
	(propagate_necessity): Rename occurences of vdef to v_may_def.
	* tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Rename
	occurences of vdef to v_may_def. Also add code to mark operands
	in V_MUST_DEFs for renaming.
	(eliminate_redundant_computations): Rename occurences of vdef
	to v_may_def.
	(record_equivalences_from_stmt): Rename occurences of vdef
	to v_may_def. Also add code to record VUSEs for V_MUST_DEFs.
	(optimize_stmt): Remove unnesessary variable vdefs. Update
	comment.
	(register_definitions_for_stmt): Rename occurences of vdef
	to v_may_def. Also add code to register definitions made with
	V_MUST_DEFs.
	* tree-ssa-dse.c (fix_stmt_vdefs): Replace with...
	(fix_stmt_v_may_defs): This.
	(fix_phi_uses): Rename occurences of vdef to v_may_def.
	(dse_optimize_stmt): Ditto.
	* tree-ssa-live.c (create_ssa_var_map): Rename occurences of vdef
	to v_may_def. Also add code to mark V_MUST_DEF operands as being
	used in virtual operators.
	* tree-ssa-loop.c (mark_defs_for_rewrite): Rename occurences of
	vdef to v_may_def. Also add code to mark V_MUST_DEF operands for
	renaming.
	* tree-ssa-operands.c (opf_kill_def): New flag for killing
	definitions.
	(build_vdefs): Renamed to...
	(build_v_may_defs): This.
	(build_v_must_defs): New variable.
	(voperands_d): Add v_must_def_ops and replace vdef_ops with
	v_may_def_ops.
	(append_vdef): Replace with...
	(append_v_may_def): This.
	(append_v_must_def): New function.
	(NUM_FREE): Increment for V_MUST_DEF
	(optype_freelist): Increment its size for V_MUST_DEF
	(allocate_vdef_optype): Replace with...
	(allocate_v_may_def_optype): This.
	(allocate_v_must_def_optype): New function.
	(free_vdefs): Replace with...
	(free_v_may_defs): This.
	(free_v_must_defs): New function.
	(remove_vdefs): Replace with...
	(remove_v_may_defs): This.
	(remove_v_must_defs): New function.
	(init_ssa_operands): Rename occurences of vdef to v_may_def. Also
	add code to initialize build_v_must_defs.
	(finalize_ssa_vdefs): Replace with...
	(finalize_ssa_v_may_defs): This.
	(finalize_ssa_vuses): Rename occurences of vdef to v_may_def.
	(finalize_ssa_v_must_defs): New function.
	(finalize_ssa_stmt_operands): Replace call to finalize_ssa_vdefs
	with calls to finalize_ssa_v_may_defs and finalize_ssa_v_must_defs.
	(verify_start_operands): Rename occurences of vdef to v_may_def.
	Also add check for build_v_must_defs.
	(get_stmt_operands): Rename occurences of vdef to v_may_def.
	Also add code to handle V_MUST_DEFs and to use opf_kill_def for
	killing definitions.
	(get_expr_operands): Update comment and use opf_kill_def for
	killing definitions.
	(add_stmt_operand): Replace code that appends VDEFs with code
	that appends V_MUST_DEFs when opf_kill_def is set and V_MAY_DEFs
	otherwise.
	(add_call_clobber_ops): Update comments.
	* tree-ssa-operands.h (vdef_optype_d): Replace with...
	(v_may_def_optype_d): This.
	(v_must_def_optype_d): New structure.
	(VDEF_OPS): Replace with...
	(V_MAY_DEF_OPS): This.
	(STMT_VDEF_OPS): Same with...
	(STMT_V_MAY_DEF_OPS): This.
	(NUM_VDEFS): And...
	(NUM_V_MAY_DEFS): This.
	(VDEF_RESULT_PTR): As well as...
	(V_MAY_DEF_RESULT_PTR): This.
	(VDEF_RESULT): Same goes for...
	(V_MAY_DEF_RESULT): This.
	(VDEF_OP_PTR): And...
	(V_MAY_DEF_OP_PTR): This.
	(VDEF_OP): And...
	(V_MAY_DEF_OP): This.
	(V_MUST_DEF_OPS): New macro.
	(STMT_V_MUST_DEF_OPS): Ditto.
	(NUM_V_MUST_DEFS): Ditto.
	(V_MUST_DEF_OP_PTR): Ditto.
	(V_MUST_DEF_OP): Ditto.
	(remove_vdefs): Replace signature with...
	(remove_v_may_defs): This.
	(remove_v_must_defs): New function signature.
	* tree-ssa-pre.c (subst_phis): Replace call to remove_vdefs
	with calls to remove_v_may_defs and remove_v_must_defs.
	(process_left_occs_and_kills): Rename occurences of vdef to v_may_def.
	Also add code that marks left occurences of operands in V_MUST_DEFs.
	* tree-tailcall.c (find_tail_calls): Rename occurences of vdef
	to v_may_def. Also add check for V_MUST_DEFs.
	(eliminate_tail_call):Rename occurences of vdef to v_may_def.

testsuite:

	* gcc.dg/tree-ssa/20031015-1.c: Scan for
	V_MAY_DEF instead of VDEF.
	* gcc.dg/tree-ssa/20040517-1.c: Ditto.

From-SVN: r82947
2004-06-10 21:41:08 +00:00
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00