Commit Graph

146 Commits

Author SHA1 Message Date
Marcin Dalecki bc4632d404 tree-ssa-dom.c (dom_thread_across_edge): fix tag expression construction.
2006-02-15  Marcin Dalecki <martin@dalecki.de>

	* tree-ssa-dom.c (dom_thread_across_edge): fix tag expression
	construction.

From-SVN: r111019
2006-02-15 08:58:22 +01:00
Jeff Law 2090d6a0a8 tree-vrp.c (find_conditional_asserts): Update comments.
2006-02-07  Jeff Law  <law@redhat.com>

	* tree-vrp.c (find_conditional_asserts): Update comments.
	(simplify_stmt_for_jump_threading): New.
	(identify_jump_threads, finalize_jump_threads): New.
	(vrp_finalize): Call identify_jump_threads.
	(execute_vrp): Call finalize_jump_threads.
	* tree-ssa-dom.c (struct opt_stats_d): Remove num_iterations field.
	(vrp_element, vrp_data, vrp_element_p): Remove.
	(vrp_hash_elt, vrp_variables_stack): Remove.
	(vrp_hash, vrp_eq, record_range): Remove.
	(simplify_cond_and_lookup_avail_expr): Remove.
	(extract_range_from_cond): Remove.
	(thread_across_edge): Relocated into tree-ssa-threadedge.c.
	(simplify_stmt_for_jump_threading): New.
	(dom_thread_across_edge): New wrapper.
	(tree_ssa_dominator_optimize): No longer initialize or
	finalize any of the VRP datastructures.  Remove iteration
	step and simplify as a result of removal of iteration step.
	(pass_dominator): Perform a cfg cleanup after DOM.
	(dom_opt_finalize_block): Use the new common routines
	for threading jumps.  Simplify stack management slightly.
	No longer need to unwind VRP state.
	(record_equivalences_from_incoming_edge): No longer record
	VRP information.
	(eliminate_redundant_computations): No longer call
	simplify_cond_and_lookup_avail_expr.
	* tree-flow.h (potentially_threadable_block): Prototype.
	(thread_across_edge): Likewise.
	* Makefile.in (OBJS-common):  Add tree-ssa-threadedge.o
	(tree-ssa-threadedge.o): Add dependencies.
	* tree-ssa-threadedge.c: New file.
	* passes.c (init_optimization_passes): Merge PHIs before
	calling VRP.  Run VRP again late in the SSA optimization pipeline.


	* gcc.dg/tree-ssa/vrp01.c: Update dumpfile names now that we have
	multiple VRP passes.
	* gcc.dg/tree-ssa/vrp09.c: Likewise.
	* gcc.dg/tree-ssa/vrp18.c: Likewise.
	* gcc.dg/tree-ssa/pr21582.c: Likewise.
	* gcc.dg/tree-ssa/pr20657.c: Likewise.
	* gcc.dg/tree-ssa/pr21001.c: Likewise.
	* gcc.dg/tree-ssa/vrp02.c: Likewise
	* gcc.dg/tree-ssa/vrp11.c: Likewise
	* gcc.dg/tree-ssa/pr14341.c: Likewise
	* gcc.dg/tree-ssa/vrp19.c: Likewise
	* gcc.dg/tree-ssa/vrp20.c: Likewise
	* gcc.dg/tree-ssa/vrp03.c: Likewise
	* gcc.dg/tree-ssa/pr21086.c: Likewise
	* gcc.dg/tree-ssa/pr21959.c: Likewise
	* gcc.dg/tree-ssa/vrp21.c: Likewise
	* gcc.dg/tree-ssa/vrp04.c: Likewise 
	* gcc.dg/tree-ssa/pr25485.c: Likewise
	* gcc.dg/tree-ssa/pr22026.c: Likewise
	* gcc.dg/tree-ssa/vrp22.c: Likewise
	* gcc.dg/tree-ssa/vrp05.c: Likewise
	* gcc.dg/tree-ssa/20030807-10.c: Likewise
	* gcc.dg/tree-ssa/pr20701.c: Likewise
	* gcc.dg/tree-ssa/vrp23.c: Likewise
	* gcc.dg/tree-ssa/vrp06.c: Likewise
	* gcc.dg/tree-ssa/pr22117.c: Likewise
	* gcc.dg/tree-ssa/pr20702.c: Likewise
	* gcc.dg/tree-ssa/vrp15.c: Likewise
	* gcc.dg/tree-ssa/pr21090.c: Likewise
	* gcc.dg/tree-ssa/pr21294.c: Likewise
	* gcc.dg/tree-ssa/vrp24.c: Likewise
	* gcc.dg/tree-ssa/vrp07.c: Likewise
	* gcc.dg/tree-ssa/pr21563.c: Likewise
	* gcc.dg/tree-ssa/pr25382.c: Likewise
	* gcc.dg/tree-ssa/vrp16.c: Likewise
	* gcc.dg/tree-ssa/vrp25.c: Likewise
	* gcc.dg/tree-ssa/vrp08.c: Likewise
	* gcc.dg/tree-ssa/20030807-6.c: Likewise
	* gcc.dg/tree-ssa/vrp17.c: Likewise
	* gcc.dg/tree-ssa/pr21458.c: Likewise
	* g++.dg/tree-ssa/pr18178.C: Likewise

