Commit Graph

78 Commits

Author SHA1 Message Date
Jakub Jelinek 66647d441f Update Copyright years for files modified in 2008 and/or 2009.
From-SVN: r144324
2009-02-20 16:20:38 +01:00
Sebastian Pop f8bf925265 backport: configure: Regenerate.
2008-09-02  Sebastian Pop  <sebastian.pop@amd.com>
	    Tobias Grosser  <grosser@fim.uni-passau.de>
	    Jan Sjodin  <jan.sjodin@amd.com>
	    Harsha Jagasia  <harsha.jagasia@amd.com>
	    Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
	    Konrad Trifunovic  <konrad.trifunovic@inria.fr>
	    Adrien Eliche  <aeliche@isty.uvsq.fr>

	Merge from graphite branch.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* configure.ac (host_libs): Add ppl and cloog.
	Add checks for PPL and CLooG.
	* Makefile.def (ppl, cloog): Added modules and dependences.
	* Makefile.tpl (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC): New.
	(HOST_PPLLIBS, HOST_PPLINC, HOST_CLOOGLIBS, HOST_CLOOGINC): New.

gcc/
	* graphite.c: New.
	* graphite.h: New.
	* tree-loop-linear.c (perfect_loop_nest_depth): Export.
	* doc/invoke.texi (-floop-block, -floop-interchange,
	-floop-strip-mine): Document new flags.
	* tree-into-ssa.c (gimple_vec): Moved...
	* tree-loop-distribution.c (rdg_component): Moved...
	* cfgloopmanip.c: Include tree-flow.h.
	(update_dominators_in_loop): New.
	(create_empty_if_region_on_edge): New.
	(create_empty_loop_on_edge): New.
	(loopify): Use update_dominators_in_loop.
	* tree-pass.h (pass_graphite_transforms): Declared.
	* configure: Regenerate.
	* tree-phinodes.c (make_phi_node): Export.
	(add_phi_node_to_bb): New, split from create_phi_node.
	* tree-chrec.c (for_each_scev_op): New.
	* tree-chrec.h (for_each_scev_op): Declared.
	* tree-ssa-loop-ivopts.c (get_phi_with_result): New.
	(remove_statement): Call get_phi_with_result.
	* config.in (HAVE_cloog): Undef.
	* gdbinit.in (pgg): New.
	* timevar.def (TV_GRAPHITE_TRANSFORMS): New.
	* tree-ssa-loop.c (graphite_transforms): New.
	(gate_graphite_transforms): New.
	(pass_graphite_transforms): New.
	* configure.ac (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC,
	HAVE_cloog): Defined.
	* tree-vectorizer.c (rename_variables_in_bb): Export.
	* tree-data-ref.c (dr_may_alias_p): Export.
	(stmt_simple_memref_p): New.
	(find_data_references_in_stmt): Export.
	(find_data_references_in_loop): Export.
	(create_rdg_edge_for_ddr): Initialize RDGE_RELATION.
	(create_rdg_edges_for_scalar): Initialize RDGE_RELATION.
	(create_rdg_vertices): Export.
	(build_empty_rdg): New.
	(build_rdg): Call build_empty_rdg.  Free dependence_relations.
	* tree-data-ref.h (rdg_component): ... here.
	(scop_p): New.
	(struct data_reference): Add a field scop.
	(DR_SCOP): New.
	(find_data_references_in_loop): Declared.
	(find_data_references_in_stmt): Declared.
	(create_rdg_vertices): Declared.
	(dr_may_alias_p): Declared.
	(stmt_simple_memref_p): Declared.
	(struct rdg_edge): Add a field ddr_p relation.
	(build_empty_rdg): Declared.
	* lambda.h (lambda_matrix): Declare a VEC of.
	(find_induction_var_from_exit_cond): Declared.
	(lambda_vector_compare): New.
	* common.opt (fgraphite, floop-strip-mine,
	floop-interchange, floop-block): New flags.
	* lambda-code.c (find_induction_var_from_exit_cond): Export.
	* cfgloop.c (is_loop_exit): New.
	* cfgloop.h (is_loop_exit): Declared.
	(create_empty_if_region_on_edge): Declared.
	(create_empty_loop_on_edge): Declared.
	* tree-flow.h (add_phi_node_to_bb): Declared.
	(make_phi_node): Declared.
	(rename_variables_in_bb): Declared.
	(perfect_loop_nest_depth): Declared.
	(graphite_transform_loops): Declared.
	* Makefile.in (cfgloopmanip.o): Depend on TREE_FLOW_H.
	(graphite.o-warn): Add -Wno-error.
	(PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC): Declared.
	(LIBS): Add GMPLIBS, CLOOGLIBS, PPLLIBS.
	(INCLUDES): Add PPLINC, CLOOGINC.
	(OBJS-common): Add graphite.o.
	(graphite.o): Add rule.
	* gimple.h (gimple_vec): ... here.
	* tree-cfg.c (print_loops): Start printing at ENTRY_BLOCK_PTR.
	* passes.c (init_optimization_passes): Schedule 
	pass_graphite_transforms.

testsuite/

	* gcc.dg/graphite/scop-{0,1,2,3,4,5,6,7,8,9,
	10,11,12,13,14,15,16,17,18}.c: New.
	* gcc.dg/graphite/graphite.exp: New.
	* gcc.dg/graphite/scop-matmult.c: New.
	* gcc.dg/graphite/block-0.c: New.
	* lib/target-supports.exp (check_effective_target_fgraphite): New.
	* gfortran.dg/graphite/block-1.f90: New.
	* gfortran.dg/graphite/scop-{1,2}.f: New.
	* gfortran.dg/graphite/block-{1,3,4}.f90: New.
	* gfortran.dg/graphite/graphite.exp: New.


Co-Authored-By: Adrien Eliche <aeliche@isty.uvsq.fr>
Co-Authored-By: Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
Co-Authored-By: Harsha Jagasia <harsha.jagasia@amd.com>
Co-Authored-By: Jan Sjodin <jan.sjodin@amd.com>
Co-Authored-By: Konrad Trifunovic <konrad.trifunovic@inria.fr>
Co-Authored-By: Tobias Grosser <grosser@fim.uni-passau.de>

