Commit Graph

22 Commits

Author SHA1 Message Date
Richard Henderson f05ef4220a tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Don't fold fp plus with minus.
* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Don't fold
        fp plus with minus.

From-SVN: r84061
2004-07-03 11:57:18 -07:00
Richard Kenner 580d124fe0 tree-ssa.c (tree_ssa_useless_type_conversion): Also look at VIEW_CONVERT_EXPR and NON_LVALUE_EXPR.
* tree-ssa.c (tree_ssa_useless_type_conversion): Also look at
	VIEW_CONVERT_EXPR and NON_LVALUE_EXPR.
	* tree-ssa-ccp.c (fold_stmt): Call just STRIP_USELESS_TYPE_CONVERSION.
	* tree-ssa-dom.c (local_fold): Likewise.

From-SVN: r84054
2004-07-03 09:45:29 -04:00
Kazu Hirata f6fe65dc61 ifcvt.c, [...]: Fix comment typos.
* ifcvt.c, modulo-sched.c, tree-alias-common.c, tree-sra.c,
	tree-ssa-copy.c, tree-ssa-dom.c, tree-ssa-pre.c: Fix comment
	typos.

From-SVN: r84008
2004-07-02 00:51:01 +00:00
Zdenek Dvorak 5f240ec46e tree-ssa-loop-ch.c: New file.
* tree-ssa-loop-ch.c: New file.
	* Makefile.in (tree-ssa-loop-ch.o): Add.
	(tree-into-ssa.o): Add GGC_H dependency.
	* tree-cfg.c (tree_duplicate_bb): Copy virtual arguments.
	* tree-flow.h (rewrite_into_ssa): Declaration changed.
	(rewrite_ssa_into_ssa, compute_global_livein, duplicate_ssa_name):
	Declare.
	* tree-into-ssa.c: Include ggc.h.
	(struct def_blocks_d): Add phi_blocks field.
	(struct mark_def_sites_global_data): Add names_to_rename field.
	(struct ssa_name_info): New.
	(compute_global_livein): Export.
	(set_def_block, insert_phi_nodes, mark_def_sites, set_livein_block,
	insert_phi_nodes_1, rewrite_finalize_block, insert_phi_nodes_for,
	register_new_def, get_reaching_def, def_blocks_free,
	get_def_blocks_for, rewrite_into_ssa): Modified to work with
	rewrite_ssa_into_ssa.
	(get_ssa_name_ann, get_phi_state, set_phi_state, get_current_def,
	set_current_def, ssa_mark_def_sites_initialize_block,
	ssa_mark_phi_uses, ssa_mark_def_sites, duplicate_ssa_name,
	ssa_register_new_def, ssa_rewrite_initialize_block,
	ssa_rewrite_phi_arguments, ssa_rewrite_finalize_block,
	ssa_rewrite_stmt, rewrite_ssa_into_ssa, rewrite_all_into_ssa): New
	functions.
	(pass_build_ssa): Call rewrite_all_into_ssa.
	* tree-optimize.c (execute_todo, execute_one_pass,
	tree_rest_of_compilation): Allocate vars_to_rename only once.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Provide parameter
	to rewrite_into_ssa.
	* tree-ssa-loop.c (should_duplicate_loop_header_p,
	mark_defs_for_rewrite, duplicate_blocks, do_while_loop_p,
	copy_loop_headers, gate_ch, pass_ch): Moved to tree-ssa-loop-ch.c.
	Use rewrite_ssa_into_ssa.
	* tree-ssa-operands.c (copy_virtual_operands): New function.
	* tree-ssa-operands.h (copy_virtual_operands): Declare.
	* tree.h (struct tree_ssa_name): Add aux field.
	(SSA_NAME_AUX): New macro to access it.

From-SVN: r83932
2004-06-30 21:11:28 +00:00
Richard Henderson 1eaba2f208 tree-cfg.c (verify_stmt): Add last_in_block parameter.
* tree-cfg.c (verify_stmt): Add last_in_block parameter.  Verify
        that eh stmts can throw.
        (verify_stmts): Update verify_stmt call.
        (tree_purge_dead_eh_edges, tree_purge_all_dead_eh_edges): New.
        * tree-eh.c (remove_stmt_from_eh_region): New.
        (lower_eh_constructs): Fix throw_stmt_table delete routine.
        (tree_could_trap_p): Match may_trap_p.
        (maybe_clean_eh_stmt): New.
        * tree-flow.h: Update decls.
        * tree-ssa-ccp.c (pass_ccp): Add TODO_verify_stmts.
        (substitute_and_fold): Clean eh edges.
        * tree-ssa-dce.c (mark_control_dependent_edges_necessary): Handle
        empty basic blocks.
        * tree-ssa-dom.c (need_eh_cleanup): New.
        (tree_ssa_dominator_optimize): Allocate it.  Cleanup eh edges.
        (optimize_stmt): Cleanup eh stmts; set need_eh_cleanup.