From-SVN: r110705
2006-02-07 11:31:27 -07:00
Jeff Law 8702a557ab tree-ssa-threadupdate.c (threaded_edges): New VEC to hold edge pairs.
* tree-ssa-threadupdate.c (threaded_edges): New VEC to
	hold edge pairs.
	(mark_threaded_blocks, register_jump_thread): New functions.
	(thread_through_all_blocks): Remove unwanted argument.  No
	longer rely on e->aux to communicate thread target info.
	Call mark_threaded_blocks.  Release the threaded_blocks
	bitmap and threaded_edges vector when complete.
	* tree-ssa-dom.c (struct edge_info): Remove redirection_target field.
	(threaded_blocks): Remove.
	(tree_ssa_dominator_optimize): Remove initialization and
	finalization of threaded_blocks.  Simplify call to
	thread_through_all_blocks.
	(thread_across_edge): Call register_jump_thread rather than
	storing thread information into e->aux.
	(free_all_edge_infos): Simplify now that e->aux is no longer
	used to communicate with thread_through_all_blocks.
	* tree-flow.h (thread_through_all_blocks): Update prototype.
	(register_jump_thread): Prototype.

From-SVN: r109602
2006-01-11 13:39:42 -07:00
Jeff Law 487bf3e670 tree-ssa-dom.c (simplify_cond_and_lookup_avail_expr): Remove code to propagate the RHS of a cast into COND_EXPR_COND.
* tree-ssa-dom.c (simplify_cond_and_lookup_avail_expr): Remove
        code to propagate the RHS of a cast into COND_EXPR_COND.  Remove
        now unused arguments.  Callers updated.
        (eliminate_redundant_computations): Remove now unused arguments,
        callers updated.
        (local_fold): Remove, no longer used.
        (find_equivalent_equality_comparison): Removed from tree-ssa-dom.c
        and moved to...
        * tree-ssa-forwprop.c (find_equivalent_equality_comparison): Here.
        (simplify_cond): New function.
        (forward_propagate_into_cond): Call simplify_cond.

From-SVN: r109502
2006-01-09 09:56:49 -07:00
Jeff Law ea65cd378b tree-ssa-dom.c (thread_across_edge): Do not use local_fold.
* tree-ssa-dom.c (thread_across_edge): Do not use local_fold.
	Strip away all type conversions after simplifying the
	condition.

        * tree-cfgcleanup.c (merge_phi_nodes): Allow merging in some
        cases the forwarder block dominates the destination.

From-SVN: r108833
2005-12-19 21:08:01 -07:00
Zdenek Dvorak ff88c5aa41 tree-flow.h (struct stmt_ann_d): Remove makes_aliased_loads and makes_aliased_stores fields.
* tree-flow.h (struct stmt_ann_d): Remove
	makes_aliased_loads and makes_aliased_stores fields.
	* tree-ssa-ccp.c (likely_value): Do not use makes_aliased_stores
	and makes_aliased_loads fields.
	* tree-ssa-dom.c (eliminate_redundant_computations): Do not
	use makes_aliased_stores.
	* tree-ssa-operands.c (clobbered_aliased_loads,
	clobbered_aliased_stores, ro_call_aliased_loads): Removed.
	(build_ssa_operands, add_stmt_operand, add_call_clobber_ops,
	add_call_read_ops): Do not set makes_aliased_stores and
	makes_aliased_loads fields.
	* tree-ssa.c (verify_ssa): Do not verify makes_aliased_stores
	field.

