aboutsummaryrefslogtreecommitdiff
path: root/gcc/dce.c
AgeCommit message (Collapse)AuthorFilesLines
2008-09-11ggc-common.c (loc_array): Make static.Jan Hubicka1-0/+1
* ggc-common.c (loc_array): Make static. * dce.c (rest_of_handle_ud_dce): Free worklist. From-SVN: r140286
2008-06-18df.h (struct df_ref): Replace 'insn' field with 'insn_info' field.Steven Bosscher1-8/+8
* df.h (struct df_ref): Replace 'insn' field with 'insn_info' field. (DF_REF_INSN_INFO): New. (DF_REF_INSN, DF_REF_INSN_UID): Rewrite macros using DF_REF_INSN_INFO. (DF_REF_IS_ARTIFICIAL): Artificial refs are now identified as refs with a NULL DF_REF_INSN_INFO. (DF_INSN_INFO_GET, DF_INSN_INFO_SET): Renamed from DF_INSN_GET and DF_INSN_SET. (DF_INSN_INFO_LUID, DF_INSN_INFO_DEFS, DF_INSN_INFO_USES, DF_INSN_INFO_EQ_USES): New. (DF_INSN_LUID, DF_INSN_DEFS, DF_INSN_USES, DF_INSN_EQ_USES, DF_INSN_UID_LUID, DF_INSN_UID_DEFS, DF_INSN_UID_USES, DF_INSN_UID_EQ_USES): Rewrite using DF_INSN_INFO_* macros. * df-core.c: Update comment for above changes. (df_insn_debug_regno): Use DF_INSN_INFO_GET instead of INSN_UID and DF_INSN_UID_* macros. (df_ref_debug): Check for NULL DF_REF_INSN_INFO. * df-scan.c (df_ref_record): Take a df_insn_info instead of an insn rtx. Update all callers. (df_def_record_1, df_defs_record, df_uses_record, df_get_call_refs, df_ref_create_structure, df_insn_refs_collect): Likewise. (df_ref_equal_p): Compare DF_REF_INSN_INFO pointers for the refs. * df-problems.c (df_chain_dump): Test for non-NULL DF_REF_INSN_INFO. (df_live_bb_local_compute): Retrieve DF_INSN_INFO, use DF_INSN_INFO_* macros to access the insn refs. (df_chain_top_dump, df_chain_bottom_dump, df_byte_lr_alloc): Likewise. * fwprop.c (use_killed_between): Use DF_REF_INSN accessor macro. (all_uses_available): Retrieve DF_INSN_INFO for def_insn, and use it for accessing the refs. (try_fwprop_subst): Likewise. * ddg.c (add_cross_iteration_register_deps): Use DF_REF_INSN macro. * web.c (union_defs): Retrieve DF_INSN_INFO for def_insn, and use it for accessing the refs. * loop-invariant.c (invariant_for_use): Use DF_REF_BB macro. (check_dependencies): Use DF_INSN_INFO_GET, use DF_INSN_INFO_* macros to look at the insn refs. (record_uses): Likewise. * dce.c (deletable_insn_p): Don't tolerate artificial DEFs in this function anymore. (mark_artificial_uses): Don't mark_insn for artificial refs. (mark_reg_rependencies): Likewise. * doc/rtl.texi: Remove documentation of ADDRESSOF. From-SVN: r136885
2008-06-17Remove libcall notes.Steven Bosscher1-151/+1
* see.c (see_analyse_one_def): Do not look for REG_LIBCALL and REG_RETVAL notes. (see_update_relevancy): Likewise. * fwprop.c (try_fwprop_subst): Likewise. * rtlanal.c (noop_move_p): Likewise. * builtins.c (expand_buitlin_mathfn): Don't try to add REG_EQUAL notes to non-existing libcall blocks. * cse.c (cse_insn): Change prototype. Don't update libcall notes. Remove orig_set. (cse_extended_basic_block): Don't track libcall and no-conflict notes. (dead_libcall_p): Remove. (delete_trivially_dead_insns): Don't use it. * web.c (union_defs): Remove comment about keeping nops. * gcse.c (hash_scan_insn): Don't take libcall pointers. (compute_hash_table_work): Don't track libcall notes. (do_local_cprop): Don't take libcall pointers. Don't update libcall notes. (adjust_libcall_notes): Deleted. (local_cprop_pass): Remove stack for nested libcalls (which shouldn't ever have existed in the first place). (replace_store_insn): Don't try to remove libcall notes. * lower-subreg.c (move_libcall_note, move_retval_note): Deleted. (resolve_reg_notes): Don't call them. (resolve_simple_move): Likewise. (decompose_multiword_subregs): Remove block handling REG_RETVAL notes. Don't remove REG_RETVAL notes. * emit-rtl.c (try_split): Don't update libcall notes. (emit_copy_of_insn_after): Dito. * cselib.c (cselib_current_insn_in_libcall): Remove. (cselib_process_insn): Don't set/clear it. (new_elt_loc_list): Don't record it. (cselib_init): Don't initialize it. * cselib.c (struct elt_loc_list): Remove in_libcall field. * loop-invariant.c (find_invariant_insn): Don't look for libcall notes. * sched-deps.c (sched_analyze_insn): Don't group libcall blocks. (sched_analyze): Don't set up deps->libcall_block_tail_insn. (init_deps): Don't initialize it. * sched-int.h (struct deps): Rremove libcall_block_tail_insn field. * combine.c (delete_noop_moves): Don't update libcall notes. (can_combine_p): Remove now pointless #if 0 block. (try_combine): Remove another obsolete #if 0 block. (distribute_notes): Don't distribute libcall notes. * reg-notes.def (REG_LIBCALL, REG_RETVAL): Remove. * dce.c (libcall_dead_p): Remove. (delete_unmarked_insns): Don't handle libcall blocks. (preserve_libcall_for_dce): Remove. (prescan_insns_for_dce): Don't special-case libcall block insns. * reload1 (reload): Don't handle libcall notes. * doc/rtl.texi (REG_LIBCALL, REG_RETVAL, REG_LIBCALL_ID): Remove documentation. From-SVN: r136861
2008-05-09re PR middle-end/36177 (g++.dg/opt/pr23714.C ICEs with 135041 -> 135057)Kenneth Zadeck1-4/+20
2008-05-08 Kenneth Zadeck <zadeck@naturalbridge.com> PR middle-end/36117 * dce.c (deletable_insn_p): Do not delete calls if df_in_progress. (delete_unmarked_insns): When deleting a call, call delete_unreachable_blocks. * rtl.texi (RTL_CONST_CALL_P, RTL_PURE_CALL_P, RTL_CONST_OR_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P): Fixed doc. From-SVN: r135113
2008-05-07[multiple changes]Kenneth Zadeck1-0/+9
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> PATCH rtl/7335 PATCH rtl/33826 * see.c (see_copy_insn): Copy new pure const attributes for new call. * c-decl.c (merge_decls): Ditto. * postreload.c (record_opr_changes): Change CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * tree.c (define_local_buitin): Rename DECL_IS_PURE to DECL_PURE_P. Initialized DECL_LOOPING_CONST_PURE. (process_call_operands): Set tree_side_effects properly. * tree.h (TREE_READONLY_DECL_P): Removed. (DECL_IS_PURE): Renamed to DECL_PURE_P. (DECL_LOOPING_OR_CONST_P): New macro. (struct tree_function_decl): Added looping_const_or_pure_p. (ECF_*) Renumbered. (ECF_LOOPING_OR_CONST_P): New macro, * rtlanal.c (pure_const_p): Removed. * builtins.c (expand_builtin): Rename DECL_IS_PURE to DECL_PURE_P. * reorg.c (delete_prior_computation) Changed CONST_OR_PURE_CALL_P to RTL_CONST_CALL_P. * ipa-pure-const.c (pure_const_state_e): Added looping field. (check_decl, check_tree, check_call, scan_function): Initialize looping. (analyze_function): Rename DECL_IS_PURE to DECL_PURE_P. (static_execute): Set looping true for recursive functions. Undo setting state to IPA_NEITHER for recursive functions. * cse.c (cse_insn): * ifcvt.c (noce_can_store_speculate_p): Changed CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P or RTL_CONST_OR_PURE_CALL_P. * dse.c (scan_insn): Ditto. * local-alloc.c (validate_equiv_mem, memref_used_between_p): Ditto. * gcse.c (oprs_not_seen_p) Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. (store_killed_in_insn): Changed CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P. * gimplify.c (gimplify_call_expr): Clear side effects for non-looping pure and constant calls. * calls.c (emit_call_1): Set rtl flags from ecf flags. (flags_from_decl_or_type): Set ecf flags from decl flags. (initialize_argument_information): Turn off ECF_LOOPING_CONST_OR_PURE when turning off ECF_CONST. Change const to pure if callee_copies is true rather than just turning off const. (expand_call): Turn off ECF_LOOPING_PURE_CONST_CALL and remove old way of marking pure calls. (emit_library_call_value_1): Turn off ECF_LOOPING_PURE_CONST_CALL. Remove hack that was supposed to fix pr7335 and remove old way of marking pure calls. * emit-rtl.c (emit_copy_of_insn_after): Copy RTL_CONST_CALL_P, RTL_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P. * cselib.c (cselib_process_insn): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * tree-ssa-pre.c (can_value_number_call): Fixed spacing. * loop-invariant.c (find_exits, find_invariant_bb): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * sched-deps.c (schedule_analyze): Ditto. * rtl.h (struct rtx_def): Use call field, unchanging field, and return_val field of calls to represent pure and const function info. (CONST_OR_PURE_CALL_P): Deleted macro. (RTL_CONST_CALL_P, RTL_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P, RTL_CONST_OR_PURE_P): New macros. * tree-inline.c (copy_body_r): Changed TREE_READONLY_DECL_P to TREE_READONLY. * tree-optimize.c (execute_fixup_cfg): Added test for ECF_LOOPING_CONST_OR_PURE. * c-common.c (handle_pure_attribute): Changed DECL_IS_PURE to DECL_PURE_P. * tree-cfg.c (update_call_expr_flags): Do not clear tree side effects for looping pure or const calls. (verify_gimple_expr): Added verification code. * config/alpha/alpha.c (alpha_legitimize_address, alpha_emit_xfloating_libcall): Changed CONST_OR_PURE_CALL_P to RTL_CONST_CALL_P. * config/s390/s390.c (s390_emit_tls_call_insn): Ditto. * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Ditto. * config/mips/mips.c (mips_call_tls_get_addr): Ditto. * cfgrtl.c (need_fake_edge_p): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * dce.c (deletable_insn_p): Allow non looping, non sibling, pure and const calls to be deleted. java: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * decl.c (java_init_decl_processing): Change DECL_IS_PURE to DECL_PURE_P. cp: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY, DECL_LOOPING_CONST_OR_PURE_P attributes. * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to DECL_PURE_P. gfortran: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * trans-decl.c (gfc_get_extern_function_decl, build_function_decl): Rename DECL_IS_PURE to DECL_PURE_P. From-SVN: r135053
2008-04-21dbgcnt.def (ra_byte_scan): Added.Richard Sandiford1-53/+171
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-03-19re PR other/35094 (RTL dump file letters hosed and partly undocumented)Jan Hubicka1-6/+10
* gcc.dg/20050811-2.c: Update dumping flags. * gcc.dg/sms-2.c: Update dumping flags. * gcc.dg/var-expand1.c: Update dumping flags. * gcc.dg/var-expand3.c: Update dumping flags. * gcc.dg/pr30957-1.c: Update dumping flags. * gcc.dg/20050811-1.c: Update dumping flags. * gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail. * gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail. PR other/35094 * toplev.c (decode_d_option): Handle all CPP flags. * tree-vrp.c: Update tree_pass descriptors. * regrename.c: Update tree_pass descriptors. * fwprop.c: Update tree_pass descriptors. * doc/invoke.texi: Remove documentation of dropped -d? flags. * tree-into-ssa.c: Update tree_pass descriptors. * tree-dump.c: Update tree_pass descriptors. * tree-complex.c: Update tree_pass descriptors. * tree-dump.h: Update tree_pass descriptors. * see.c: Update tree_pass descriptors. * cgraphbuild.c: Update tree_pass descriptors. * tracer.c: Update tree_pass descriptors. * tree-loop-distribution.c: Update tree_pass descriptors. * cgraph.c: Update tree_pass descriptors. * postreload-gcse.c: Update tree_pass descriptors. * postreload.c: Update tree_pass descriptors. * tree-ssa-loop-ch.c: Update tree_pass descriptors. * tree-tailcall.c: Update tree_pass descriptors. * tree-pass.h (tree_opt_pass): Rename to ... (opt_pass) ... this one; add "type" field and remove letter field. (gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New. (execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes, all_lowering_passes): Update declaration. * ipa-cp.c: Update tree_pass descriptors. * final.c: Update tree_pass descriptors. * omp-low.c: Update tree_pass descriptors. * tree-ssa-dse.c: Update tree_pass descriptors. * ipa-reference.c: Update tree_pass descriptors. * tree-ssa-uncprop.c: Update tree_pass descriptors. * auto-inc-dec.c: Update tree_pass descriptors. * reorg.c: Update tree_pass descriptors. * cgraphunit.c: Update tree_pass descriptors. * tree-ssa-copyrename.c: Update tree_pass descriptors. * tree-ssa-ccp.c: Update tree_pass descriptors. * df-core.c: Update tree_pass descriptors. * mode-switching.c: Update tree_pass descriptors. * tree-nomudflap.c: Update tree_pass descriptors. * modulo-sched.c: Update tree_pass descriptors. * ipa-pure-const.c: Update tree_pass descriptors. * cse.c: Update tree_pass descriptors. * web.c: Update tree_pass descriptors. * tree-stdarg.c: Update tree_pass descriptors. * tree-ssa-math-opts.c: Update tree_pass descriptors. * tree-ssa-dom.c: Update tree_pass descriptors. * tree-nrv.c: Update tree_pass descriptors. * tree-ssa-alias.c: Update tree_pass descriptors. * loop-init.c: Update tree_pass descriptors. * gimple-low.c: Update tree_pass descriptors. * ipa-inline.c: Update tree_pass descriptors. * tree-ssa-sink.c: Update tree_pass descriptors. * global.c: Update tree_pass descriptors. * ifcvt.c: Update tree_pass descriptors. * jump.c: Update tree_pass descriptors. * predict.c: Update tree_pass descriptors. * tree-ssa-loop.c: Update tree_pass descriptors. * recog.c: Update tree_pass descriptors. * dse.c: Update tree_pass descriptors. * tree-ssa-ifcombine.c: Update tree_pass descriptors. * tree-eh.c: Update tree_pass descriptors. * regmove.c: Update tree_pass descriptors. * local-alloc.c * function.c: Update tree_pass descriptors. * tree-vectorizer.c: Update tree_pass descriptors. * gcse.c: Update tree_pass descriptors. * ipa-type-escape.c: Update tree_pass descriptors. * tree-if-conv.c: Update tree_pass descriptors. * init-regs.c: Update tree_pass descriptors. * ipa.c: Update tree_pass descriptors. * tree-ssa-phiopt.c: Update tree_pass descriptors. * rtl-factoring.c: Update tree_pass descriptors. * lower-subreg.c: Update tree_pass descriptors. * bt-load.c: Update tree_pass descriptors. * tree-dfa.c: Update tree_pass descriptors. * except.c: Update tree_pass descriptors. * emit-rtl.c: Update tree_pass descriptors. * cfgexpand.c: Update tree_pass descriptors. * tree-cfgcleanup.c: Update tree_pass descriptors. * cfgcleanup.c: Update tree_pass descriptors. * tree-ssa-pre.c: Update tree_pass descriptors. * tree-sra.c: Update tree_pass descriptors. * tree-mudflap.c: Update tree_pass descriptors. * tree-ssa-copy.c: Update tree_pass descriptors. * cfglayout.c: Update tree_pass descriptors. * tree-ssa-forwprop.c: Update tree_pass descriptors. * tree-ssa-dce.c: Update tree_pass descriptors. * tree-ssa.c: Update tree_pass descriptors. * regclass.c: Update tree_pass descriptors. * integrate.c: Update tree_pass descriptors. * tree-optimize.c: Update tree_pass descriptors. * tree-ssa-phiprop.c: Update tree_pass descriptors. * tree-object-size.c: Update tree_pass descriptors. * combine.c: Update tree_pass descriptors. * tree-outof-ssa.c: Update tree_pass descriptors. * bb-reorder.c: Update tree_pass descriptors. * stack-ptr-mod.c: Update tree_pass descriptors. * var-tracking.c: Update tree_pass descriptors. * tree-profile.c: Update tree_pass descriptors. * tree-vect-generic.c: Update tree_pass descriptors. * reg-stack.c: Update tree_pass descriptors. * sched-rgn.c: Update tree_pass descriptors. * tree-ssa-structalias.c: Update tree_pass descriptors. * tree-cfg.c: Update tree_pass descriptors. * passes.c (current_pass): Update declaration. (finish_optimization_passes): Update. (all_passes, all_ipa_passes, all_lowering_passes): Update declaration. (register_one_dump_file, register_dump_files_1, next_pass_1): Update arguments. (init_optimization_passes): Update handling of new types. (execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update. * ipa-struct-reorg.c: Update tree_pass descriptors. * tree-ssa-reassoc.c: Update tree_pass descriptors. * combine-stack-adj.c: Update tree_pass descriptors. * cfgrtl.c: Update tree_pass descriptors. * dce.c: Update tree_pass descriptors. * tree-ssanames.c: Update tree_pass descriptors. From-SVN: r133342
2008-02-26dbgcnt.def (cfg_cleanup, [...]): New counters.David Edelsohn1-2/+4
* dbgcnt.def (cfg_cleanup, cprop1, cprop2, dce_fast, dce_ud, dse1, dse2, gcse, if_conversion, if_after_combine, if_after_reload, jump_bypass): New counters. * cfgcleanup.c (cleanup_cfg): Add dbg_cnt. * dce.c (gate_ud_dce): Same. (gate_fast_dce): Same. * dse.c (gate_dse1): New function. (gate_dse2): New function. (gate_dse): Merge results of new gate functions. * gcse.c (gcse_main): Bracket cprop1 and cprop2 with dbg_cnt. (gate_handle_jump_bypass): Add dbg_cnt. (gate_handle_gcse): Add dbg_cnt. * ifcvt.c (gate_handle_if_conversion): Same. (gate_handle_if_after_combine): Same. (gate_handle_if_after_reload): Same. * Makefile.in: Add DBGCNT_H to cfgcleanup.o and ifcvt.o. From-SVN: r132684
2007-10-28dce.c (delete_unmarked_insns): Just delete the RETVAL and LIBCALL notes if...Andreas Krebbel1-4/+11
2007-10-28 Andreas Krebbel <krebbel1@de.ibm.com> * dce.c (delete_unmarked_insns): Just delete the RETVAL and LIBCALL notes if they are about to be moved to the same insn. From-SVN: r129693
2007-10-22re PR rtl-optimization/33644 (ICE in local_cprop_pass with -ftrapv for crafty)Eric Botcazou1-137/+172
PR rtl-optimization/33644 * cfgcleanup.c: Do not include dce.h. * cfgrtl.c (delete_insn_chain_and_edges): Resurrect. * combine.c (distribute_notes): Delete REG_LIBCALL_ID case. * dce.c (something_changed): Delete. (libcall_dead_p): New predicate. (delete_unmarked_insns): Use it to delete dead libcalls. Deal with REG_LIBCALL and REG_RETVAL notes. (prescan_libcall_for_dce): New function. (prescan_insns_for_dce): Use it to deal with libcalls. (mark_reg_dependencies): Do nothing special for libcalls. (dce_process_block): Likewise. (fast_dce): Delete unused local variable. (run_fast_dce): Do not return a value. * dce.h (struct df): Delete. (run_fast_dce): Adjust prototype. * optabs.c (libcall_id): Delete. (maybe_encapsulate_block): Do not emit REG_LIBCALL_ID notes. (emit_no_conflict_block): Do not look for REG_LIBCALL_ID notes. * reload1.c (reload): Delete REG_LIBCALL_ID case. * rtl.h (delete_insn_chain_and_edges): Resurrect prototype. * see.c (see_update_relevancy): Look for REG_LIBCALL and REG_RETVAL notes instead of REG_LIBCALL_ID notes. * reg-notes.def (LIBCALL_ID): Delete. * Makefile.in (see.o): Add dce.h dependency. (cfgcleanup.o): Remove dce.h dependency. From-SVN: r129556
2007-10-16dce.c (init_dce): Only initialize the obstacks for the fast pass.Eric Botcazou1-55/+61
* dce.c (init_dce): Only initialize the obstacks for the fast pass. (fini_dce): Only release them for the fast pass. (end_ud_dce): Delete. (rest_of_handle_ud_dce): Do not modify df_in_progress. Call fini_dce instead of end_ud_dce. (rest_of_handle_fast_dce): Do not modify df_in_progress. (run_fast_df_dce): Reset df_in_progress to false on exit. From-SVN: r129384
2007-10-04re PR rtl-optimization/33653 (volatile memory access optimized away)Michael Matz1-1/+1
PR rtl-optimization/33653 * dce.c (deletable_insn_p_1): Use volatile_refs_p(). * dse.c (scan_insn): Same. From-SVN: r129006
2007-10-02ra-conflict.c: New file.Kenneth Zadeck1-2/+2
2007-09-02 Kenneth Zadeck <zadeck@naturalbridge.com> * ra-conflict.c: New file. * ra.h: New file. * reload.c (push_reload, find_dummy_reload): Change DF_RA_LIVE usage to DF_LIVE usage. * rtlanal.c (subreg_nregs_with_regno): New function. * df-scan.c (df_def_record_1, df_uses_record): Add code to set DF_REF_EXTRACT, DF_REF_STRICT_LOWER_PART, and DF_REF_SUBREG flags. (df_has_eh_preds): Removed. (df_bb_refs_collect, df_bb_refs_collect, df_bb_refs_collect, df_exit_block_uses_collect): Changed call from df_has_eh_preds to bb_has_eh_pred. * global.c (allocno, max_allocno, conflicts, allocno_row_words, reg_allocno, EXECUTE_IF_SET_IN_ALLOCNO_SET): Moved to ra.h (SET_ALLOCNO_LIVE, CLEAR_ALLOCNO_LIVE): Moved to ra-conflicts.c. (regs_set, record_one_conflict, record_conflicts, mark_reg_store, mark_reg_clobber, mark_reg_conflicts, mark_reg_death): Deleted. (global_alloc): Turn off rescanning insns after call to global_conflicts and added call to set_preferences. (global_conflicts): Moved to ra-alloc.c. (set_preferences_1, set_preferences): New function. (mirror_conflicts): Changed types for various variables. (mark_elimination): Change DF_RA_LIVE usage to DF_LIVE usage. (build_insn_chain): Rewritten from scratch and made local. (print_insn_chain, print_insn_chains): New functions. (dump_conflicts): Do not print conflicts for fixed_regs. (rest_of_handle_global_alloc): Turn off insn rescanning. * hard-reg-set.h: Fixed comment. * local-alloc.c (update_equiv_regs): Change DF_RA_LIVE usage to DF_LIVE usage and delete refs to TOP sets. (block_alloc): Mark regs as live if they are in the artificial defs at top of block. (find_stack_regs): New function. (rest_of_handle_local_alloc): Changed urec problem to live problem and do not turn off df rescanning. * df.h (DF_UREC, DF_UREC_BB_INFO, DF_LIVE_TOP, DF_RA_LIVE_IN, DF_RA_LIVE_TOP, DF_RA_LIVE_OUT, df_urec_bb_info, df_urec, df_urec_add_problem, df_urec_get_bb_info, df_has_eh_preds): Removed. (DF_CHAIN, DF_NOTE, DF_CHAIN): Renumbered. (DF_REF_EXTRACT, DF_REF_STRICT_LOWER_PART, DF_REF_SUBREG): New fields in df_ref_flags. The rest have been renumbered. * init-regs.c (initialize_uninitialized_regs): Enhanced debugging at -O1. * rtl.h (subreg_nregs_with_regno): New function. * df-problems.c: (df_get_live_out, df_get_live_in, df_get_live_top): Removed reference to DF_RA_LIVE. (df_lr_reset, df_lr_transfer_function, df_live_free_bb_info, df_live_alloc, df_live_reset, df_live_local_finalize, df_live_free): Make top set only if different from in set. (df_lr_top_dump, df_live_top_dump): Only print top set if different from in set. (df_lr_bb_local_compute): Removed unnecessary check. (df_urec_problem_data, df_urec_set_bb_info, df_urec_free_bb_info, df_urec_alloc, df_urec_mark_reg_change, earlyclobber_regclass, df_urec_check_earlyclobber, df_urec_mark_reg_use_for_earlyclobber, df_urec_mark_reg_use_for_earlyclobber_1, df_urec_bb_local_compute, df_urec_local_compute, df_urec_init, df_urec_local_finalize, df_urec_confluence_n, df_urec_transfer_function, df_urec_free, df_urec_top_dump, df_urec_bottom_dump, problem_UREC, df_urec_add_problem): Removed. (df_simulate_fixup_sets): Changed call from df_has_eh_preds to bb_has_eh_pred. * Makefile.in (ra-conflict.o, ra.h): New dependencies. * basic_block.h (bb_has_abnormal_pred): New function. * reload1.c (compute_use_by_pseudos): Change DF_RA_LIVE usage to DF_LIVE usage. From-SVN: r128957
2007-09-05regrename.c (pass_regrename, [...]): Add RTL sharing verifier.Jan Hubicka1-2/+2
* regrename.c (pass_regrename, pass_cprop_hardreg): Add RTL sharing verifier. * fwprop.c (pass_rtl_fwprop, pass_rtl_fwprop_add): Likewise. * see.c (pass_see): Likewise. * tracer.c (pass_tracer): Likewise. * postreload-gcse.c (pass_gcse2): Likewise. * postreload.c (pass_postreload_cse): Likewise. * mode-switching.c (pass_mode_switching): Likewise. * modulo-sched.c (pass_sms): Likewise. * cse.c (cse_insn): Likewise. * web.c (pass_web): Likweise. * combine-stack-adj.c (pass_stack_adjustments): Likewise. * dce.c (pass_ud_rtl_dce, pass_fast_rtl_dce): Likewise. * loop-init.c (pass_rtl_loop_init): Likewise. (pass_rtl_loop_done, pass_rtl_move_loop_, pass_rtl_unswitch, pass_rtl_unroll_and, pass_rtl_doloop): Likewise. * global.c (pass_global_alloc): Likewise. * ifcvt.c (pass_rtl_ifcvt, pass_if_after_combine, pass_if_after_reload): Likewise. * reload.c (pass_peephole2, pass_split_for_shoren_branches): Likewise. * dse.c (pass_rtl_dse1, pass_rtl_dse2): Likewise. * regmove.c (pass_regmove): Likewise. * function.c (pass_thread_prologugues_epilogues): Likewise. * gcse.c (pass_gcse): Likewise. * rtl-factoring.c (pass_rtl_seqabstr): Likewise. * lower-subreg.c (pass_lower_subreg2): Likewise. * bt-load.c (pass_branch_target_load): Likewise. * emit-rtl.c (pass_unshare_all_rtl): Likewise. * cfgcleanup.c (pass_jump, pass_jump2): Likewise. * combine.c (pass_combine): Likewise. * bb-reorder.c (pass_duplicate_comp, pass_reorder_blocks): Likewise. (pass_partition_blocks): Likewise. * var-tracking.c (pass_variable_track): Likewise. * reg-stack.c (pass_stack_regs_run): Likewise. * sched-rgn.c (pass_sched, pass_sched2): Likewise. * passes.c (pass_postreload): Likewise. (execute_function_todo): Add TODO_verify_rtl_sharing handling code. * tree-pass.h (TODO_verify_rtl_sharing): New. (TODO_update_ssa, TODO_update_ssa_no_phi, TODO_update_ssa_full_phi, TODO_update_ssa_only_virtuals, TODO_remove_unused_locals, TODO_set_props, TODO_df_finish, TODO_df_verify, TODO_mark_first_instance, TODO_rebuild_alias): Renumber. From-SVN: r128126
2007-08-30re PR middle-end/32758 (ecj1 hangs)Jakub Jelinek1-1/+12
PR middle-end/32758 * dce.c (dce_process_block): Don't delete setters of artificially used registers. * gcc.dg/cleanup-12.c: New test. From-SVN: r127923
2007-07-30alias.c (record_set, [...]): Constify.Kaveh R. Ghazi1-2/+2
* alias.c (record_set, memory_modified_1): Constify. * bt-load.c (note_btr_set): Likewise. * caller-save.c (mark_set_regs, add_stored_regs): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, expand_field_assignment, record_dead_and_set_regs_1, use_crosses_set_p, reg_dead_at_p_1, can_combine_p, likely_spilled_retval_1): Likewise. * config/frv/frv.c (frv_registers_update_1, frv_io_check_address, frv_io_handle_set): Likewise. * config/mips/mips.c (mips_sim_record_set, vr4130_true_reg_dependence_p_1): Likewise. * config/mt/mt.c (insn_dependent_p_1): Likewise. * config/s390/s390.c (s390_reg_clobbered_rtx): Likewise. * config/sh/sh.c (flow_dependent_p_1): Likewise. * cselib.c (cselib_invalidate_rtx_note_stores): Likewise. * dce.c (mark_nonreg_stores_1, mark_nonreg_stores_2): Likewise. * ddg.c (mark_mem_store): Likewise. * df-problems.c (df_urec_mark_reg_change): Likewise. * function.c (update_epilogue_consts): Likewise. * gcse.c (record_set_info, record_last_set_info, mems_conflict_for_gcse_p, canon_list_insert, reg_set_info, reg_clear_last_set): Likewise. * global.c (mark_reg_store, mark_reg_clobber, reg_becomes_live): Likewise. * jump.c (reversed_comparison_code_parts): Likewise. * local-alloc.c (validate_equiv_mem_from_store, no_equiv, reg_is_set): Likewise. * loop-iv.c (mark_altered): Likewise. * mode-switching.c (reg_becomes_live): Likewise. * optabs.c (no_conflict_move_test): Likewise. * postreload-gcse.c (record_last_set_info, find_mem_conflicts): Likewise. * postreload.c (reload_combine_note_store, move2add_note_store): Likewise. * regmove.c (flags_set_1): Likewise. * regrename.c (note_sets, kill_clobbered_value, kill_set_value): Likewise. * reload1.c (mark_not_eliminable, forget_old_reloads_1): Likewise. * resource.c (update_live_status): Likewise. * rtl.h (set_of, note_stores): Likewise. * rtlanal.c (set_of_1, parms_set, struct set_of_data, set_of, note_stores, parms_set): Likewise. * sched-rgn.c (sets_likely_spilled_1): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification_1): Likewise. * var-tracking.c (count_stores, add_stores): Likewise. From-SVN: r127065
2007-07-26Change copyright header to refer to version 3 of the GNU General Public ↵Nick Clifton1-4/+3
License and to point readers at the COPYING3 file and the FSF's license web page. From-SVN: r126948
2007-07-07auto-inc-dec.c, [...]: Fix comment typos.Kazu Hirata1-1/+1
* auto-inc-dec.c, config/arm/arm.c, config/m32r/constraints.md, config/mips/mips.md, config/rs6000/rs6000.c, cselib.c, dce.c, df-core.c, df-problems.c, df-scan.c, df.h, dse.c, gimplify.c, tree-if-conv.c, tree-ssa-sccvn.c, tree-ssa.c: Fix comment typos. Follow spelling conventions. * doc/invoke.texi, doc/rtl.texi: Fix typos. From-SVN: r126439
2007-07-01[multiple changes]Richard Sandiford1-24/+40
2007-07-01 Richard Sandiford <richard@codesourcery.com> Unreverting Richard's Revert of: 2007-06-27 Richard Sandiford <richard@codesourcery.com> * dce.c (deletable_insn_p_1): New function, split out from... (deletable_insn_p): ...here. Only treat bare USEs and CLOBBERs specially, not those inside PARALLELs. Remove BODY argument and adjust recursive call accordingly. (prescan_insns_for_dce): Update call to delete_insn_p. From-SVN: r126168
2007-06-30revert: dce.c (deletable_insn_p_1): New function, split out from...Richard Sandiford1-40/+24
gcc/ Revert: 2007-06-27 Richard Sandiford <richard@codesourcery.com> * dce.c (deletable_insn_p_1): New function, split out from... (deletable_insn_p): ...here. Only treat bare USEs and CLOBBERs specially, not those inside PARALLELs. Remove BODY argument and adjust recursive call accordingly. (prescan_insns_for_dce): Update call to delete_insn_p. From-SVN: r126143
2007-06-27dce.c (deletable_insn_p_1): New function, split out from...Richard Sandiford1-24/+40
gcc/ * dce.c (deletable_insn_p_1): New function, split out from... (deletable_insn_p): ...here. Only treat bare USEs and CLOBBERs specially, not those inside PARALLELs. Remove BODY argument and adjust recursive call accordingly. (prescan_insns_for_dce): Update call to delete_insn_p. From-SVN: r126056
2007-06-23re PR target/32437 (MIPS: FAIL in gcc.dg/cleanup-[8|9|10|11].c)Kenneth Zadeck1-9/+17
2007-06-23 Kenneth Zadeck <zadeck@naturalbridge.com> PR middle-end/32437 *dce.c (deletable_insn_p): Add extra parameter and recurse if insn is a PARALLEL. (prescan_insns_for_dce): Add extra parameter. From-SVN: r125972
2007-06-11Merge dataflow branch into mainlineDaniel Berlin1-0/+789
From-SVN: r125624
2001-06-19* ssa-dce.c: Renamed from dce.c.Jeffrey A Law1-618/+0
From-SVN: r43457
2001-06-18* dce.c (eliminate_dead_code): Fix formatting glitch.Jeffrey A Law1-5/+6
From-SVN: r43447
2000-11-14Michael Matz <matzmich@cs.tu-berlin.de>Michael Matz1-5/+1
* dominance.c: New file. * Makefile.in (OBJS): Add dominance.o. * flow.c (compute_flow_dominators): Remove. (compute_immediate_dominators): Remove. (compute_immediate_postdominators): Remove. * basic-block.h: Remove their prototypes. (calculate_dominance_info): Add prototype. * dce.c (eliminate_dead_code): Change calls to above functions. Don't compute dominators but only immediate dominators. * flow.c (flow_loops_find): Change callers. * gcse.c (compute_code_hoist_data): Likewise. * haifa-sched.c (schedule_insns): Likewise. * ifcvt.c (if_convert): Likewise. * ssa.c (convert_to_ssa): Likewise, and only compute immediate dominators. From-SVN: r37449
2000-08-03dce.c: Remove all uses of assert.Mark Mitchell1-15/+16
* dce.c: Remove all uses of assert. * dwarf2out.c: Likewise. * dwarfout.c: Likewise. * ssa.c: Likewise. From-SVN: r35438
2000-08-02Makefile.in (OBJS): Added dce.o.Jeffrey Oldham1-0/+620
* Makefile.in (OBJS): Added dce.o. (ssa.o): Updated target to include ssa.h. (flow.o): Likewise. (toplev.o): Likewise. (dce.o): Created target. * basic-block.h: Added comments. (INVALID_BLOCK): Added definition. (connect_infinite_loops_to_exit): Added declaration. Moved SSA declarations to ssa.h. * flow.c: Added inclusion of ssa.h. (struct depth_first_search_dsS, depth_first_search_ds): Added definitions. (compute_immediate_postdominators): Added definition. (connect_infinite_loops_to_exit): Likewise. (flow_dfs_compute_reverse_init): Likewise. (flow_dfs_compute_reverse_add_bb): Likewise. (flow_dfs_compute_reverse_execute): Likewise. (flow_dfs_compute_reverse_finish): Likewise. * rtl.h (rtx/in_struct): Added use to determine insn necessity. (LABEL_P): Added definition. (JUMP_P): Likewise. (NOTE_P): Likewise. (BARRIER_P): Likewise. (JUMP_TABLE_DATA_P): Likewise. (INSN_DEAD_CODE_P): Likewise. * ssa.c: Replaced inclusions with ssa.h inclusion. (CONVERT_HARD_REGISTER_TO_SSA_P): Moved to ssa.h. (rename_registers): Removed unnecessary variables. * ssa.h: Created by moving declarations from ssa.c and basic-block.h. * timevar.def: Defined TV_DEAD_CODE_ELIM. * toplev.c: Added ssa.h inclusion. (dump_file_index): Added DFI_dce. (dump_file): Added "dce" entry. Defined flag_ssa. (f_options): Added dce entry. * invoke.texi: Document -fdce. Emphasize experimental status of -fssa. Co-Authored-By: Mark Mitchell <mark@codesourcery.com> From-SVN: r35419