From-SVN: r83843
2004-06-28 23:59:35 -07:00
Diego Novillo ff2ad0f77f common.opt (ftree-fre): New flag.
* common.opt (ftree-fre): New flag.
	* flags.h (flag_tree_fre): Declare.
	* opts.c (decode_options): Set.
	* timevar.def (TV_TREE_FRE): Define.
	* tree-flow-inline.h (may_propagate_copy): Re-arrange for
	readability.  Handle destinations that are not SSA_NAMEs.
	* tree-flow.h (struct ptr_info_def): Move from tree.h
	(cprop_into_stmt, cprop_into_successor_phis): Remove.
	(vn_compute, vn_lookup_or_add, vn_add, vn_lookup): Add
	vuse_optype parameter.
	* tree-pass.h (pass_fre): Declare.
	* tree-ssa-copy.c (cprop_operand): Move to tree-ssa-dom.c
	(cprop_into_stmt): Likewise.
	(cprop_into_successor_phis): Likewise.
	* tree-ssa-dom.c (eliminate_redundant_computations): Fix
	argument ordering in call to may_propagate_copy.
	* tree-ssa-pre.c (is_undefined_value): Assume hard registers
	to be always defined.
	(add_to_sets): New local function.
	(create_value_expr_from): New local function.
	(compute_avail): Call them.
	(eliminate): Don't ignore statements with virtual operands.
	(init_pre): New local function.
	(fini_pre): New local function.
	(execute_pre): Call them.
	Add argument DO_FRE.  Don't do insertion if DO_FRE is true.
	(do_pre): New function.
	(do_fre): New function.
	(gate_fre): New function.
	(pass_fre): Declare.
	* tree-ssa.c (init_tree_ssa): Don't call vn_init.
	(delete_tree_ssa): Don't call vn_delete.
	* tree-vn.c (val_expr_pair_d): Add documentation.
	(vn_compute): Add VUSES argument to incorporate in computing
	hash values.  Update all callers.
	(expressions_equal_p): Call operand_equal_p with
	OEP_PURE_SAME.
	(vn_add): Add VUSES argument.  Update all callers.
	(vn_lookup): Likewise.
	(vn_lookup_or_add): Likewise.
	* doc/invoke.texi: Document -ftree-fre and -fdump-tree-fre.

From-SVN: r83837
2004-06-28 21:53:04 -04: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
Richard Henderson 940db2c87c tree-ssa-dom.c (real_avail_expr_hash): New.
* tree-ssa-dom.c (real_avail_expr_hash): New.
        (tree_ssa_dominator_optimize): Use it in the htab.

From-SVN: r83616
2004-06-24 15:46:56 -07:00
Jeff Law d2d8936f3f tree-ssa-dom.c (record_dominating_conditions): New function.
* tree-ssa-dom.c (record_dominating_conditions): New function.
	(dom_opt_finalize_block, get_eq_expr_value): Use it.

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

From-SVN: r83597
2004-06-24 09:59:52 -06: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
Zdenek Dvorak 8a78744fcf re PR tree-optimization/15993 ([lno] Compiler hangs at -O3)
PR tree-optimization/15993
	* tree-ssa-dom.c (thread_across_edge): Do not thread edge if its
	destination is unchanged.

From-SVN: r83242
2004-06-16 13:39:49 +00:00
Diego Novillo 95a3742c48 Makefile.in (tree-ssanames.o): Depend on TREE_FLOW_H.
* Makefile.in (tree-ssanames.o): Depend on TREE_FLOW_H.
	* tree-flow.h (ssa_names, num_ssa_names, ssa_name): Declare.
	(highest_ssa_version): Remove.
	* tree-outof-ssa.c (new_temp_expr_table): Replace
	highest_ssa_version with num_ssa_names.
	(dump_replaceable_exprs): Likewise.
	(rewrite_vars_out_of_ssa): Likewise.
	* tree-ssa-ccp.c (initialize): Likewise
	* tree-ssa-copyrename.c (rename_ssa_copies): Likewise.
	* tree-ssa-dce.c (tree_dce_init): Likewise.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
	* tree-ssa-live.c (create_ssa_var_map): Likewise.
	(dump_var_map): Likewise.
	* tree-ssa.c (verify_ssa): Likewise.
	(kill_redundant_phi_nodes): Likewise.
	Do not build a local array of SSA_NAMEs.  Use the ssa_names table.
	* tree-ssanames.c: Include tree-flow.h
	(ssa_names): New varray.
	(init_ssa_names): Initialize ssa_names.
	Reserve the first slot of the ssa_names table.
	(make_ssa_name): Push the newly created SSA_NAME into ssa_names.
	Assign version numbers using num_ssa_names.