From-SVN: r108766
2005-12-19 00:12:14 +00:00
Gabriel Dos Reis e1111e8ebe tree-tailcall.c (find_tail_calls): Use XNEW.
* tree-tailcall.c (find_tail_calls): Use XNEW.
        * tree-ssa-dom.c (allocate_edge_info): Use XCNEW.
        (free_all_edge_infos): Use explicit cast to convert from void
        * *.
        (vrp_free): Likewise.
        (dom_opt_finalize_block): Likewise.
        (record_equivalences_from_incoming_edge): Likewise.
        (thread_across_edge): Likewise.  Use XCNEWVEC.
        (record_cond): Use XCNEW.
        (record_conditions): Use XNEWVEC.
        (record_edge_info): Use XCNEWVEC.
        (lookup_avail_expr): Use XNEW.
        (record_range): Likewise.  Use GGC_NEW.
        * tree-nested.c (var_map_hash): Use explicit cast to convert
        * from
        void *.
        (var_map_eq): Likewise.
        (lookup_field_for_decl): Likewise.
        (convert_nonlocal_reference): Likewise.
        (convert_local_reference): Likewise.
        (convert_nl_goto_reference): Likewise.
        (convert_nl_goto_receiver): Likewise.
        (convert_call_expr): Likewise.
        (convert_tramp_reference): Likewise.
        (lookup_tramp_for_decl): Likewise.Use GGC_NEW.
        (convert_nl_goto_reference): Likewise.
        (lookup_field_for_decl): Use GGC_NEW.
        (create_nesting_tree): Use GGC_CNEW.
        * tree-ssa-phiopt.c (blocks_in_phiopt_order): Use XNEWVEC.
        * tree-ssa-alias.c (init_alias_info): Use XCNEW.
        (create_alias_map_for): Likewise.
        (setup_pointers_and_addressables): Use XCNEWVEC.
        (get_ptr_info): Use GGC_NEW.
        (used_part_map_eq): Use explicit cast to convert from void *.
        (up_lookup): Likewise.
        (up_insert): Use XNEW.
        (get_or_create_used_part_for): Use XCNEW.
        (get_tmt_for): Likewise.
        * tree-ssa-operands.c (ssa_operand_alloc): Use GGC_NEW.
        * tree-ssa-pre.c (phi_trans_add): Use XNEW.
        (bitmap_set_new): Use explicit cast to convert from void *.
        (set_new): Likewise.
        (insert_into_set): Likewise.
        (pool_copy_list): Likewise.
        (phi_translate): Likewise.
        (create_value_expr_from): Likewise.
        (insert_aux): Use XCNEWVEC.
        (compute_avail): Use XNEWVEC.
        * tree-ssa-live.c (calculate_live_on_entry): Likewise.
        (sort_coalesce_list): Likewise.
        (build_tree_conflict_graph): Use XCNEWVEC.
        * tree-ssa-dce.c (tree_dce_init): Use XNEWVEC.
        * tree-ssa-copy.c (init_copy_prop): Likewise.
        (fini_copy_prop): Likewise.
        * tree-ssa-uncprop.c (associate_equivalences_with_edges): Use
        * XNEW
        and XCNEWVEC.
        (record_equiv): Use XNEW.
        (uncprop_into_successor_phis): Use explicit cast to convert
        * from
        void *.
        (uncprop_initialize_block): Likewise.

From-SVN: r108747
2005-12-18 09:26:53 +00:00
Jeff Law 6b62dff819 tree-ssa-dom.c (simplify_switch_and_lookup_avail_expr): Code to simplify SWITCH_EXPR_CODE moved from here to ...
* tree-ssa-dom.c (simplify_switch_and_lookup_avail_expr): Code
	to simplify SWITCH_EXPR_CODE moved from here to ...
	* tree-ssa-forwprop.c (simplify_switch_expr): Here.
	(tree-ssa-forward_propagate_single_use_vars): Call
	simplify_switch_expr when appropriate.

From-SVN: r108738
2005-12-18 00:23:08 -07:00
Jeff Law 471eeb830d tree-ssa-dom.c (update_rhs_and_lookup_avail_expr): Kill.
* tree-ssa-dom.c (update_rhs_and_lookup_avail_expr): Kill.
	(simplify_rhs_and_lookup_avail_expr): Kill.  Remnants moved
	into tree-ssa-forwprop.c.
	(eliminate_redundant_computations): Do not call
	simplify_rhs_and_lookup_avail_expr anymore.
	* tree-ssa-forwprop.c (simplify_not_neg_expr): New function
	extracted from remnants of simplify_rhs_and_lookup_avail_expr.
	(tree_ssa_forward_propagate_single_use_vars): Call
	simplify_not_neg_expr appropriately.

From-SVN: r108711
2005-12-17 00:18:35 -07:00
Jeff Law 622f91baa8 tree-ssa-ccp.c (fold_stmt_r): DATA argument is now a pointer to a structure containing state rather than a...
* tree-ssa-ccp.c (fold_stmt_r): DATA argument is now a pointer
	to a structure containing state rather than a pointer to bool.
	(case ARRAY_REF): New code to handle folding some array references.
	(case ADDR_EXPR): Note when we are processing expressions found
	within an ADDRE_EXPR.
	(fold_stmt, fold_stmt_inplace): Pass in a structure to fold_stmt_r
	for state variables rather than just a pointer to a boolean.
	* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Remove
	handling of constant string references.

	* gcc.dg/tree-ssa/foldstring-1.c: New test.

From-SVN: r108519
2005-12-14 09:15:53 -07:00
Jeff Law 0e0ed59411 tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Remove reassociation code.
* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Remove
	reassociation code.
	* passes.c (init_optimization_passes): Run reassociation again
	after loop optimizations.

	* tree-ssa-dom.c (thread_across_edge): Canonicalize condition
	if necessary.
	(optimize_stmt): Ditto.
	(canonicalize_comparison): New function.
	* tree-ssa-operands.c (swap_tree_operands): Make external.
	(get_expr_operands): Stop auto-canonicalization.
	* tree-ssa-reassoc.c: Rewrite.
	(init_optimization_passes): 
	* tree-flow.h (swap_tree_operands): Prototype.
	* Makefile.in (tree-ssa-reassoc.o): Update dependencies.

	* gcc.dg/tree-ssa/ssa-pre-2.c: Update due to reassociation changes.
	* gcc.dg/tree-ssa/reassoc-1.c: Likewise.
	* gcc.dg/tree-ssa/reassoc-2.c: Likewise.
	* gcc.dg/tree-ssa/reassoc-3.c: Likewise.
	* gcc.dg/tree-ssa/reassoc-4.c: Likewise.
	* gcc.dg/tree-ssa/reassoc-5.c: New.
	* gcc.dg/tree-ssa/reassoc-6.c: New.
	* gcc.dg/tree-ssa/reassoc-7.c: New.
	* gcc.dg/tree-ssa/reassoc-8.c: New.
	* gcc.dg/tree-ssa/reassoc-9.c: New.
	* gcc.dg/tree-ssa/reassoc-10.c: New.
	* gcc.dg/tree-ssa/reassoc-11.c: New.