From-SVN: r139893
2008-09-02 16:31:04 +00:00
Vladimir Makarov 058e97ecf3 [multiple changes]
2008-08-26  Vladimir Makarov  <vmakarov@redhat.com>

	* ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c,
	ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files.

	* doc/passes.texi: Describe IRA.

	* doc/tm.texi (IRA_COVER_CLASSES,
	IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros.

	* doc/invoke.texi (ira-max-loops-num): Describe the new parameter.
	(-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills,
	-fira-propagate-cost, -fno-ira-share-save-slots,
	-fno-ira-share-spill-slots, -fira-verbose): Describe new options.

	* flags.h (ira_algorithm): New enumeration.
	(flag_ira_algorithm, flag_ira_verbose): New external variable
	declarations.

	* postreload.c (gate_handle_postreload): Don't do post reload
	optimizations unless the reload is completed.

	* reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for
	IRA.

	* tree-pass.h (pass_ira): New external variable declaration.

	* reload.h: Add 2008 to the Copyright.
    
	* cfgloopanal.c: Include params.h.
	(estimate_reg_pressure_cost): Decrease cost for IRA optimization
	mode.
    
	* params.h (IRA_MAX_LOOPS_NUM): New macro.

	* toplev.c (ira.h): New include.
	(flag_ira_algorithm, flag_ira_verbose): New external variables.
	(backend_init_target): Call ira_init.
	(backend_init): Call ira_init_once.
	(finalize): Call finish_ira_once.

	* toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills,
	flag_ira_share_save_slots, flag_ira_share_spill_slots): New
	external variables.

	* regs.h (contains_reg_of_mode, move_cost, may_move_in_cost,
	may_move_out_cost): New external variable declarations.
	(move_table): New typedef.
    
	* caller-save.c: Include headers output.h and ira.h.
	(no_caller_save_reg_set): New global variable.
	(save_slots_num, save_slots): New variables.
	(reg_save_code, reg_restore_code, add_stored_regs): Add
	prototypes.
	(init_caller_save): Set up no_caller_save_reg_set.
	(init_save_areas): Reset save_slots_num.
	(saved_hard_reg): New structure.
	(hard_reg_map, saved_regs_num, all_saved_regs): New variables.
	(initiate_saved_hard_regs, new_saved_hard_reg,
	finish_saved_hard_regs, saved_hard_reg_compare_func): New
	functions.
	(setup_save_areas): Add code for sharing stack slots.
	(all_blocks): New variable.
	(save_call_clobbered_regs): Process pseudo-register too.
	(mark_set_regs): Process pseudo-register too.
	(insert_one_insn): Put the insn after bb note in a empty basic
	block.  Add insn check.
    
	* global.c (eliminable_regset): Make it external.
	(mark_elimination): Use DF_LR_IN for IRA.
	(pseudo_for_reload_consideration_p): New.
	(build_insn_chain): Make it external.  Don't ignore spilled
	pseudos for IRA.  Use pseudo_for_reload_consideration_p.
	(gate_handle_global_alloc): New function.
	(pass_global_alloc): Add the gate function.

	* opts.c (decode_options): Set up flag_ira.  Print the warning for
	-fira.
	(common_handle_option): Process -fira-algorithm and -fira-verbose.

	* timevar.def (TV_IRA, TV_RELOAD): New passes.

	* regmove.c (regmove_optimize): Don't do replacement of output for
	IRA.

	* hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses):
	New external variable declarations.

	* local-alloc.c (update_equiv_regs): Make it external.  Return
	true if jump label rebuilding should be done.  Rescan new_insn for
	notes.
	(gate_handle_local_alloc): New function.
	(pass_local_alloc): Add the gate function.

	* alias.c (value_addr_p, stack_addr_p): New functions.
	(nonoverlapping_memrefs_p): Use them for IRA.

	* common.opt (fira, fira-algorithm, fira-coalesce,
	fira-move-spills, fira-share-save-slots, fira-share-spill-slots,
	fira-verbose): New options.

	* regclass.c (reg_class_subclasses, contains_reg_of_mode,
	move_cost, may_move_in_cost, may_move_out_cost): Make the
	variables external.
	(move_table): Remove typedef.
	(init_move_cost): Make it external.
	(allocate_reg_info, resize_reg_info, setup_reg_classes): New
	functions.

	* rtl.h (init_move_cost, allocate_reg_info, resize_reg_info,
	setup_reg_classes): New function prototypes.
	(eliminable_regset): New external variable declaration.
	(build_insn_chain, update_equiv_regs): New function prototypes.
    
	* Makefile.in (IRA_INT_H): New definition.
	(OBJS-common): Add ira.o, ira-build.o, ira-costs.o,
	ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o.
	(reload1.o, toplev.o): Add dependence on ira.h.
	(cfgloopanal.o): Add PARAMS_H.
	(caller-save.o): Add dependence on output.h and ira.h.
	(ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o,
	ira-emit.o, ira-lives.o): New entries.

	* passes.c (pass_ira): New pass.

	* params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter.

	* reload1.c (ira.h): Include the header.
	(changed_allocation_pseudos): New bitmap.
	(init_reload): Initiate the bitmap.
	(compute_use_by_pseudos): Permits spilled registers in FROM.
	(temp_pseudo_reg_arr): New variable.
	(reload): Allocate and free temp_pseudo_reg_arr.  Sort pseudos for
	IRA.  Call alter_reg with the additional parameter.  Don't clear
	spilled_pseudos for IRA.  Restore original insn chain for IRA.
	Clear changed_allocation_pseudos at the end of reload.
	(calculate_needs_all_insns): Call IRA's mark_memory_move_deletion.
	(hard_regno_to_pseudo_regno): New variable.
	(count_pseudo): Check spilled pseudos.  Set up
	hard_regno_to_pseudo_regno.
	(count_spilled_pseudo): Check spilled pseudos. Update
	hard_regno_to_pseudo_regno.
	(find_reg): Use better_spill_reload_regno_p.  Check
	hard_regno_to_pseudo_regno.
	(alter_reg): Set up spilled_pseudos.  Add a new parameter.  Add
	code for IRA.
	(eliminate_regs_1): Use additional parameter for alter_reg.
	(finish_spills): Set up pseudo_previous_regs only for spilled
	pseudos.  Call reassign_pseudos once for all spilled pseudos, pass
	more arguments.  Don't clear live_throughout and dead_or_set for
	spilled pseudos.  Use additional parameter for alter_reg.  Call
	mark_allocation_change.  Set up changed_allocation_pseudos.
	Remove sanity check.
	(emit_input_reload_insns, delete_output_reload): Use additional
	parameter for alter_reg.  Call mark_allocation_change.
	(substitute, gen_reload_chain_without_interm_reg_p): New
	functions.
	(reloads_conflict): Use gen_reload_chain_without_interm_reg_p.
    
	* testsuite/gcc.dg/20080410-1.c: New file.
	
	* config/s390/s390.h (IRA_COVER_CLASSES,
	IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define.

	* config/sparc/sparc.h (IRA_COVER_CLASSES): New macro.

	* config/i386/i386.h (IRA_COVER_CLASSES): Ditto.

	* config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto.

	* config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto.

	* config/arm/arm.h (IRA_COVER_CLASSES): Ditto.
    
	* config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto.
    
	2008-08-24  Jeff Law  <law@redhat.com>
	* ira.c (setup_reg_class_intersect_union): Prefer smallest class
	when ignoring unavailable registers.

	2008-08-24  Jeff Law  <law@redhat.com>
	* ira-color.c (coalesced_pseudo_reg_slot_compare): Check
	FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD.
	* ira.c (setup_eliminable_regset): Check stack_realign_needed.
	* config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro.

	2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com>
	* ira-build.c (allocno_range_compare_func): Stabilize sort.

	2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com>
	* config/avr/avr.h (IRA_COVER_CLASSES): New macro.
	* reload1.c (find_reg): Process registers in register allocation order.

	2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk>
	* toplev.c (backend_init_target): Move ira_init call from
	here...
	(lang_dependent_init_target): ...to here.

	2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk>
	* ira.c (setup_class_subset_and_memory_move_costs): Don't
	calculate memory move costs for NO_REGS.

	2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org>
	* ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if
	STACK_REGS is defined.

	2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com>
	* config/spu/spu.h (IRA_COVER_CLASSES): New macro.

	2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com>
	* config/bfin/bfin.h (IRA_COVER_CLASSES): New macro.

	2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org>
	* config/sh/sh.h (IRA_COVER_CLASSES): Define.
	* config/sh/sh.md (movsicc_true+3): Check if emit returns a
	barrier.

From-SVN: r139590
2008-08-26 12:39:58 +00:00
Martin Jambor a167a67620 tree-switch-conversion.c: Included timevar.h
2008-07-02  Martin Jambor  <mjambor@suse.cz>

	* tree-switch-conversion.c: Included timevar.h
	(pass_convert_switch): Added a timevar id (TV_TREE_SWITCH_CONVERSION).

	* timevar.def: Added TV_TREE_SWITCH_CONVERSION.

From-SVN: r137349
2008-07-02 11:59:34 +02:00
Xinliang David Li c269919028 tree-call-cdce.c: New file.
2008-06-04  Xinliang David Li  <davidxl@google.com>

	* tree-call-cdce.c: New file. 
	(cond_dead_built_in_calls): New static variable.
	(input_domain): New struct.
	(check_pow): New function.
	(check_builtin_call): Ditto.
	(check_target_format): Ditto.
	(is_call_dce_candidate): Ditto.
	(gen_one_condition): Ditto.
	(gen_conditions_for_domain): Ditto.
	(get_domain): Ditto.
	(gen_conditions_for_pow_cst_base): Ditto.
	(gen_conditions_for_pow_int_base): Ditto.
	(gen_conditions_for_pow): Ditto.
	(get_no_error_domain): Ditto.
	(gen_shrink_wrap_conditions): Ditto.
	(shrink_wrap_one_built_in_call): Ditto.
	(shink_wrap_conditional_dead_built_in_calls): Ditto.
	(tree_call_cdce): Ditto.
	(gate_call_cdce): Ditto.
	(pass_call_cdce): New gimple pass.
	* passes.c: (init_optimization_passes): New pass.
	* tree-pass.h: New pass declaration.
	* opts.c (decode_options): New flag setting.
	* common.opt: Add -ftree-builtin-call-dce flag.
	* Makefile.in: Add new source file.
	* tempvar.def: New tv_id.
	* doc/invoke.texi (-ftree-builtin-call-dce): New flag.

2008-06-04  Xinliang David Li  <davidxl@google.com>
	* gcc.dg/cdce1.c: New test.
	* gcc.dg/cdce2.c: Ditto.
	* g++.dg/cdce3.C: Ditto.

From-SVN: r136374
2008-06-04 21:49:45 +00:00
Richard Sandiford cc806ac109 dbgcnt.def (ra_byte_scan): Added.
2008-04-24  Richard Sandiford  <rsandifo@nildram.co.uk>
	    Kenneth Zadeck <zadeck@naturalbridge.com>

	* dbgcnt.def (ra_byte_scan): Added.
	* dbgcnt.c (dbg_cnt): Added code to print message to dump_file
	when the last hit happens for a counter.  
	* timevar.def (TV_DF_BYTE_LR): New variable.
	* tree-pass.h (pass_fast_rtl_byte_dce): New pass.
	* passes.c (pass_fast_rtl_byte_dce): New pass.
	* fwprop.c (update_df): Added mode to call df_ref_create.
	Renamed DF_REF_WIDTH and DF_REF_OFFSET to DF_REF_EXTRACT_WIDTH and
	DF_REF_EXTRACT_OFFSET.
	* df.h (DF_BYTE_LR, DF_BYTE_LR_BB_INFO, DF_BYTE_LR_IN, 
	DF_BYTE_LR_OUT, df_byte_lr): New macro.
	(df_mm): New enum.
	(df_ref_extract): Added mode field.
	(DF_REF_WIDTH, DF_REF_OFFSET) Renamed to DF_REF_EXTRACT_WIDTH and
	DF_REF_EXTRACT_OFFSET.
	(DF_REF_EXTRACT_MODE): New macro.
	(df_byte_lr_bb_info): New structure.
	(df_print_byte_regset, df_compute_accessed_bytes, 
	df_byte_lr_add_problem, df_byte_lr_get_regno_start,
	df_byte_lr_get_regno_len, df_byte_lr_simulate_defs,
	df_byte_lr_simulate_uses,
	df_byte_lr_simulate_artificial_refs_at_top,
	df_byte_lr_simulate_artificial_refs_at_end,
	df_compute_accessed_bytes): New function.
	(df_ref_create): Add parameter.
	(df_byte_lr_get_bb_info): New inline function.
	* df-scan.c (df_ref_record, df_uses_record,
	df_ref_create_structure): Added mode parameter.
	(df_ref_create, df_notes_rescan, df_ref_record, df_def_record_1, 
	df_defs_record, df_uses_record, df_get_conditional_uses,
	df_get_call_refs, df_insn_refs_collect, df_bb_refs_collect, 
	df_entry_block_defs_collect, df_exit_block_uses_collect):
	Added mode parameter to calls to df_ref_record, df_uses_record,
	df_ref_create_structure.
       	(df_ref_equal_p, df_ref_compare): Added test for modes.
	(df_ref_create_structure): Added code to set mode.  Renamed
	DF_REF_WIDTH and DF_REF_OFFSET to DF_REF_EXTRACT_WIDTH and
	DF_REF_EXTRACT_OFFSET.
	* df-core.c (df_print_byte_regset): New function.
	* df-byte-scan.c: New file.
	* df-problems.c (df_rd_transfer_function): Removed unnecessary
	calls to BITMAP_FREE.  
	(df_byte_lr_problem_data, df_problem problem_BYTE_LR): New structure.
	(df_byte_lr_get_regno_start, df_byte_lr_get_regno_len,
	df_byte_lr_set_bb_info, df_byte_lr_free_bb_info, 
	df_byte_lr_check_regs, df_byte_lr_expand_bitmap, 
	df_byte_lr_alloc, df_byte_lr_reset, df_byte_lr_bb_local_compute,
	df_byte_lr_local_compute, df_byte_lr_init,
	df_byte_lr_confluence_0, df_byte_lr_confluence_n, 
	df_byte_lr_transfer_function, df_byte_lr_free, 
	df_byte_lr_top_dump, df_byte_lr_bottom_dump,
	df_byte_lr_add_problem, df_byte_lr_simulate_defs, 
	df_byte_lr_simulate_uses,
	df_byte_lr_simulate_artificial_refs_at_top,
	df_byte_lr_simulate_artificial_refs_at_end): New function.
	* dce.c (byte_dce_process_block): New function.
	(dce_process_block): au is now passed in rather than computed
	locally.  Changed loops that look at artificial defs to not look
	for conditional or partial ones, because there never are any.  
	(fast_dce): Now is able to drive byte_dce_process_block or 
	dce_process_block depending on the kind of dce being done.
	(rest_of_handle_fast_dce): Add parameter to fast_dce.
	(rest_of_handle_fast_byte_dce): New function.
	(rtl_opt_pass pass_fast_rtl_byte_dce): New pass.
	* Makefile.in (df-byte-scan.o, debugcnt.o): Added dependencies.




Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com>

From-SVN: r134523
2008-04-21 18:55:13 +00:00
Richard Guenther 6751444978 Makefile.in (OBJS-common): Add tree-ssa-phiprop.o
2008-03-12  Richard Guenther  <rguenther@suse.de>

	* Makefile.in (OBJS-common): Add tree-ssa-phiprop.o
	(tree-ssa-phiprop.o): Copy dependencies from tree-ssa-forwprop.o.
	* timevar.def (TV_TREE_PHIPROP): Add.
	* tree-ssa-phiprop.c: Split from tree-ssa-forwprop.c, added
	pass description.  Use TV_TREE_PHIPROP.
	* tree-ssa-forwprop.c: Remove phiprop code.

From-SVN: r133140
2008-03-12 12:15:41 +00:00
Sebastian Pop dea61d9282 invoke.texi: Document -ftree-loop-distribution.
* doc/invoke.texi: Document -ftree-loop-distribution.
	* tree-loop-distribution.c: New.
	* tree-pass.h (pass_loop_distribution): New.
	* graphds.h (struct graph): Add htab_t indices.
	* timevar.def (TV_TREE_LOOP_DISTRIBUTION): New.
	* tree-vectorizer.c (rename_variables_in_loop): Extern.
	(slpeel_tree_duplicate_loop_to_edge_cfg): Init PENDING_STMT to NULL.
	* tree-vectorizer.h (tree_duplicate_loop_on_edge): Declared.
	* tree-data-ref.c (debug_data_dependence_relations): New.
	(dump_data_dependence_relation): Also print data references.
	(free_data_ref): Extern.
	(same_access_functions): Moved...
	(find_vertex_for_stmt): Renamed rdg_vertex_for_stmt.
	(dump_rdg_vertex, debug_rdg_vertex, dump_rdg_component,
	debug_rdg_component, dump_rdg, debug_rdg, dot_rdg_1, dot_rdg,
	struct rdg_vertex_info, rdg_vertex_for_stmt): New.
	(create_rdg_edge_for_ddr, create_rdg_vertices): Cleaned up.
	(stmts_from_loop): Skip LABEL_EXPR.
	(hash_stmt_vertex_info, eq_stmt_vertex_info, hash_stmt_vertex_del): New.
	(build_rdg): Initialize rdg->indices htab.
	(free_rdg, stores_from_loop, ref_base_address,
	rdg_defs_used_in_other_loops_p, have_similar_memory_accesses,
	have_similar_memory_accesses_1, ref_base_address_1,
	remove_similar_memory_refs): New.
	* tree-data-ref.h: Depend on tree-chrec.h.
	(debug_data_dependence_relations, free_data_ref): Declared.
	(same_access_functions): ... here.
	(ddr_is_anti_dependent, ddrs_have_anti_deps, ddr_dependence_level): New.
	(struct rdg_vertex): Add has_mem_write and has_mem_reads.
	(RDGV_HAS_MEM_WRITE, RDGV_HAS_MEM_READS, RDG_STMT,
	RDG_MEM_WRITE_STMT, RDG_MEM_READS_STMT): New.
	(dump_rdg_vertex, debug_rdg_vertex, dump_rdg_component,
	debug_rdg_component, dump_rdg, debug_rdg, dot_rdg,
	rdg_vertex_for_stmt): Declared.
	(struct rdg_edge): Add level.
	(RDGE_LEVEL): New.
	(free_rdg, stores_from_loop, remove_similar_memory_refs,
	rdg_defs_used_in_other_loops_p, have_similar_memory_accesses): Declared.
	(rdg_has_similar_memory_accesses): New.
	* tree-vect-analyze.c: Remove unused static decls.
	* lambda.h (dependence_level): New.
	* common.opt (ftree-loop-distribution): New.
	* tree-flow.h (mark_virtual_ops_in_bb, 
	slpeel_tree_duplicate_loop_to_edge_cfg,
	rename_variables_in_loop): Declared.
	* Makefile.in (TREE_DATA_REF_H): Depend on tree-chrec.h.
	(OBJS-common): Add tree-loop-distribution.o.
	(tree-loop-distribution.o): New rule.
	* tree-cfg.c (mark_virtual_ops_in_bb): New.
	(mark_virtual_ops_in_region): Use mark_virtual_ops_in_bb.
	* passes.c (init_optimization_passes): Schedule pass_loop_distribution.

	* testsuite/gcc.dg/tree-ssa/ldist-{1..12}.c: New.

From-SVN: r132745
2008-02-28 12:37:24 +00:00
Zdenek Dvorak 5f40b3cbe2 tree-parloops.c: New file.
* tree-parloops.c: New file.
	* tree-ssa-operands.h (free_stmt_operands): Declare.
	* tree-ssa-loop-manip.c (split_loop_exit_edge): Return the new basic
	block.
	* tree-pass.h (pass_parallelize_loops): Declare.
	* omp-low.c (expand_omp_parallel, expand_omp_for): Update SSA form for
	virtual operands.
	(build_omp_regions_1): Allow analysing just a single OMP region and
	its subregions.
	( build_omp_regions_root, omp_expand_local): New functions.
	(build_omp_regions): Add argument to build_omp_regions_1 call.
	* builtins.def (DEF_GOMP_BUILTIN): Initialize OMP builtins when
	autoparallelization is run.
	* timevar.def (TV_TREE_PARALLELIZE_LOOPS): New.
	* tree-ssa-loop.c (gate_tree_parallelize_loops, tree_parallelize_loops,
	pass_parallelize_loops): New.
	* common.opt (ftree-parallelize-loops): New.
	* tree-flow.h (omp_expand_local, tree_duplicate_sese_tail,
	parallelize_loops): Declare.
	(add_phi_args_after_copy, split_loop_exit_edge): Declaration changed.
	* Makefile.in (tree-parloops.o): Added.
	* tree-cfg.c (add_phi_args_after_copy_edge, tree_duplicate_sese_tail):
	New functions.
	(add_phi_args_after_copy_bb): Use add_phi_args_after_copy_edge.
	(add_phi_args_after_copy): Call add_phi_args_after_copy_edge for
	one extra edge as well.
	(tree_duplicate_sese_region): Add argument to add_phi_args_after_copy.
	Use VEC_free to free doms vector.
	(move_block_to_fn): Update loop info. Remove phi nodes for virtual
	operands.  Recompute operand caches in the new function.
	(move_sese_region_to_fn): Update loop info.
	* passes.c (init_optimization_passes): Add pass_parallelize_loops.
	* tree-ssa-operands.c (free_stmt_operands): New function.

	* doc/passes.texi: Document autoparallelization.
	* doc/invoke.texi (-ftree-parallelize-loops): New option.

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

From-SVN: r128517
2007-09-15 21:53:45 +00:00
Daniel Berlin 758137cd60 timevar.def: Add TV_CALL_CLOBBER, TV_FLOW_SENSITIVE, TV_FLOW_INSENSITIVE.
2007-07-28  Daniel Berlin  <dberlin@dberlin.org>

	* timevar.def: Add TV_CALL_CLOBBER, TV_FLOW_SENSITIVE,
	TV_FLOW_INSENSITIVE.

	* tree-ssa-alias.c (compute_call_clobbered): Push/pop
	TV_CALL_CLOBBER.
	(compute_flow_sensitive_aliasing): Ditto for TV_FLOW_SENSITIVE.
	(compute_flow_insensitive_aliasing): Ditto for
	TV_FLOW_INSENSITIVE.

From-SVN: r127013
2007-07-28 07:55:10 +00:00
Nick Clifton 9dcd6f09a3 Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page.
From-SVN: r126948
2007-07-26 08:37:01 +00:00
Richard Guenther 18d0801470 re PR tree-optimization/15353 ([tree-ssa] Merge two "if"s if one subsumes the other.)
2007-06-12  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/15353
	PR tree-optimization/31657
	* passes.c (init_optimization_passes): Add pass_tree_ifcombine.
	* timevar.def: Add TV_TREE_IFCOMBINE.
	* tree-pass.h (pass_tree_ifcombine): Declare.
	* tree-ssa-ifcombine.c: New file.
	* tree-ssa-phiopt.c (blocks_in_phiopt_order): Export.
	* tree-flow.h (blocks_in_phiopt_order): Declare.
	* Makefile.in (OBJS-common): Add tree-ssa-ifcombine.o.
	(tree-ssa-ifcombine.o): New dependencies.

	* gcc.c-torture/execute/20070424-1.c: New testcase.
	* gcc.dg/tree-ssa/ssa-ifcombine-1.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ifcombine-2.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ifcombine-3.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ifcombine-4.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ifcombine-5.c: Likewise.

From-SVN: r125644
2007-06-12 12:06:19 +00:00
Daniel Berlin 6fb5fa3cbc Merge dataflow branch into mainline
From-SVN: r125624
2007-06-11 18:02:15 +00:00
Zdenek Dvorak bbc8a8dc0d passes.texi: Document predictive commoning.
* doc/passes.texi: Document predictive commoning.
	* doc/invoke.texi (-fpredictive-commoning): Document.
	* opts.c (decode_options): Enable flag_predictive_commoning on -O3.
	* tree-ssa-loop-im.c (get_lsm_tmp_name): Export.  Allow
	adding indices to the generated name.
	(schedule_sm): Pass 0 to get_lsm_tmp_name.
	* tree-ssa-loop-niter.c (stmt_dominates_stmt_p): Export.
	* tree-pretty-print.c (op_symbol_1): Renamed to ...
	(op_symbol_code): ... and exported.
	(dump_omp_clause, op_symbol): Use op_symbol_code
	instead of op_symbol_1.
	* tree-pass.h (pass_predcom): Declare.
	* timevar.def (TV_PREDCOM): New timevar.
	* tree-ssa-loop.c (run_tree_predictive_commoning,
	gate_tree_predictive_commoning, pass_predcom): New.
	* tree-data-ref.c (find_data_references_in_loop): Find the
	references in dominance order.
	(canonicalize_base_object_address): Ensure that the result has
	pointer type.
	(dr_analyze_innermost): Export.
	(create_data_ref): Code to fail for references with invariant
	address moved ...
	(find_data_references_in_stmt): ... here.
	* tree-data-ref.h (dr_analyze_innermost): Declare.
	* tree-affine.c: Include tree-gimple.h and hashtab.h.
	(aff_combination_find_elt, name_expansion_hash,
	name_expansion_eq, tree_to_aff_combination_expand,
	double_int_constant_multiple_p, aff_combination_constant_multiple_p):
	New functions.
	* tree-affine.h (aff_combination_constant_multiple_p,
	tree_to_aff_combination_expand): Declare.
	* tree-predcom.c: New file.
	* common.opt (fpredictive-commoning): New option.
	* tree-flow.h (op_symbol_code, tree_predictive_commoning,
	stmt_dominates_stmt_p, get_lsm_tmp_name): Declare.
	* Makefile.in (tree-predcom.o): Add.
	(tree-affine.o): Add TREE_GIMPLE_H dependency.
	* passes.c (init_optimization_passes):  Add dceloop after
	copy propagation in loop optimizer.  Add predictive commoning
	to loop optimizer passes.

	* gcc.dg/tree-ssa/predcom-1.c: New test.
	* gcc.dg/tree-ssa/predcom-2.c: New test.
	* gcc.dg/tree-ssa/predcom-3.c: New test.
	* gcc.dg/tree-ssa/predcom-4.c: New test.
	* gcc.dg/tree-ssa/predcom-5.c: New test.
	* gcc.dg/vect/dump-tree-dceloop-pr26359.c: Test dceloop2 dumps.

From-SVN: r125030
2007-05-24 16:09:26 +00:00
Sebastian Pop 3d8864c06f loop.texi: Document the Omega linear constraints solver.
* doc/loop.texi: Document the Omega linear constraints solver.
	* doc/invoke.texi: Document -fcheck-data-deps, omega-max-vars,
	omega-max-geqs, omega-max-eqs, omega-max-wild-cards, 
	omega-hash-table-size, omega-max-keys, and 
	omega-eliminate-redundant-constraints.
	* tree-pass.h (pass_check_data_deps): Declared.
	* omega.c: New.
	* omega.h: New.
	* timevar.def (TV_CHECK_DATA_DEPS): Declared.
	* tree-ssa-loop.c (check_data_deps, gate_check_data_deps, 
	pass_check_data_deps): New.
	* tree-data-ref.c (init_data_ref): Remove declaration.
	(dump_data_dependence_relation): Dump DDR_INNER_LOOP.
	(analyze_array): Renamed init_array_ref, move up initializations.
	(init_data_ref): Renamed init_pointer_ref.  Moved before its call.
	Removed arguments that are set to NULL.
	(analyze_indirect_ref): Correct indentation, correct call to 
	init_pointer_ref.
	(object_analysis): Call init_array_ref instead of analyze_array.
	(initialize_data_dependence_relation): Initialize DDR_INNER_LOOP.
	(access_functions_are_affine_or_constant_p): Use DR_ACCESS_FNS instead
	of DR_ACCESS_FNS_ADDR.
	(init_omega_eq_with_af, omega_extract_distance_vectors, 
	omega_setup_subscript, init_omega_for_ddr_1, init_omega_for_ddr,
	ddr_consistent_p): New.
	(compute_affine_dependence): Check consistency of ddrs when 
	flag_check_data_deps is passed.
	(analyze_all_data_dependences): Uncomment.
	(tree_check_data_deps): New.
	* tree-data-ref.h: Include omega.h.
	(DR_ACCESS_FNS_ADDR): Removed.
	(data_dependence_relation): Add inner_loop.
	(DDR_INNER_LOOP): New.
	* common.opt (fcheck-data-deps): New.
	* tree-flow.h (tree_check_data_deps): Declare.
	* Makefile.in (TREE_DATA_REF_H): Depend on omega.h.
	(OBJS-common): Depend on omega.o.
	(omega.o): Define.
	* passes.c (pass_check_data_deps): Scheduled.
	* params.def (PARAM_OMEGA_MAX_VARS, PARAM_OMEGA_MAX_GEQS, 
	PARAM_OMEGA_MAX_EQS, PARAM_OMEGA_MAX_WILD_CARDS,
	PARAM_OMEGA_HASH_TABLE_SIZE, PARAM_OMEGA_MAX_KEYS,
	PARAM_VECT_MAX_VERSION_CHECKS,
	PARAM_OMEGA_ELIMINATE_REDUNDANT_CONSTRAINTS): New.

From-SVN: r122749
2007-03-09 12:39:49 +00:00
Ian Lance Taylor e53a16e75f lower-subreg.c: New file.
gcc/:
	* lower-subreg.c: New file.
	* rtl.def (CONCATN): Define.
	* passes.c (init_optimization_passes): Add pass_lower_subreg and
	pass_lower_subreg2.
	* emit-rtl.c (update_reg_offset): New static function, broken out
	of gen_rtx_REG_offset.
	(gen_rtx_REG_offset): Call update_reg_offset.
	(gen_reg_rtx_offset): New function.
	* regclass.c: Revert patch of 2006-03-05, restoring
	reg_scan_update.
	(clear_reg_info_regno): New function.
	* dwarf2out.c (concatn_loc_descriptor): New static function.
	(loc_descriptor): Handle CONCATN.
	* common.opt (fsplit_wide_types): New option.
	* opts.c (decode_options): Set flag_split_wide_types when
	optimizing.
	* timevar.def (TV_LOWER_SUBREG): Define.
	* rtl.h (gen_reg_rtx_offset): Declare.
	(reg_scan_update): Declare.
	* regs.h (clear_reg_info_regno): Declare.
	* tree-pass.h (pass_lower_subreg): Declare.
	(pass_lower_subreg2): Declare.
	* doc/invoke.texi (Option Summary): List -fno-split-wide-types.
	(Optimize Options): Add -fsplit-wide-types to -O1 list.  Document
	-fsplit-wide-types.
	* doc/rtl.texi (Regs and Memory): Document concat and concatn.
	* Makefile.in (OBJS-common): Add lower-subreg.o.
	(lower-subreg.o): New target.
gcc/testsuite/:
	* gcc.dg/lower-subreg-1.c (test): New test.

From-SVN: r121453
2007-02-01 01:09:35 +00:00
Diego Novillo 38635499e9 [multiple changes]
2006-12-11  Diego Novillo  <dnovillo@redhat.com>

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

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

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

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

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

	* params.h (GLOBAL_VAR_THRESHOLD): Remove.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

From-SVN: r119760
2006-12-11 20:48:51 -05:00
Paolo Bonzini a52b023a5f fwprop.c: New file.
2006-11-03  Paolo Bonzini  <bonzini@gnu.org>
            Steven Bosscher  <stevenb.gcc@gmail.com>

        * fwprop.c: New file.
        * Makefile.in: Add fwprop.o.
        * tree-pass.h (pass_rtl_fwprop, pass_rtl_fwprop_with_addr): New.
        * passes.c (init_optimization_passes): Schedule forward propagation.
        * rtlanal.c (loc_mentioned_in_p): Support NULL value of the second
        parameter.
        * timevar.def (TV_FWPROP): New.
        * common.opt (-fforward-propagate): New.
        * opts.c (decode_options): Enable forward propagation at -O2.
        * gcse.c (one_cprop_pass): Do not run local cprop unless touching jumps.
        * cse.c (fold_rtx_subreg, fold_rtx_mem, fold_rtx_mem_1, find_best_addr,
        canon_for_address, table_size): Remove.
        (new_basic_block, insert, remove_from_table): Remove references to
        table_size.
        (fold_rtx): Process SUBREGs and MEMs with equiv_constant, make
        simplification loop more straightforward by not calling fold_rtx
        recursively.
        (equiv_constant): Move here a small part of fold_rtx_subreg,
        do not call fold_rtx.  Call avoid_constant_pool_reference
        to process MEMs.
        * recog.c (canonicalize_change_group): New.
        * recog.h (canonicalize_change_group): New.

        * doc/invoke.texi (Optimization Options): Document fwprop.
        * doc/passes.texi (RTL passes): Document fwprop.


Co-Authored-By: Steven Bosscher <stevenb.gcc@gmail.com>

From-SVN: r118475
2006-11-04 08:36:45 +00:00
Razya Ladelsky 8cd37d0b6c [multiple changes]
2006-05-04  Leehod Baruch  <leehod@il.ibm.com>

        * see.c: New file.
        * Makefile.in (OBJS-common): Add see.o.
        (see.o): Add dependencies.
        * common.opt (fsee): New flag for the see optimization was added.
        * opts.c (flag_see): Initialized.
        * passes.c (init_optimization_passes, pass_see): New pass.
        * rtl.h (see_main): Declaration as extern.
        * timevar.def (TV_SEE): New.
        * tree-pass.h (pass_see): Declaration as extern.
        * invoke.texi (-fsee): Document.
        * recog.c (validate_simplify_insn): New function.
        * recog.h (validate_simplify_insn): Declaration as extern.
        * df-problems.c (df_chain_dump): Check for NULL.

2006-05-04  Kenneth Zadeck <zadeck@naturalbridge.com>
            Daniel Berlin  <dberlin@dberlin.org>

        * cfgrtl.c (insert_insn_bb_end_new): New function.
        * basic-block.h (insert_insn_bb_end_new): Declaration as extern.

2006-05-04  Leehod Baruch  <leehod.baruch@weizmann.ac.il>

        * df.h (struct web_entry): Moved from web.c.
        (union_defs): Declaration as extern.
        (unionfind_root): Likewise.
        (unionfind_union): Likewise.
        * web.c (struct web_entry): Moved to df.h.
        (unionfind_root): Remove static declaration.
        (unionfind_union): Likewise.
        (union_defs): Likewise and generalize to use callback function.
        (web_main): Update arguments for union_defs function call.

From-SVN: r113518
2006-05-04 09:19:02 +00:00
Zdenek Dvorak 74c96e0c14 dominance.c: Include timevar.h.
* dominance.c: Include timevar.h.
	(calculate_dominance_info): Use TV_DOMINANCE.
	* timevar.def (TV_DOMINANCE): New timevar.
	* Makefile.in (dominance.o): Add TIMEVAR_H dependency.

From-SVN: r113075
2006-04-19 12:48:35 +00:00
Jeff Law b6313dcf96 timevar.def (TV_TREE_PHI_CPROP): New timevar.
* timevar.def (TV_TREE_PHI_CPROP): New timevar.
        * tree-ssa-dom.c (pass_phi_only_cprop): Use it.

From-SVN: r112466
2006-03-28 12:10:11 -07:00
Zdenek Dvorak 1768461812 invoke.texi (-fprefetch-loop-arrays, [...]): Document.
* doc/invoke.texi (-fprefetch-loop-arrays, -fprefetch-loop-arrays-rtl):
	Document.
	* tree-ssa-loop-niter.c (number_of_iterations_ne,
	number_of_iterations_lt, number_of_iterations_cond): Remember the shape
	of the ending condition.
	* tree-ssa-loop-manip.c: Include params.h.
	(build_if_stmt, can_unroll_loop_p, determine_exit_conditions,
	tree_unroll_loop): New functions.
	* tree-pass.h (pass_loop_prefetch): Declare.
	* loop.c (rest_of_handle_loop_optimize): Test for
	-fprefetch-loop-arrays-rtl.
	* tree-scalar-evolution.h (affine_iv): Moved to tree-flow.h.
	* timevar.def (TV_TREE_PREFETCH): New timevar.
	* tree-ssa-loop.c (tree_ssa_loop_prefetch, gate_tree_ssa_loop_prefetch,
	pass_loop_prefetch): New.
	* tree-cfgcleanup.c: Include tree-scalar-evolution.h.
	(cleanup_tree_cfg_loop): Call scev_reset.
	* common.opt (fprefetch-loop-arrays-rtl): Add.
	* tree-ssa-loop-prefetch.c: New file.
	* tree-outof-ssa.c (struct value_expr_d): Add expr_vars field.
	(new_temp_expr_table): Initialize expr_vars.
	(free_temp_expr_table): Cleanup expr_vars.
	(check_replaceable, find_replaceable_in_bb): Prevent accumulating
	expressions from being merged into one.
	* tree-flow.h (affine_iv): Moved from tree-scalar-evolution.h.
	(struct tree_niter_desc): Add control, bound and cmp fields.
	(tree_ssa_prefetch_arrays, can_unroll_loop_p, tree_unroll_loop):
	Declare.
	* Makefile.in (tree-ssa-loop-prefetch.o): Add.
	(tree-cfgcleanup.o): Add SCEV_H dependency.
	(tree-ssa-loop-manip.o): Add PARAMS_H dependency.
	* passes.c (init_optimization_passes): Add pass_loop_prefetch.

From-SVN: r110964
2006-02-14 12:22:11 +00:00
Gabor Loki 38109dab82 rtl-factoring.c: Add sequence abstraction algorithm.
2006-01-16  Gabor Loki <loki@gcc.gnu.org>

	* rtl-factoring.c : Add sequence abstraction algorithm.
	* cfgcleanup.c (outgoing_edges_match): Extra checks.
	(try_crossjump_to_edge): Avoid deleting preserve label when redirecting
	ABNORMAL edges.
	(block_has_preserve_label): New function.
	* common.opt: Register new pass.
	* Makefile.in: Ditto.
	* passes.c: Ditto.
	* timevar.def: Ditto.
	* tree-pass.h: Ditto.
	* emit-rtl.c (make_jump_insn_raw): Remove forward decl.
	* rtl.h (make_jump_insn_raw): Add forward decl.
	* doc/invoke.texi: Add documentation for
																	                  -frtl-abstract-sequences.

From-SVN: r109750
2006-01-16 15:56:47 +00:00
Daniel Berlin 4ee00913ca tree-ssa-structalias.c (process_constraint): Remove code to transform addressofs into scalar.
2005-12-11  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-structalias.c (process_constraint): Remove code to
	transform addressofs into scalar.
	(create_variable_info_for): In whole-program IPA, globals don't
	point to ANYTHING by default.

2005-12-11  Daniel Berlin  <dberlin@dberlin.org>

	* timevar.def (TV_IPA_PTA): New.
	* tree-pass.h (pass_ipa_pta): New
	* tree-ssa-structalias.c: Include cgraph.h
	(in_ipa_mode): New.
	(predbitmap_obstack): New.
	(EXECUTE_IF_IN_NONNULL_BITMAP): New.
	(struct constraint_stats): Add num_edges.
	(new_var_info): Don't call bitmap_clear.
	(struct constraint_edge): Update docs.
	(new_constraint_edge): Remove src param.
	(struct constraint_graph): Add zero_weight_succs,
	zero_weight_preds.  Update docs.
	(constraint_expr_equal): Reformat.
	(constraint_edge_equal): Update for removal of src.
	(constraint_edge_less): Ditto.
	(constraint_edge_vec_find): Ditto.
	(erase_graph_self_edge): Update for removal of src and and zero
	weight bitmap.
	(clear_edges_for_node): Ditto.
	(add_graph_edge): Ditto.
	(get_graph_weights): Ditto.
	(allocate_graph_weights): Ditto.
	(merge_graph_nodes): Ditto.
	(int_add_graph_edge): Ditto.
	(valid_graph_edge): Ditto.
	(valid_weighted_graph_edge): Ditto.
	(build_constraint_graph): Ditto.
	(scc_visit): Ditto.
	(collapse_nodes): Ditto.
	(process_unification_queue): Ditto.
	(topo_visit): Ditto.
	(solve_graph): Ditto.
	(do_structure_copy): Ditto.
	(perform_var_substitution): Ditto.
	Init and release obstack.
	(handle_ptr_arith): Try to resolve directly.
	(find_func_aliases): Don't call update_alias_info here
	Handle RETURN_EXPR, and CALL_EXPR's in IPA mode.
	(do_sd_constraint): Add code for propagating faster.
	Update.
	(do_ds_constraint): Ditto.
	(count_num_arguments): New function.
	(create_function_info_for): Ditto.
	(create_variable_info_for): Handle FUNCTION_DECL.
	(intra_create_variable_infos): Use make_constraint_to_anything.
	(init_alias_vars): Init obstacks here.
	(need_to_solve): Handle zero weight graph changes.
	(compute_points_to_sets): Call update_alias_info here.
	(delete_points_to_sets): Free zero weight preds/succs here.
	(gate_ipa_pta): New.
	(ipa_pta_execute): New

2005-12-11  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-structalias.c (var_anyoffset): Removed.
	(anyoffset_tree): Ditto.
	(anyoffset_id): Ditto.
	(do_deref): Take vector of constraints, no return value.
	Update to work on vector.		 
	(get_constraint_for): Ditto.
	(get_constraint_for_component_ref): Ditto.
	(do_structure_copy): Ditto.
	(handle_ptr_arith): Ditto.
	(find_func_aliases): Ditto.
	(set_uids_in_ptset): Remove anyoffset handling.
	(init_base_vars): Ditto.

From-SVN: r108384
2005-12-11 22:44:19 +00:00
Razya Ladelsky 19734dd84e Interprocedural constant propagation.
From-SVN: r102626
2005-08-01 07:47:25 +00:00
Daniel Berlin 6a9a79a866 Makefile.in: Removed tree-promote-statics.c
2005-07-19  Danny Berlin <dberlin@dberlin.org>
	    Kenneth Zadeck <zadeck@naturalbridge.com>

	* Makefile.in: Removed tree-promote-statics.c
	* tree-promote-statics.c: Removed.
	* common.opt: Removed flag-promote-statics.
	* opts.c: Ditto.
	* passes.c: Removed tree-promote-statics pass.
	* tree-pass.h: Ditto.
	* timevar.def: Removed TV_PROMOTE_STATICS.


2005-07-19  Danny Berlin <dberlin@dberlin.org>
	    Kenneth Zadeck <zadeck@naturalbridge.com>

	* gcc.dg/tree-ssa/sra-2.c: Changed back to -O1 and added xfail.

Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com>

From-SVN: r102165
2005-07-19 18:46:15 +00:00
Daniel Berlin ea900239f4 Makefile.in: Added rules for ipa-pure-const.c...
2005-07-16  Danny Berlin <dberlin@dberlin.org>
	    Kenneth Zadeck <zadeck@naturalbridge.com>

	* Makefile.in: Added rules for ipa-pure-const.c, ipa-reference.c,
	ipa-reference.h, ipa-utils.c, ipa-utils.h, ipa-type-escape.c,
	ipa-type-escape.h, tree-promote-statics.c
	* ipa-pure-const.c, ipa-reference.c, ipa-reference.h, ipa-utils.c,
	ipa-utils.h, ipa-type-escape.c, ipa-type-escape.h,
	tree-promote-statics.c: new files.
	* alias.c: (nonlocal_mentioned_p_1, nonlocal_mentioned_p,
	nonlocal_referenced_p_1, nonlocal_referenced_p, nonlocal_set_p_1,
	int nonlocal_set_p, mark_constant_function): Deleted.
	(rest_of_handle_cfg): Removed call to mark_constant_function.
        (nonoverlapping_component_refs_p): Added calls to support
	type based aliasing.
        * tree-ssa-alias.c (may_alias_p,
	compute_flow_insensitive_aliasing): Ditto.
	* calls.c (flags_from_decl_or_type): Removed reference to
	cgraph_rtl_info.
	(flags_from_decl_or_type): Support ECF_POINTER_NO_CAPTURE attribute.
	* c-common.c (handle_pointer_no_capture_attribute): New function
	and added pointer_no_capture attribute.
      	* c-typeck.c (convert_arguments): Make builtins tolerant of having
	too many arguments.  This is necessary for Spec 2000.
	* cgraph.h (const_function, pure_function): Removed.
	* common.opt: Added "fipa-pure-const", "fipa-reference",
	"fipa-type-escape", and "ftree-promote-static".
	* opts.c: Ditto.
	* passes.c: Added ipa and tree-promote-statics passes.
	* timevar.def: Added TV_IPA_PURE_CONST, TV_IPA_REFERENCE,
	TV_IPA_TYPE_ESCAPE, and TV_PROMOTE_STATICS.
	* tree.h: Support ECF_POINTER_NO_CAPTURE attribute.
	* tree-dfa.c (referenced_var_lookup_if_exists): New function.
	* tree-flow.h: Added exposed sra calls and addition of
	reference_vars_info field for FUNCTION_DECLS.
	* tree-pass.h: Added passes.
	* tree-sra.c: (sra_init_cache): New function.
	(sra_insert_before, sra_insert_after) Made public.
	(type_can_be_decomposed_p): Renamed from type_can_be_decomposed_p
	and made public.
	* tree-ssa-alias.c (dump_alias_stats): Added stats for type based
	aliasing. (may_alias_p): Added code to use type escape analysis to
	improve alias sets.
	* tree-ssa-operands.c (add_call_clobber_ops): Added parameter and
	code to prune clobbers of static variables based on information
	produced in ipa-reference pass.  Changed call clobbering so that
	statics are not marked as clobbered if the call does not clobber
	them.


2005-07-16  Danny Berlin <dberlin@dberlin.org>
	    Kenneth Zadeck <zadeck@naturalbridge.com>

	* gcc.dg/tree-ssa/ssa-dce-2.c: Changed dg-options to run at -O2
	since pure const detection cannot run at -O1 in c compiler.
	* gcc.dg/tree-ssa/20030714-1.c Changed scanning patterns because we
	can now optimize this case properly.
	* gcc.dg/tree-ssa/sra-2.c: Changed to -O3 and removed xfail
	because we now pass.
	* gcc.dg/vect/vect-92.c: Removed out of bounds array access.

Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com>

From-SVN: r102098
2005-07-16 18:56:53 +00:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Daniel Berlin 012309e6a8 tree-ssa-reassoc.o: New.
2005-06-06  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-reassoc.o: New.
	(OBJS-common): Add tree-ssa-reassoc.o
	* timevar.def: Add TV_TREE_REASSOC
	* tree-optimize.c (pass_reassoc): Add call.
	* tree-pass.h (pass_reassoc): Add.
	* tree-ssa-reassoc.c: New file.

From-SVN: r100671
2005-06-06 18:55:59 +00:00
Jan Hubicka 670cd5c514 Makefile.in (ipa-inline.o): Add COEVERAGE_H dependency.
* Makefile.in (ipa-inline.o): Add COEVERAGE_H dependency.
	* cgraph.c (cgraph_create_node): Reset estimated_growth.
	* cgraph.h (cgraph_global_info): Add estimated_growth.
	* ipa-inline.c: Include coverage.h
	(max_insns, max_count): New static variables.
	(cgraph_estimate_size_after_inlining): Cache the result.
	(cgraph_estimate_growth):
	* passes.c (rest_of_clean_state): Kill coverage_end_function.
	* timevar.def (TV_INLINE_HEURISTICS): New timevar.
	* tree-optimize.c (init_tree_optimization_passes): Move profiling before
	inlining.
	(ipa_passes): Initialize bitmaps.

	* gcc.dg/tree-prof/inliner-1.c: New.

2005-05-25  Janis Johnson  <janis187@us.ibm.com>

	* gcc.dg/tree-prof: New directory.
	* gcc.dg/tree-prof/tree-prof.exp: New.

From-SVN: r100144
2005-05-25 12:34:01 +00:00
Zdenek Dvorak 684aaf29c0 timevar.def (TV_SCEV_CONST): New timevar.
* timevar.def (TV_SCEV_CONST): New timevar.
	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_scev_cprop.
	* tree-pass.h (pass_scev_cprop): Declare.
	* tree-scalar-evolution.c (scev_const_prop): New function.
	* tree-scalar-evolution.h (scev_const_prop): Declare.
	* tree-ssa-loop.c (gate_scev_const_prop, pass_scev_cprop):
	New.
	* tree-cfg.c (replace_uses_by): Export.
	* tree-flow.h (replace_uses_by): Declare.

From-SVN: r99860
2005-05-17 20:28:30 +00:00
Zdenek Dvorak 8d18c628dd ggc-page.c (ggc_alloc_stat): Record amount of memory allocated.
* ggc-page.c (ggc_alloc_stat): Record amount of memory allocated.
	* ggc-zone.c (ggc_alloc_zone_1): Ditto.
	* timevar.c (timevar_ggc_mem_total): New variable.
	(GGC_MEM_BOUND): New constant.
	(get_time): Record ggc memory status.
	(timevar_accumulate): Accumulate amount of ggc memory.
	(timevar_print): Print consumption of ggc memory.
	* timevar.def (TV_FIND_REFERENCED_VARS, TV_TREE_REDPHI,
	TV_TREE_LOOP_BOUNDS, TV_TREE_LOOP_IVCANON, TV_TREE_VECTORIZATION,
	TV_TREE_LINEAR_TRANSFORM): Shorten strings to fit in 22 characters.
	* timevar.h (struct timevar_time_def): Add ggc_mem field.
	(timevar_ggc_mem_total): Declare.

From-SVN: r99848
2005-05-17 19:41:38 +00:00
Jeff Law fef0657c25 Makefile.in (OBJS-common): Add tree-ssa-uncprop.o.
* Makefile.in (OBJS-common): Add tree-ssa-uncprop.o.
	(tree-ssa-uncprop.o): Add dependencies.
	* tree-cfg.c (remove_useless_stmts_bb, remove_useless_stmts): Remove.
	* tree-flow.h (remove_useless_stmts): Remove prototype.
	* tree-outof-ssa.c (rewrite_out_of_ssa): Remove call to
	remove_useless_stmts.
	* timevar.def (TV_TREE_SSA_UNCPROP): New timevar.
	* tree-optimize.c (init_tree_optimization_passes): Add uncprop pass.
	* tree-pass.h (pass_uncprop): Declare.
	* tree-ssa-uncprop.c: New file.

From-SVN: r98066
2005-04-12 22:29:40 -06:00
Diego Novillo 0bca51f080 backport: copy-prop, incremental SSA updating of FUD chains and newly exposed symbols.
Merge from tree-cleanup-branch: VRP, store CCP, store
	    copy-prop, incremental SSA updating of FUD chains and
	    newly exposed symbols.

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

testsuite/ChangeLog

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

From-SVN: r97884
2005-04-08 21:37:54 -04:00
Daniel Berlin fa55525216 Makefile.in (tree-ssa-sink.o): New.
2005-03-01  Daniel Berlin <dberlin@dberlin.org>

	* Makefile.in (tree-ssa-sink.o): New.
	(OBJS-common): Add tree-ssa-sink.o.
	* common.opt: Add -ftree-sink
	* opts.c (decode_options): flag_tree_sink is set at O1 or higher.
	* timevar.def (TV_TREE_SINK): new timevar.
	* tree-flow.h (is_hidden_global_store): Prototype.
	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_sink_code.
	* tree-pass.h (pass_sink_code): New.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Move checking
	for non-obvious global store store to is_hidden_global_store, and
	call that new function.
	* tree-ssa-sink.c: New file.
	* doc/invoke.texi: Document -fdump-tree-sink and -ftree-sink.
	* doc/passes.texi: Document forward store motion.
	* testsuite/gcc.dg/tree-ssa/ssa-sink-1.c: New test
	* testsuite/gcc.dg/tree-ssa/ssa-sink-2.c: New test
	* testsuite/gcc.dg/tree-ssa/ssa-sink-3.c: New test
	* testsuite/gcc.dg/tree-ssa/ssa-sink-4.c: New test

From-SVN: r95750
2005-03-01 17:59:06 +00:00
Kazu Hirata 1e052c19d5 cfganal.c, [...]: Update copyright.
* cfganal.c, real.h, reorg.c, timevar.def, tree-ssa-ccp.c,
	config/alpha/alpha-protos.h, config/alpha/alpha.h,
	config/alpha/alpha.md, config/alpha/predicates.md,
	config/sparc/freebsd.h, config/sparc/netbsd-elf.h,
	config/sparc/sol2.h: Update copyright.

From-SVN: r94064
2005-01-22 12:53:25 +00:00
Kazu Hirata 23ab2e4e18 re PR tree-optimization/15349 ([tree-ssa] Merge two phi nodes.)
PR tree-optimization/15349
	* timevar.def (TV_TREE_MERGE_PHI): New.
	* tree-cfg.c (tree_forwarder_block_p): Add a new argument
	PHI_WANTED.
	(remove_forwarder_block, cleanup_forwarder_blocks): Adjust the
	calls to tree_forwarder_block_p.
	(remove_forwarder_block_with_phi, merge_phi_nodes,
	gate_merge_phi, pass_merge_phi): New.
	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_merge_phi.
	* tree-pass.h: Add an extern for pass_merge_phi;

	PR tree-optimization/15349
	* testsuite/gcc.dg/tree-ssa/pr15349.c: New.

From-SVN: r93977
2005-01-20 19:20:39 +00:00
Andrew Pinski 09e293df1d timevar.def (TV_TREE_REDPHI): New timevar.
2004-11-28  Andrew Pinski  <pinskia@physics.uc.edu>

        * timevar.def (TV_TREE_REDPHI): New timevar.
        * tree-ssa.c (pass_redundant_phi): Use TV_TREE_REDPHI for the tv id.

From-SVN: r91438
2004-11-28 16:03:40 -08:00
Jeff Law 87c111349f timevar.def (TV_TREE_LOOP_INIT, [...]): New timevars.
* timevar.def (TV_TREE_LOOP_INIT, TV_TREE_LOOP_FINI): New timevars.
        * tree-ssa-loop.c (pass_loop_init): Use TV_TREE_LOOP_INIT.
        (pass_loop_done): Use TV_TREE_LOOP_FINI.

From-SVN: r91333
2004-11-25 23:42:25 -07:00
Jeff Law ccbdbf0a4a cfgloop.h (struct loop): Remove unused "nodes" field.
* cfgloop.h (struct loop): Remove unused "nodes" field.
	* timevar.def (TV_TREE_LOOP_BOUNDS): New.
	* tree-data-ref.c (find_data_references_in_loop): Use get_loop_body
	instead of calling flow_bb_inside_loop_p for every basic block
	in the function.
	* tree-ssa-loop.c (pass_record_bounds): Use TV_TREE_LOOP_BOUNDS.

From-SVN: r89932
2004-10-31 20:24:44 -07:00
Steven Bosscher 30a80709c4 timevar.def (TV_FIND_REFERENCED_VARS): New.
* timevar.def (TV_FIND_REFERENCED_VARS): New.
	* tree-dfa.c (pass_referenced_var): Use it.

From-SVN: r89552
2004-10-25 21:18:15 +00:00
Zdenek Dvorak 92fc4a2f39 cfgloop.h (update_single_exits_after_duplication): Declare.
* cfgloop.h (update_single_exits_after_duplication): Declare.
	(loopify, split_loop_bb): Declaration changed.
	* cfgloopmanip.c (split_loop_bb): Take void * as an argument instead
	of rtx.
	(loopify): Added redirect_all_edges argument.
	(update_single_exits_after_duplication): Export.
	* loop-unswitch.c (unswitch_loop): Changed due to loopify change.
	* tree-flow.h (tree_duplicate_loop_to_header_edge,
	tree_ssa_loop_version): Declare.
	* tree-ssa-loop-manip.c (copy_phi_node_args, rename_variables,
	set_phi_def_stmts, tree_duplicate_loop_to_header_edge,
	lv_adjust_loop_header_phi, lv_adjust_loop_entry_edge,
	lv_update_pending_stmts, tree_ssa_loop_version): New functions.

	* tree-ssa-loop-unswitch.c: New file.
	* Makefile.in (tree-ssa-loop-unswitch.o): Add.
	* timevar.def (TV_TREE_LOOP_UNSWITCH): New timevar.
	* tree-flow.h (tree_ssa_unswitch_loops): Declare.
	* tree-optimize.c (init_tree_optimization_passes): Add pass_unswitch.
	* tree-pass.h (pass_unswitch): Declare.
	* tree-ssa-loop.c (tree_ssa_loop_unswitch,
	gate_tree_ssa_loop_unswitch, pass_unswitch): New pass.
	* doc/passes.texi: Documen tree level loop unswitching.

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

From-SVN: r87943
2004-09-23 12:21:31 +00:00
Daniel Berlin 599eabdb42 Makefile.in (tree-loop-linear.o): Added.
2004-09-08  Daniel Berlin  <dberlin@dberlin.org>

	* Makefile.in (tree-loop-linear.o): Added.
	(OBJS-common): Add tree-loop-linear.o
	* common.opt: New flag, ftree-loop-linear.
	* timevar.def: New timevar, TV_TREE_LOOP_LINEAR.
	* tree-flow.h: Add prototype for linear_transform_loops.
	* tree-optimize.c: Add linear transform after vectorization.
	* tree-pass.h: Add struct pass_linear_transform.
	* tree-ssa-loop.c: Add pass_linear_transform.
	* tree-loop-linear.c: New file.
	* lambda-code.c: gcc_assertify.
	(gcc_loop_to_lambda_loop): Handle all exit tests.
	Handle case where we have (invariant >= induction var).
	(find_induction_var_from_exit_cond): Ditto.

From-SVN: r87190
2004-09-08 15:28:56 +00:00
Zdenek Dvorak 8b11a64cd9 tree-ssa-loop-ivopts.c: New file.
* tree-ssa-loop-ivopts.c: New file.
	* Makefile.in (tree-ssa-loop-ivopts.c): Add.
	* cfgloop.h (target_avail_regs, target_res_regs, target_small_cost,
	target_pres_cost, target_spill_cost): Declare.
	* cfgloopanal.c (avail_regs, res_regs, small_cost, pres_cost,
	spill_cost): Renamed to ...
	(target_avail_regs, target_res_regs, target_small_cost,
	target_pres_cost, target_spill_cost): ... and exported.
	(init_set_costs, global_cost_for_size): Work with renamed variables.
	* common.opt (flag_ivopts): New flag.
	* expr.c (expand_expr_real_1): Handle SSA_NAME case.  Handle
	REF_ORIGINAL.
	* gimplify.c (struct gimplify_ctx): Add into_ssa field.
	(internal_get_tmp_var, gimplify_modify_expr, gimplify_expr): Support
	generating SSA form.
	(force_gimple_operand): New function.
	* timevar.def (TV_TREE_LOOP_IVOPTS): New timevar.
	* tree-cfg.c (stmt_bsi): New function.
	* params.def (PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND,
	PARAM_IV_MAX_CONSIDERED_USES): New.
	* tree-flow.h (stmt_bsi, tree_ssa_iv_optimize, split_loop_exit_edge,
	bsi_insert_on_edge_immediate_loop. standard_iv_increment_position,
	ip_end_pos, ip_normal_pos, force_gimple_operand): Declare.
	* tree-gimple.c (is_gimple_formal_tmp_var): Accept ssa names.
	* tree-nested.c (build_addr): Export.
	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_iv_optimize.
	* tree-pass.h (pass_iv_optimize): Declare.
	* tree-ssa-loop-im.c (for_each_index): Handle REALPART_EXPR and
	IMAGPART_EXPR.
	* tree-ssa-loop-manip.c (create_iv): Force the base to be acceptable
	as a phi node argument.
	(split_loop_exit_edge, bsi_insert_on_edge_immediate_loop,
	ip_end_pos, ip_normal_pos, standard_iv_increment_position): New
	functions.
	* tree-ssa-loop-niter.c (zero_p, unsigned_type_for): Export.
	* tree-ssa-loop.c (tree_ssa_loop_ivopts, gate_tree_ssa_loop_ivopts,
	pass_iv_optimize): New pass.
	* tree-ssa-operands.c (get_indirect_ref_operands): Handle REF_ORIGINAL.
	* tree-ssanames.c (release_ssa_name): Allow calling with var = NULL.
	* tree.c (build_int_cst_type, cst_and_fits_in_hwi): New functions.
	* tree.h (REF_ORIGINAL): New macro.
	(build_int_cst_type, unsigned_type_for, zero_p,
	cst_and_fits_in_hwi, build_addr): Declare.
	* doc/invoke.texi (-fivopts): Document.
	(PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND,
	PARAM_IV_MAX_CONSIDERED_USES): Document.
	* doc/passes.texi: Document induction variable optimizations pass.

	* gcc.dg/tree-ssa/loop-2.c: New test.
	* gcc.dg/tree-ssa/loop-3.c: New test.
	* gcc.dg/tree-ssa/loop-4.c: New test.
	* gcc.dg/tree-ssa/loop-5.c: New test.

From-SVN: r87100
2004-09-05 09:25:37 +00:00
Zdenek Dvorak 82b85a85c8 tree-ssa-loop-ivcanon.c: New file.
* tree-ssa-loop-ivcanon.c: New file.
	* tree-ssa-loop-manip.c (create_iv): New function.
	* Makefile.in (tree-ssa-loop-ivcanon.o): Add.
	(tree-ssa-loop.o, tree-ssa-loop-manip.o): Add SCEV_H dependency.
	* cfgloop.c (mark_single_exit_loops): New function.
	(verify_loop_structure): Verify single-exit loops.
	* cfgloop.h (struct loop): Add single_exit field.
	(LOOPS_HAVE_MARKED_SINGLE_EXITS): New constant.
	(mark_single_exit_loops): Declare.
	(tree_num_loop_insns): Declare.
	* cfgloopmanip.c (update_single_exits_after_duplication): New function.
	(duplicate_loop_to_header_edge): Use it.
	* common.opt (fivcanon): New flag.
	* timevar.def (TV_TREE_LOOP_IVCANON, TV_COMPLETE_UNROLL): New timevars.
	* tree-cfg.c (tree_find_edge_insert_loc): Return newly created block.
	(bsi_commit_edge_inserts_1): Pass null to tree_find_edge_insert_loc.
	(bsi_insert_on_edge_immediate): New function.
	* tree-flow.h (bsi_insert_on_edge_immediate,
	canonicalize_induction_variables, tree_unroll_loops_completely,
	create_iv): Declare.
	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_iv_canon and pass_complete_unroll.
	* tree-pass.h (pass_iv_canon, pass_complete_unroll): Declare.
	* tree-scalar-evolution.c (get_loop_exit_condition,
	get_exit_conditions_rec, number_of_iterations_in_loop,
	scev_initialize): Use single_exit information.
	* tree-ssa-loop-niter.c (number_of_iterations_cond): Record
	missing assumptions.
	(loop_niter_by_eval):  Return number of iterations as unsigned
	int.
	* tree-ssa-loop.c (tree_ssa_loop_init): Mark single exit loops.
	(tree_ssa_loop_ivcanon, gate_tree_ssa_loop_ivcanon, pass_iv_canon,
	tree_complete_unroll, gate_tree_complete_unroll, pass_complete_unroll):
	New passes.
	(tree_ssa_loop_done): Call free_numbers_of_iterations_estimates.
	* tree-ssanames.c (make_ssa_name): Allow creating ssa name before
	the defining statement is ready.
	* tree-vectorizer.c (vect_create_iv_simple): Removed.
	(vect_create_index_for_array_ref, vect_transform_loop_bound):
	Use create_iv.
	(vect_transform_loop_bound): Use single_exit information.
	(vect_analyze_loop_form): Cleanup bogus tests.
	(vectorize_loops): Do not call flow_loop_scan.
	* tree.h (may_negate_without_overflow_p): Declare.
	* fold-const.c (may_negate_without_overflow_p): Split out from ...
	(negate_expr_p): ... this function.
	(tree_expr_nonzero_p): Handle overflowed constants correctly.
	* doc/invoke.texi (-fivcanon): Document.
	* doc/passes.texi: Document canonical induction variable creation.

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

From-SVN: r86516
2004-08-24 20:48:23 +00:00
Steven Bosscher 0516f6fe82 Makefile.in (OBJS-common): Add postreload-gcse.c.
* Makefile.in (OBJS-common): Add postreload-gcse.c.
	Add new postreload-gcse.o.
	* cse.c (SAFE_HASH): Define as wrapper around safe_hash.
	(lookup_as_function, insert, rehash_using_reg, use_related_value,
	equiv_constant): Use SAFE_HASH instead of safe_hash.
	(exp_equiv_p): Export.  Add for_gcse argument when comparing
	for GCSE.
	(lookup, lookup_for_remove, merge_equiv_classes, find_best_addr,
	find_comparison_args, fold_rtx, cse_insn): Update callers.
	(hash_rtx): New function derived from old canon_hash and bits
	from gcse.c hash_expr_1.
	(canon_hash_string): Rename to hash_rtx_string.
	(canon_hash, safe_hash): Make static inline.  Call hash_rtx.
	* cselib.c (hash_rtx): Rename to cselib_hash_rtx.
	(cselib_lookup): Update this caller.
	* gcse.c (modify_mem_list_set, canon_modify_mem_list_set):
	Make static.
	(hash_expr): Call hash_rtx.
	(ldst_entry): Likewise.
	(expr_equiv_p): Call exp_equiv_p.
	(struct unoccr, hash_expr_1, hash_string_1, lookup_expr,
	reg_used_on_edge, reg_set_between_after_reload_p,
	reg_used_between_after_reload_p, get_avail_load_store_reg,
	is_jump_table_basic_block, bb_has_well_behaved_predecessors,
	get_bb_avail_insn, hash_scan_set_after_reload,
	compute_hash_table_after_reload,
	eliminate_partially_redundant_loads, gcse_after_reload,
	get_bb_avail_insn, gcse_after_reload_main): Remove.
	* postreload-gcse.c: New file, reincarnating most of the above.
	* rtl.h (exp_equiv_p, hash_rtx): New prototypes.
	(gcse_after_reload_main): Update prototype.
	* timevar.def (TV_GCSE_AFTER_RELOAD): New timevar.
	* passes.c (rest_of_handle_gcse2): Use it.

From-SVN: r86206
2004-08-18 20:53:59 +00:00
Dorit Naishlos 79fe1b3bd0 tree-vectorizer.c: New File: loop vectorization on SSAed GIMPLE trees.
* tree-vectorizer.c: New File: loop vectorization on SSAed GIMPLE trees.
        * tree-vectorizer.h: New File: Same.
        * Makefile.in (tree-vectorizer.c, tree-vectorizer.h): Add new files.
        * common.opt (ftree-vectorize): New flag to enable vectorization.
        * timevar.def (TV_TREE_VECTORIZATION): New dump file for vectorization
        pass.
        * tree-data-ref.h (init_data_ref): Additional argument.
        (array_base_name_differ_p): Moved to tree-data-ref.c.
        * tree-data-ref.c (array_base_name_differ_p): Revised.
        (initialize_data_dependence_relation): Call array_base_name_differ_p
        with an extra argument.
        (analyze_all_data_dependences): Same.
        (init_data_ref): Additional argument is_read to set DR_IS_READ.
        * tree-ssa-phiopt.c (empty_block_p): Expose for usage out of this file.
        * tree-flow.h (vectorize_loops, empty_block_p): Add declaration.
        * tree-optimize.c (pass_vectorize): Schedule the vectorization pass.
        * tree-pass.h (tree_opt_pass pass_vectorize): Declare the new
        vectorization pass.
        * tree-ssa-loop.c (tree_ssa_loop_init): Call scev_initialize.
        (tree_ssa_loop_done): Call scev_finalize.
        (tree_vectorize): Define the new vectorization pass.
        * defaults.h (UNITS_PER_SIMD_WORD): Allow targets to specify the size of
        the vector they support (until support for multiple vector sizes is
        added to the vectorizer).
        * config/i386/i386.h (UNITS_PER_SIMD_WORD): Define.
        * config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Define.
        * invoke.texi (fdump-tree-vect, ftree-vectorize): Add
        documentation.

From-SVN: r86131
2004-08-17 16:17:14 +00:00
Steven Bosscher 27fb79ad58 timevar.def (TV_CPROP1, [...]): New timers.
* timevar.def (TV_CPROP1, TV_CPROP2, TV_PRE, TV_HOIST, TV_LSM):
	New timers.
	* gcse.c: Include timevar.h.
	(const_prop_count, copy_prop_count): Rename to global_const_prop_count
	and global_copy_prop_count.
	(local_const_prop_count, local_copy_prop_count): New static globals.
	(gcse_main): Set the right timevar for each pass.
	(cprop_jump): Increment global_const_prop_count when a constant is
	propagated.  Add "GLOBAL" to dump output.
	(cprop_insn): Increment global_const_prop_count when a constant is
	propagated, or global_copy_prop_count when a copy is propagated.
	(do_local_cprop): Likewise for local_const_prop_count and
	local_copy_prop_count.
	(one_cprop_pass): Initialize const/cprop counters to zero.
	Print out results of local and global const/cprop separately.
	(bypass_block): Break over-length line.

From-SVN: r85718
2004-08-09 16:58:42 +00:00
Zdenek Dvorak a7e5372d6a tree-ssa-loop-im.c: New file.
* tree-ssa-loop-im.c: New file.
	* Makefile.in (tree-ssa-loop-im.o): Add.
	* cfgloop.c (superloop_at_depth): New function.
	* cfgloop.h (superloop_at_depth): Declare.
	* common.opt (ftree-lim): New flag.
	* expr.c (array_ref_up_bound): New function.
	* params.def (PARAM_LIM_EXPENSIVE): New parameter.
	* timevar.def (TV_LIM): New timevar.
	* tree-dfa.c (compute_immediate_uses): Respect TDFA_USE flags when
	computing immediate uses of a phi node.
	* tree-flow.h (struct tree_ann_common_d): Add aux field.
	(loop_commit_inserts, for_each_index, tree_ssa_lim): Declare.
	* tree-optimize.c (init_tree_optimization_passes): Add pass_lim.
	* tree-pass.h (pass_lim): Declare.
	* tree-ssa-loop.c (tree_ssa_loop_im, gate_tree_ssa_loop_im): New
	functions.
	(pass_lim): New pass structure.
	* tree-eh.c (tree_could_trap_p): Handle ARRAY_REFs correctly.
	* tree.c (in_array_bounds_p): New function.
	* tree.h (TREE_THIS_NOTRAP): Define also for ARRAY_REFs.
	(in_array_bounds_p, array_ref_up_bound): Declare.
	* doc/invoke.texi (-ftree-lim, --param lim-expensive): Document.
	* doc/passes.texi (tree-ssa-loop-im.c): Document.

From-SVN: r84441
2004-07-10 04:57:58 +00: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