From-SVN: r82950
2004-06-10 18:37:05 -04: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
Andrew Pinski e072ae27e0 tree-complex.c (expand_complex_comparison): Use fold_convert instead of convert.
2004-06-09  Andrew Pinski  <pinskia@physics.uc.edu>

        * tree-complex.c (expand_complex_comparison): Use fold_convert instead
        of convert.
        * tree-inline.c (setup_one_parameter): Likewise.
        * tree-sra.c (csc_build_component_ref): Likewise.
        * tree-ssa-ccp.c (ccp_fold): Likewise.
        * tree-ssa-copy.c (cprop_operand): Likewise.
        * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise.
        * tree-tailcall.c (tree_optimize_tail_calls_1): Likewise.

From-SVN: r82837
2004-06-09 08:07:03 -07:00
Steven Bosscher 1c052514f6 tree-ssa-dom.c (record_equivalences_from_incoming_edge): Only look at case labels if the immediate dominator is also the only predecessor.
* tree-ssa-dom.c (record_equivalences_from_incoming_edge):
	Only look at case labels if the immediate dominator is also
	the only predecessor.  Don't look for more case labels if the
	first seen is a case range.

From-SVN: r82480
2004-05-31 10:18:36 +00:00
Kazu Hirata 1ea7e6ad84 c-common.c, [...]: Fix comment typos.
* c-common.c, calls.c, cfgcleanup.c, cgraph.c, cgraphunit.c,
	ddg.c, ddg.h, df.c, df.h, except.c, expr.c, flags.h,
	fold-const.c, gcc.c, gimplify.c, haifa-sched.c,
	modulo-sched.c, tree-inline.c, tree-into-ssa.c, tree-nested.c,
	tree-nrv.c, tree-ssa-ccp.c, tree-ssa-dom.c, tree-ssa-live.c,
	tree-ssa-loop.c, tree-ssa-pre.c, tree-tailcall.c, tree.h: Fix
	comment typos.  Follow spelling conventions.

From-SVN: r82439
2004-05-30 07:12:58 +00:00
Jeff Law dd7473111a toplev.h (flag_delete_null_pointer_checks): Move from here to...
* toplev.h (flag_delete_null_pointer_checks): Move from here to...
        * flags.h (flag_delete_null_pointer_checks): Here.
        * tree-flow.h (cprop_into_successor_phis): Add argument to prototype.
        * tree-phinodes.c (resize_phi_node): Initialize PHI_ARG_NONZERO.
        (add_phi_arg, remove_phi_arg_num): Similarly.
        * tree-ssa-copy.c (cprop_into_successor_phis): Propagate nonzero
        property into PHI nodes.
        * tree-ssa-dom.c: Remove redundant inclusion of flags.h.
        (record_equivalences_from_phis): If all PHI arguments are known to be
        nonzero, then the result must be nonzero as well.
        (cprop_into_phis): Pass nonzero_vars bitmap to cprop_into_successor_phis        (record_equivalences_from_stmt): Check flag_delete_null_pointer_checks
        appropriately.  Walk the USE-DEF chains and propagate nonzero property
        as appropriate.
        * tree.h (PHI_ARG_NONZERO): Define.
        (phi_arg_d): Add nonzero flag.

From-SVN: r81968
2004-05-17 20:53:55 -06:00
Jeff Law 91cde0c3f5 tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Don't even bother marking bypassed virtuals for out-of-ssa.
* tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Don't even
        bother marking bypassed virtuals for out-of-ssa.  Instead merge
        bypassed virtuals into vars_to_rename just before into-ssa pass.

From-SVN: r81872
2004-05-15 00:21:34 -06:00
Jeff Law 14bc8dc280 tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Reorganize so that it picks up more opportunities to eliminate ABS expressions...
* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Reorganize
        so that it picks up more opportunities to eliminate ABS expressions
        or turn them into negations.

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

From-SVN: r81853
2004-05-14 11:51:05 -06:00
Andrew Pinski cfa4cb00a7 tree-ssa-dom.c (tree_ssa_dominator_optimize): Free nonzero_vars at the end of the function.
2004-05-13  Andrew Pinski  <pinskia@physics.uc.edu>

        * tree-ssa-dom.c (tree_ssa_dominator_optimize):
        Free nonzero_vars at the end of the function.

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