From-SVN: r108425
2005-12-12 12:59:16 -07:00
Diego Novillo 127203ac0c tree.c (recompute_tree_invariant_for_addr_expr): Rename from recompute_tree_invarant_for_addr_expr.
* tree.c (recompute_tree_invariant_for_addr_expr): Rename from
	recompute_tree_invarant_for_addr_expr.
	Update uses everywhere.

From-SVN: r108316
2005-12-09 14:24:28 -05:00
Richard Guenther b4257cfc1f tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build.
2005-12-02  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build.
	* tree-complex.c (update_complex_assignment, expand_complex_div_wide):
	Likewise.
	* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref,
	maybe_fold_offset_to_component_ref): Likewise.
	* tree-ssa-dom.c (thread_across_edge,
	simplify_rhs_and_lookup_avail_expr,
	find_equivalent_equality_comparison, record_equivalences_from_stmt):
	Likewise.
	* gimple-low.c (lower_function_body, lower_return_expr): Likewise.
	* tree-eh.c (do_return_redirection, honor_protect_cleanup_actions,
	lower_try_finally_switch): Likewise.
	* tree-if-conv.c (add_to_dst_predicate_list,
	replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise.
	* gimplify.c (internal_get_tmp_var, gimple_build_eh_filter,
	voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr,
	gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr,
	gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr,
	shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr,
	gimplify_init_ctor_eval, gimplify_init_constructor,
	gimplify_variable_sized_compare, gimplify_boolean_expr,
	gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr,
	gimplify_expr, gimplify_body, gimplify_function_tree,
	force_gimple_operand): Likewise.
	* tree-ssa-pre.c (create_expression_by_pieces): Likewise.
	* tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for,
	mx_register_decls): Likewise.
	* tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain,
	get_frame_field, finalize_nesting_tree_1): Likewise.
	* tree-inline.c (setup_one_parameter): Likewise.
	* tree-vect-transform.c (vectorizable_condition): Likewise.
	* tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies):
	Likewise.
	* tree-profile.c (tree_gen_edge_profiler): Likewise.
	* tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise.
	* c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise.
	* tree-chrec.h (build_polynomial_chrec): Likewise.

From-SVN: r107907
2005-12-02 17:09:40 +00:00
Richard Kenner 4d14c1f401 tree-ssa-dom.c (extract_range_from_cond): Deal with variable bounds on types.
* tree-ssa-dom.c (extract_range_from_cond): Deal with variable bounds
	on types.

From-SVN: r107182
2005-11-18 08:32:05 -05:00
Jeff Law ae14e67b2f tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Do not perform reassociation if the parent statement will not die as a result...
* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Do not
        perform reassociation if the parent statement will not die as
        a result of the optimization.

From-SVN: r106744
2005-11-10 11:31:07 -07:00
Jeff Law 43f31be5b7 invoke.texi: Document max-jump-thread-duplication-stmts PARAM.
* doc/invoke.texi: Document max-jump-thread-duplication-stmts PARAM.
	* tree-ssa-dom.c: Include params.h.
	(thread_across_edge): If there are too many statements in the
	target block, then do not thread through it.
	* Makefile.in (tree-ssa-dom.o): Depend on $(PARAMS_H).
	* params.def (PARAM_MAX_JUMP_THREAD_DUPLICATION_STMTS): New PARAM.

From-SVN: r106503
2005-11-04 13:09:25 -07:00
Jeff Law 3e352c00e1 tree-ssa-dom.c (dom_opt_finalize_block): Fix conditions to determine whether or not to try and thread outgoing edges.
* tree-ssa-dom.c (dom_opt_finalize_block): Fix conditions to
	determine whether or not to try and thread outgoing edges.

From-SVN: r105091
2005-10-07 10:05:37 -06:00
Steven Bosscher 46fbb29c2e re PR tree-optimization/23049 (ICE with -O3 -ftree-vectorize on 4.1.x)
2005-10-05  Steven Bosscher  <stevenb@suse.de>
gcc/
	PR tree-optimization/23049
	* tree-ssa-dom.c (thread_across_edge): Make sure that the condition
	of a COND_EXPR is folded before calling fold on the whole rhs of a
	conditional assignment.
	* doc/tree-ssa.texi: Update the GIMPLE grammar for a valid rhs to
	document that a COND_EXPR may appear there.

testsuite/
	* gcc.dg/pr23049.c: New test.

	* gcc.dg/ucnid-4.c: Fix test.

From-SVN: r104938
2005-10-04 05:57:38 +00:00
Jeff Law 608af77dc1 tree-ssa-dom.c (tree_ssa_dominator_optimize): Be more selective about when to iterate.
* tree-ssa-dom.c (tree_ssa_dominator_optimize): Be more selective
        about when to iterate.

From-SVN: r104658
2005-09-26 13:40:20 -06:00
Jan Hubicka 5e5a504e30 tree-ssa-dom.c (thread_across_edge): Remove updating here.
* tree-ssa-dom.c (thread_across_edge): Remove updating here.
	(thread_block): Add it here.
	* update-threading.c: New test.

From-SVN: r102648
2005-08-02 00:12:50 +00:00
Diego Novillo 6a2cf9dce7 tree-ssa-dom.c (struct opt_stats_d): Add field num_iterations.
* tree-ssa-dom.c (struct opt_stats_d): Add field num_iterations.
	(tree_ssa_dominator_optimize): Increment it.
	(dump_dominator_optimization_stats): Print it.

From-SVN: r102553
2005-07-29 10:41:53 -04:00
Volker Reichelt 206048bd41 builtins.c: Fix comment typo(s).
* builtins.c: Fix comment typo(s).
	* genautomata.c: Likewise.
	* gimplify.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.

From-SVN: r102491
2005-07-28 16:30:00 +00:00
James A. Morrison 4db8040cd4 tree.h (tree_expr_nonzero_p): Export.
2005-07-20  James A. Morrison  <phython@gcc.gnu.org>

        * tree.h (tree_expr_nonzero_p): Export.
        * fold-const.c (tree_expr_nonzero_p): Likewise.
        Return true for CALL_EXPRs that are alloca calls.
        (fold_binary): Use omit_one_operand when checking EQ_EXPRs or NE_EXPRs
        against zero.
        * tree-flow.h (expr_computes_nonzero): Remove.
        * tree-vrp.c (expr_computes_nonzero): Remove.
        (vrp_expr_computes_nonzero): Use tree_expr_nonzero_p.
        (extract_range_from_unary_expr): Likewise.
        * tree-ssa-dom.c (record_equivalences_from_stmt): Use
        tree_expr_nonzero_p.

From-SVN: r102201
2005-07-20 20:26:11 +00:00
David Edelsohn bbcbc3e07f tree-ssa-dom.c (lookup_avail_expr): Do not pass member in freed structure as argument.
* tree-ssa-dom.c (lookup_avail_expr): Do not pass member in freed
	structure as argument.

From-SVN: r101971
2005-07-13 11:21:05 -04:00
Andrew Pinski 019b02f12f re PR tree-optimization/22335 (DOM creates mis-matched types)
2005-07-12  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/22335
        * tree-ssa-dom.c (eliminate_redundant_computations): Reject the prop if
        requiring a cast in a non RHS of modify_expr.  Add a cast when required.
        (lookup_avail_expr): Use constant_boolean_node instead
        of boolean_false_node/boolean_true_node.

From-SVN: r101929
2005-07-12 10:00:00 -07:00
Jeff Law 2d0dab7f2b tree-ssa-dom.c (find_equivalent_equality_comparison): Do not a eliminate type conversion which feeds an equality comparison if...
* tree-ssa-dom.c (find_equivalent_equality_comparison): Do not
        a eliminate type conversion which feeds an equality comparison
        if the original type or either operand in the comparison is a
        function pointer.

	* gcc.dg/tree-ssa/pr22051-1.c: New test.
	* gcc.dg/tree-ssa/pr22051-2.c: New test.

From-SVN: r101534
2005-07-02 08:15:11 -06:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Jeff Law a513fe886b tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): No longer simplify DIV, MOD or ABS expressions using VRP information.
* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): No longer
        simplify DIV, MOD or ABS expressions using VRP information.
        Remove WALK_DATA parameter.  Prototype and all callers updated.
        (eliminate_redundant_computations): Remove WALK_DATA parameter.
        Prototype and all callers updated.
        (optimize_stmt): WALK_DATA parameter is now unused.

        * tree-vrp.c (local_fold): New function.  Like fold, but
        strips useless type conversions in the result.
        (simplify_using_ranges): New function, largely cribbed from
        tree-ssa-dom.c::simplify_rhs_and_lookup_avail_expr.
        (vrp_finalize): Call simplify_using_ranges.

        * gcc.dg/tree-ssa/20030807-10.c: VRP is now expected to
        perform the desired transformations.
        * gcc.dg/tree-ssa/20030806-6.c: Similarly.
        * gcc.dg/tree-ssa/20040514-2.c: Similarly.

From-SVN: r100909
2005-06-13 17:24:47 -06:00
Diego Novillo 441e96b5bc tree-ssa-dom.c (record_edge_info): Use last_basic_block to allocate info array.
* tree-ssa-dom.c (record_edge_info): Use last_basic_block to
	allocate info array.
	* tree-vrp.c (extract_range_from_unary_expr): Set resulting
	range to varying in cast expressions that change
	TYPE_PRECISION.

testsuite/ChangeLog

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

From-SVN: r100554
2005-06-03 17:07:11 -04: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 8184759dbc tree-ssa-dom.c (vrp_element_p): Define.
* tree-ssa-dom.c (vrp_element_p): Define.
	(vrp_hash_elt): Change the type of records to
	VEC(vrp_element_p,heap).
	(vrp_free): New.
	(tree_ssa_dominator_optimize): Pass vrp_free to htab_create.
	Update uses of VRP records.
	(simplify_cond_and_lookup_avail_expr, record_range): Update
	uses of VRP records.

From-SVN: r100293
2005-05-28 15:30:22 +00:00
Kazu Hirata 4aab792de6 basic-block.h (basic_block_def): Add phi_nodes and predictions.
* basic-block.h (basic_block_def): Add phi_nodes and
	predictions.  Remove tree_annotations.
	* predict.c (tree_predicted_by_p, tree_predict_edge,
	combine_predictions_for_bb): Adjust references to predictions.
	* tree-cfg.c (init_empty_tree_cfg, create_bb): Don't call
	create_block_annotation.
	(create_block_annotation, free_blocks_annotatios,
	clear_blocks_annotations): Remove.
	(dump_cfg_stats): Don't print out the memory spent on
	bb_ann_d.
	(delete_tree_cfg_annotations): Don't call free_blocks_annotations.
	* tree-flow-inline.h (bb_ann): Remove.
	(phi_nodes, set_phi_nodes): Update references to phi_nodes.
	* tree-flow.h (bb_ann_d): Remove.
	* tree-if-conv.c (process_phi_nodes): Update a reference to
	phi_nodes.
	* tree-phinodes.c (reserve_phi_args_for_new_edge,
	create_phi_node, remove_phi_node): Likewise.
	* tree-pretty-print.c (dump_generic_bb_buff): Don't call bb_ann.
	* tree-ssa-dom.c (threaded_blocks): New.
	(tree_ssa_dominator_optimize): Initialize, clear, and free
	threaded_blocks. Update a call to thread_through_all_blocks.
	(thread_across_edge): Use threaded_blocks instead of setting
	incoming_edge_threaded.
	* tree-ssa-threadupdate.c (threaded_through_all_blocks): Take
	a bitmap of blocks that are threaded through.
	* tree.h: Move the prototype of threaded_through_blocks to
	tree-flow.h.

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

From-SVN: r100250
2005-05-27 11:55:36 +00:00
Jeff Law 6cedb4acda tree-ssa-dom.c (cprop_into_stmt): Do not call recompute_tree_invariant_for_addr_expr here.
* tree-ssa-dom.c (cprop_into_stmt): Do not call
	recompute_tree_invariant_for_addr_expr here.
	(optimize_stmt): Call it here instead and do so if anything
	at all has changed in the statement and the RHS is an ADDR_EXPR.
	* tree-ssa-forwprop.c (tidy_after_forward_propagate_addr): If
	needed, call recompute_tree_invariant_for_addr_expr.
	* tree-ssa-propagate.c (substitute_and_fold): Call
	recompute_tree_invariant_for_addr_expr as needed.


	* gcc.c-torture/compile/pr21638.c: New test.
	* gcc.c-torture/compile/20050520-1.c: New test.

From-SVN: r100092
2005-05-23 20:54:06 -06:00
Zdenek Dvorak 38965eb29c tree-cfg.c (tree_can_merge_blocks_p): Allow phi nodes in the merged block.
* tree-cfg.c (tree_can_merge_blocks_p): Allow phi nodes in the
	merged block.
	(replace_uses_by): New function.
	(tree_merge_blocks): Eliminate the phi nodes in the merged block.
	* tree-flow.h (fold_stmt_inplace): Declare.
	* tree-ssa-ccp.c (fold_stmt_inplace): New function.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Update dominance
	info after cfg cleanup.

From-SVN: r99850
2005-05-17 19:55:53 +00:00
Richard Henderson af47810aed re PR tree-optimization/21399 (libstdc++ 12077.cc ICE)
PR tree-opt/21399
        * tree-eh.c (maybe_clean_or_replace_eh_stmt): Rename from
        maybe_clean_eh_stmt; take old stmt parameter.  Update EH
        region data structure to match replacement.
        * tree-flow.h: Update to match.
        * tree-ssa-ccp.c (execute_fold_all_builtins): Likewise.
        * tree-ssa-dom.c (optimize_stmt): Likewise.
        * tree-ssa-pre.c (eliminate): Likewise.
        * tree-ssa-propagate.c (substitute_and_fold): Likewise.

Co-Authored-By: Steven Bosscher <stevenb@suse.de>

From-SVN: r99801
2005-05-16 16:14:02 -07:00
Kazu Hirata 31117a5ce2 re PR tree-optimization/21170 (Comments still mention rewrite_ssa_into_ssa.)
PR tree-optimization/21170
	* tree-ssa-dom.c, tree-ssa-threadupdate.c: Replace
	rewrite_ssa_into_ssa in comments with update_ssa.

From-SVN: r99540
2005-05-10 20:21:28 +00:00
Jeff Law 5fefbc7977 tree-ssa-dom.c (dom_opt_finalize_block): Do not call thread_across_edge for any abnormal edges.
* tree-ssa-dom.c (dom_opt_finalize_block): Do not call
	thread_across_edge for any abnormal edges.

	* gcc.c-torture/compile/20050510-1.c: New test.

From-SVN: r99536
2005-05-10 13:19:30 -06: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
Kazu Hirata a3b609dfb9 * tree-ssa-dom.c: Fix formatting.
From-SVN: r98601
2005-04-23 02:23:28 +00:00
Diego Novillo 84d658141e [multiple changes]
2005-04-22  Diego Novillo  <dnovillo@redhat.com>

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

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

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

From-SVN: r98599
2005-04-22 20:59:54 -04:00
Jeff Law 74d2efc74c tree-ssa-dom.c (block_defs_stack): Remove, no longer needed.
* tree-ssa-dom.c (block_defs_stack): Remove, no longer needed.
	(restore_currdefs_to_original_value): Likewise.
	(register_definitions_for_stmt): Likewise.
	(tree_ssa_dominator_optimize): No longer initialize CURRENT_DEF
	for each variable.  Do not allocate/free block_defs_stack either.
	Do not iterate if we just thread jumps.  Only iterate if the
	tree_cleanup_cfg does useful work (temporary).
	(dom_opt_initialize_block): No longer push a marker on
	BLOCK_DEFS_STACK.
	(dom_opt_finalize_block): Removal call to restore currdefs.
	Relax restrictions for recording edge equivalences.
	(record_equivalences_from_phis): No longer need to track
	CURRENT_DEF.
	(optimize_stmt): Similarly.
	(thread_across_edge): Simplify by removing the requirement that
	statements in the block we are threading through must be nops.
	(initialize_hash_element): Handle GOTO_EXPR.

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

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

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

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

From-SVN: r98498
2005-04-21 09:18:28 +00:00
Diego Novillo 0bca51f080 backport: copy-prop, incremental SSA updating of FUD chains and newly exposed symbols.
Merge from tree-cleanup-branch: VRP, store CCP, store
	    copy-prop, incremental SSA updating of FUD chains and
	    newly exposed symbols.

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

testsuite/ChangeLog

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

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

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

From-SVN: r97648
2005-04-05 19:05:20 +00:00
Kazu Hirata b08ee07eb2 tree-ssa-dom.c (cprop_into_successor_phis): Remove an obsolete comment.
* tree-ssa-dom.c (cprop_into_successor_phis): Remove an
	obsolete comment.

From-SVN: r97349
2005-03-31 20:49:36 +00:00
Zdenek Dvorak c5cbcccf90 basic-block.h (single_succ_p, [...]): New inline functions.
* basic-block.h (single_succ_p, single_pred_p, single_succ_edge,
	single_pred_edge, single_succ, single_pred): New inline functions.
	* bb-reorder.c (rotate_loop, find_traces_1_round,
	add_labels_and_missing_jumps, fix_up_fall_thru_edges,
	duplicate_computed_gotos): Use the single_succ/pred functions.
	* cfganal.c (forwarder_block_p): Ditto.
	* cfgbuild.c (compute_outgoing_frequencies): Ditto.
	* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
	outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg,
	merge_seq_blocks): Ditto.
	* cfghooks.c (split_edge, tidy_fallthru_edges): Ditto.
	* cfglayout.c (fixup_reorder_chain): Ditto.
	* cfgloop.c (mark_single_exit_loops, update_latch_info,
	canonicalize_loop_headers, verify_loop_structure): Ditto.
	* cfgloopmanip.c (remove_path, unloop, loop_delete_branch_edge,
	mfb_update_loops, create_preheader, force_single_succ_latches,
	create_loop_notes): Ditto.
	* cfgrtl.c (rtl_can_merge_blocks, try_redirect_by_replacing_jump,
	force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge,
	commit_one_edge_insertion, purge_dead_edges,
	cfg_layout_can_merge_blocks_p): Ditto.
	* except.c (sjlj_emit_function_enter): Ditto.
	* flow.c (init_propagate_block_info): Ditto.
	* function.c (thread_prologue_and_epilogue_insns): Ditto.
	* gcse.c (find_implicit_sets, bypass_conditional_jumps,
	insert_insn_end_bb): Ditto.
	* ifcvt.c (merge_if_block, find_if_block, find_if_case_1,
	find_if_case_2): Ditto.
	* lambda-code.c (perfect_nestify): Ditto.
	* lcm.c (optimize_mode_switching): Ditto.
	* loop-doloop.c (doloop_modify): Ditto.
	* loop-init.c (loop_optimizer_init): Ditto.
	* loop-iv.c (simplify_using_initial_values): Ditto.
	* loop-unroll.c (unroll_loop_runtime_iterations): Ditto.
	* loop-unswitch.c (unswitch_loop): Ditto.
	* modulo-sched.c (generate_prolog_epilog): Ditto.
	* predict.c (combine_predictions_for_insn, estimate_probability,
	tree_estimate_probability, last_basic_block_p,
	estimate_bb_frequencies): Ditto.
	* profile.c (branch_prob): Ditto.
	* regrename.c (copyprop_hardreg_forward): Ditto.
	* sched-rgn.c (is_cfg_nonregular, find_rgns, update_live): Ditto.
	* tracer.c (layout_superblocks): Ditto.
	* tree-cfg.c (tree_can_merge_blocks_p, tree_merge_blocks,
	cfg_remove_useless_stmts_bb, cleanup_control_flow,
	cleanup_control_expr_graph, disband_implicit_edges,
	tree_find_edge_insert_loc, bsi_commit_edge_inserts,
	tree_verify_flow_info, tree_make_forwarder_block,
	tree_forwarder_block_p, remove_forwarder_block,
	remove_forwarder_block_with_phi, merge_phi_nodes): Ditto.
	* tree-if-conv.c (tree_if_conversion): Ditto.
	* tree-mudflap.c (mf_build_check_statement_for): Ditto.
	* tree-ssa-dce.c (remove_dead_stmt): Ditto.
	* tree-ssa-dom.c (dom_opt_finalize_block): Ditto.
	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p,
	copy_loop_headers): Ditto.
	* tree-ssa-loop-im.c (loop_commit_inserts): Ditto.
	* tree-ssa-loop-ivopts.c (compute_phi_arg_on_exit): Ditto.
	* tree-ssa-loop-manip.c (split_loop_exit_edge, ip_normal_pos,
	lv_adjust_loop_entry_edge, tree_ssa_loop_version): Ditto.
	* tree-ssa-loop-niter.c (simplify_using_initial_conditions): Ditto.
	* tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Ditto.
	* tree-ssa-phiopt.c (tree_ssa_phiopt, value_replacement): Ditto.
	* tree-ssa-pre.c (compute_antic_aux, insert_aux, init_pre): Ditto.
	* tree-ssa-threadupdate.c (redirect_edges): Ditto.
	* tree-tailcall.c (independent_of_stmt_p, find_tail_calls,
	eliminate_tail_call, tree_optimize_tail_calls_1): Ditto.
	* tree-vect-analyze.c (vect_analyze_loop_form): Ditto.
	* tree-vect-transform.c (vect_update_ivs_after_vectorizer): Ditto.
	* tree-vectorizer.c (slpeel_update_phi_nodes_for_guard,
	slpeel_add_loop_guard): Ditto.

From-SVN: r96292
2005-03-11 09:05:12 +00:00
Jeff Law be47740604 tree-cfg.c (find_taken_edge_computed_goto): New function.
* tree-cfg.c (find_taken_edge_computed_goto): New function.
        (find_taken_edge): Call find_taken_edge_computed_goto as
        appropriate.  Allow any gimple invariant rather than just
        INTEGER_CST for VAL.
        (cleanup_control_flow): Cleanup a computed goto which has turned
        into a simple goto.
        (tree_merge_blocks): If block B has any forced labels, move
        them to the start of block A.
        * tree-ssa-dom.c (thread_across_edge): Allow threading across
        computed gotos as well.
        * tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges): Handle
        removal of unnecessary computed gotos too.
        (lookup_redirection_data): Fix type of INSERT argument.  Callers
        updated.

From-SVN: r96084
2005-03-07 20:39:19 -07:00
Jeff Law d38ffc5542 basic-block.h (rediscover_loops_after_threading): Declare.
* basic-block.h (rediscover_loops_after_threading): Declare.
        * tree-ssa-dom.c: Include cfgloop.h.
        (tree_ssa_dominator_optimize): Discover loops and some basic
        properties.  Remove forwarder blocks recreated by loop header
        canonicalization.  Also mark backedges in the CFG.
        * tree-ssa-threadupdate.c: Include cfgloop.h
        (rediscover_loops_after_threading): Define.
        (struct local_info): New field, JUMP_THREADED.
        (prune_undesirable_thread_requests): New function.
        (redirect_edges): Clear EDGE_ABNORMAL.  If edges were threaded
        then record that fact for the callers of redirct_edges.
        (thread_block): If BB has incoming backedges, then call
        prune_undesirable_thraed_requests.    Note when we are
        going to have to rediscover loop information.  Return a
        boolean indicating if any jumps were threaded.
        (thread_through_all_blocks): Bubble up boolean indicating
        if any jumps were threaded.
        * Makefile.in (tree-ssa-dom.o): Depend on cfgloop.h
        (tree-ssa-threadupdate.o): Similarly.

From-SVN: r95903
2005-03-04 14:35:49 -07:00
Kazu Hirata 13396b14c0 tree-ssa-dom.c (tree_ssa_dominator_optimize): Call free_dominance_info only when needed.
* tree-ssa-dom.c (tree_ssa_dominator_optimize): Call
	free_dominance_info only when needed.

From-SVN: r95791
2005-03-02 19:12:55 +00:00