aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
AgeCommit message (Collapse)AuthorFilesLines
2008-03-18tree-ssa-sccvn.c (visit_reference_op_load): If the lookup found an ↵Richard Guenther1-0/+6
expression with constants, note that in the VN for the lhs. 2008-03-18 Richard Guenther <rguenther@suse.de> * tree-ssa-sccvn.c (visit_reference_op_load): If the lookup found an expression with constants, note that in the VN for the lhs. * tree-ssa-pre.c (eliminate): Visit COND_EXPR statements and fold them to constants if possible. Run cleanup_cfg if done so. (execute_pre): Return todo. (do_pre): Likewise. (execute_fre): Likewise. * tree-ssa-forwprop.c (can_propagate_from): Allow propagation of constants. (get_prop_source_stmt): Look through pointer conversions. * gcc.dg/tree-ssa/forwprop-4.c: New testcase. * gcc.dg/tree-ssa/ssa-fre-16.c: Likewise. From-SVN: r133315
2008-03-15tree-ssa-ccp.c (get_symbol_constant_value): Export.Richard Guenther1-36/+34
2008-03-15 Richard Guenther <rguenther@suse.de> * tree-ssa-ccp.c (get_symbol_constant_value): Export. (fold_const_aggregate_ref): Likewise. (get_value): Return NULL if we don't have any values. (ccp_finalize): Set const_val to NULL after freeing it. * tree-flow.h (get_symbol_constant_value): Declare. (fold_const_aggregate_ref): Likewise. * tree-ssa-sccvn.c (try_to_simplify): Use them. * gcc.dg/pr23911.c: Adjust testcase. * gcc.dg/tree-ssa/pr14841.c: Likewise. * gcc.dg/tree-ssa/20030922-2.c: Likewise. From-SVN: r133251
2008-03-14re PR tree-optimization/34172 (Missed store ccp optimization)Richard Guenther1-11/+92
2008-03-14 Richard Guenther <rguenther@suse.de> PR tree-optimization/34172 * tree-flow.h (refs_may_alias_p): Declare. (get_single_def_stmt): Likewise. (get_single_def_stmt_from_phi): Likewise. (get_single_def_stmt_with_phi): Likewise. * tree-dfa.c (refs_may_alias_p): New function. (get_single_def_stmt): Likewise. (get_single_def_stmt_from_phi): Likewise. (get_single_def_stmt_with_phi): Likewise. * tree-ssa-sccvn.c (get_def_ref_stmt_vuses): New function. (vn_reference_lookup_1): New helper function. (vn_reference_lookup): Walk the virtual use-def chain to continue searching for a match if the def does not alias the reference we are looking for. * gcc.dg/tree-ssa/ssa-fre-11.c: New testcase. * gcc.dg/tree-ssa/ssa-fre-12.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-13.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-14.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-15.c: Likewise. * gcc.dg/tree-ssa/20031106-4.c: Remove XFAIL. From-SVN: r133222
2008-03-14re PR tree-optimization/34043 (Missed optimization causing extra loads and ↵Richard Guenther1-5/+93
stores when using x86_64 builtin function together with aggregate types.) 2008-03-14 Richard Guenther <rguenther@suse.de> PR tree-optimization/34043 PR tree-optimization/33989 * tree-ssa-pre.c (execute_pre): Allow SCCVN to do insertion when doing FRE. (bitmap_find_leader): Use extra argument to verify dominance relationship inside a basic-block. (can_PRE_operation): Add VIEW_CONVERT_EXPR. (find_leader_in_sets): Adjust. (create_component_ref_by_pieces): Take extra argument for dominance check, handle lookup failures. (find_or_generate_expression): Likewise. (create_expression_by_pieces): Likewise. (insert_into_preds_of_block): Adjust. (create_value_expr_from): If asked for, verify all operands are in the blocks AVAIL_OUT set. (make_values_for_stmt): Check for SSA_NAMEs that are life over an abnormal edge. (compute_avail): Remove such check. (do_SCCVN_insertion): New function. (eliminate): If we do not find a leader suitable for replacement insert a replacement expression from SCCVN if available. * tree-ssa-sccvn.h (run_scc_vn): Update prototype. (struct vn_ssa_aux): Add needs_insertion flag. * tree-ssa-sccvn.c (may_insert): New global flag. (copy_reference_ops_from_ref): Value-number union member access based on its size, not type and member if insertion is allowed. (visit_reference_op_load): For a weak match from union type punning lookup a view-converted value and insert a SSA_NAME for that value if that is not found. (visit_use): Make dumps shorter. Do not disallow value numbering SSA_NAMEs that are life over an abnormal edge to constants. (free_scc_vn): Release inserted SSA_NAMEs. (run_scc_vn): New flag to specify whether insertion is allowed. Process SSA_NAMEs in forward order. * tree-ssa-loop-im.c (for_each_index): Handle invariant ADDR_EXPRs inside VIEW_CONVERT_EXPR. * fold-const.c (fold_unary): Fold VIEW_CONVERT_EXPRs from/to pointer type to/from integral types that do not change the precision to regular conversions. * gcc.dg/tree-ssa/ssa-fre-7.c: New testcase. * gcc.dg/tree-ssa/ssa-fre-8.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-9.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-10.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-17.c: Likewise. From-SVN: r133218
2008-03-08tree-ssa-sccvn.h (vn_binary_op_lookup): Remove.Richard Guenther1-194/+89
2008-03-08 Richard Guenther <rguenther@suse.de> * tree-ssa-sccvn.h (vn_binary_op_lookup): Remove. (vn_binary_op_insert): Likewise. (vn_unary_op_lookup): Likewise. (vn_unary_op_insert): Likewise. (vn_nary_op_lookup): Declare. (vn_nary_op_insert): Likewise. * tree-ssa-sccvn.c (struct vn_tables_s): Merge unary and binary hashes, use a single obstack for unary_op_pool and binary_op_pool. (struct vn_binary_op_s, struct vn_unary_op_s): Replace with a single struct vn_nary_op_s. Store tree code length and a variable number of operands. (struct vn_reference_op_struct): Remove unused op2. (vn_reference_op_eq): Do not compare op2. (vn_reference_op_compute_hash): Do not compute hash of op2. (vn_unary_op_hash, vn_binary_op_hash): Replace with vn_nary_op_hash. (vn_unary_op_compute_hash, vn_binary_op_compute_hash): Replace with vn_nary_op_compute_hash. (vn_unary_op_eq, vn_binary_op_eq): Replace with vn_nary_op_eq. (vn_unary_op_lookup, vn_binary_op_lookup): Replace with vn_nary_op_lookup. (vn_unary_op_insert, vn_binary_op_insert): Replace with vn_nary_op_insert. (visit_unary_op): Call nary functions. (visit_binary_op): Likewise. (process_scc): Adjust for struct vn_tables_s changes. (allocate_vn_table): Likewise. (free_vn_table): Likewise. * tree-vn.c (vn_add): Call nary functions. (vn_lookup): Likewise. From-SVN: r133038
2008-03-03tree-ssa-sccvn.c (visit_reference_op_store): Do not insert struct copies ↵Richard Guenther1-3/+9
into the expression table. 2008-03-03 Richard Guenther <rguenther@suse.de> * tree-ssa-sccvn.c (visit_reference_op_store): Do not insert struct copies into the expression table. (simplify_unary_expression): Handle VIEW_CONVERT_EXPR. (try_to_simplify): Likewise. * fold-const.c (fold_unary): Fold VIEW_CONVERT_EXPR of integral and pointer arguments which do not change the precision to NOP_EXPRs. * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): Adjust VIEW_CONVERT_EXPR case. From-SVN: r132836
2008-02-29tree-ssa-pre.c (get_sccvn_value): Create missing VNs via vn_lookup_or_add.Richard Guenther1-13/+10
2008-02-29 Richard Guenther <rguenther@suse.de> * tree-ssa-pre.c (get_sccvn_value): Create missing VNs via vn_lookup_or_add. * tree-ssa-sccnv.c (visit_reference_op_store): Use the rhs value for comparing for a store match. (simplify_unary_expression): Do nothing for SSA_NAMEs. (try_to_simplify): Do not do a full-blown reference lookup. From-SVN: r132768
2008-02-28tree-ssa-sccvn (vn_ssa_aux_obstack): New obstack.Steven Bosscher1-13/+20
2008-02-28 Steven Bosscher <stevenb.gcc@gmail.com> * tree-ssa-sccvn (vn_ssa_aux_obstack): New obstack. (VN_INFO_GET): Allocate new objects on the obstack. (init_scc_vn): Initialize the obstack. Use XDELETE instead of free for rpo_numbers_temp, for consistency. (free_scc_vn): Free the obstack. From-SVN: r132750
2008-01-21re PR target/34856 (ICE with some constant vectors)Richard Guenther1-0/+1
2008-01-21 Richard Guenther <rguenther@suse.de> PR middle-end/34856 * tree-cfg.c (verify_expr): Allow all invariant expressions instead of just constant class ones as reference argument. * tree-ssa-loop-im.c (for_each_index): Handle CONSTRUCTOR like any other constant. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise. * gcc.c-torture/compile/pr34856.c: New testcase. From-SVN: r131696
2008-01-17Teach SCCVN that throwing expressions are not to be regenerated.Andrew MacLeod1-1/+2
http://gcc.gnu.org/ml/gcc-patches/2008-01/msg00764.html Teach SCCVN that throwing expressions are not to be regenerated. 2008-01-17 Andrew MacLeod <amacleod@redhat.com> * tree-ssa-sccvn.c (visit_use): Expressions which can throw are varying. * gcc.c-torture/compile/pr34648.c: New testcase. From-SVN: r131610
2008-01-11tree-ssa-sccvn.c (struct vn_binary_op_s): Move hashcode near opcode.Richard Guenther1-19/+23
2008-01-11 Richard Guenther <rguenther@suse.de> * tree-ssa-sccvn.c (struct vn_binary_op_s): Move hashcode near opcode. (struct vn_unary_op_s): Likewise. (vn_reference_insert): Free old reference on hash collision. From-SVN: r131462
2008-01-08re PR tree-optimization/34683 (SSA rewriting in the loop unroller causes ↵Richard Guenther1-7/+2
quadratic behavior) 2008-01-08 Richard Guenther <rguenther@suse.de> PR tree-optimization/34683 * tree-ssa-operands.c (operand_build_cmp): Export. * tree-ssa-operands.h (operand_build_cmp): Declare. * tree-vn.c (vuses_compare): Remove. (sort_vuses): Use operand_build_cmp. (sort_vuses_heap): Likewise. * tree-ssa-sccvn.c (vuses_to_vec): Use VEC_reserve, not VEC_alloc to re-use old VEC if available. Do not sort already sorted VUSEs. (vdefs_to_vec): Do not sort already sorted VDEFs. From-SVN: r131400
2008-01-07re PR tree-optimization/34683 (SSA rewriting in the loop unroller causes ↵Richard Guenther1-2/+6
quadratic behavior) 2008-01-07 Richard Guenther <rguenther@suse.de> PR tree-optimization/34683 * tree-ssa-sccvn.c (vuses_to_vec): Pre-allocate the vector of VOPs of the needed size to save memory. Use VEC_quick_push to save compile-time. (vdefs_to_vec): Likewise. From-SVN: r131375
2007-12-13re PR middle-end/34450 (compile takes up 1.8 GB RAM at -O1)Richard Guenther1-5/+31
2007-12-13 Richard Guenther <rguenther@suse.de> PR tree-optimization/34450 * params.def (PARAM_SCCVN_MAX_SCC_SIZE): New param. * invoke.texi (sccvn-max-scc-size): Document. * Makefile.in (tree-ssa-sccvn.o): Add $(PARAMS_H) dependency. * tree-ssa-sccvn.h (run_scc_vn): Return true on success, false on error. * tree-ssa-sccvn.c (params.h): Include. (DFS): Return true if all went well, return false as soon as a SCC exceeds the size of PARAM_SCCVN_MAX_SCC_SIZE. (run_scc_vn): Return true if all went well, return false if we aborted during DFS. * tree-ssa-pre.c (execute_pre): Check if SCCVN finished successfully, otherwise bail out. From-SVN: r130895
2007-11-23re PR tree-optimization/34176 (SCCVN breaks gettext)Richard Guenther1-0/+20
2007-11-23 Richard Guenther <rguenther@suse.de> Michael Matz <matz@suse.de> PR tree-optimization/34176 * alloc-pool.h (empty_alloc_pool): Declare. * alloc-pool.c (empty_alloc_pool): New function. * tree-ssa-sccvn.c (vn_reference_lookup): Also lookup from the valid table if a lookup from the optimistic table failed. (vn_unary_op_lookup): Likewise. (vn_binary_op_lookup): Likewise. (vn_phi_lookup): Likewise. (process_scc): Clear optimistic tables before every iteration. * gcc.c-torture/execute/pr34176.c: New testcase. Co-Authored-By: Michael Matz <matz@suse.de> From-SVN: r130379
2007-09-27re PR tree-optimization/33565 (spurious warning: assuming signed overflow ↵Ian Lance Taylor1-2/+7
does not occur when assuming that (X + c) >= X is always true) ./: PR tree-optimization/33565 * tree-ssa-loop-ch.c (copy_loop_headers): Set TREE_NO_WARNING on assignments of comparisons. * tree-ssa-sccvn.c (simplify_binary_expression): Add stmt parameter. Change caller. Defer overflow warnings around call to fold_binary. * fold-const.c (fold_undefer_overflow_warnings): Don't warn if TREE_NO_WARNING is set on the statement. * tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Don't test TREE_NO_WARNING when calling fold_undefer_overflow_warnings. * tree-cfg.c (fold_cond_expr_cond): Likewise. testsuite/: PR tree-optimization/33565 * gcc.dg/Wstrict-overflow-20.c: New test. From-SVN: r128840
2007-09-18re PR tree-optimization/33340 (ICE: SSA corruption with -O (FRE))Richard Guenther1-0/+5
2007-09-18 Richard Guenther <rguenther@suse.de> PR tree-optimization/33340 * tree-ssa-sccvn.c (set_ssa_val_to): Do not set values to SSA_NAMEs that occur in abnormal PHI nodes. * g++.dg/torture/pr33340.C: New testcase. From-SVN: r128571
2007-09-07re PR tree-optimization/32586 (New VN misses FRE opportunities)Richard Guenther1-12/+54
2007-09-07 Richard Guenther <rguenther@suse.de> PR tree-optimization/32586 * tree-ssa-sccvn.c (simplify_binary_expression): Avoid folding if nothing changed. (simplify_unary_expression): New function. Do tree combining on conversion like codes. (try_to_simplify): Call it. * g++.dg/tree-ssa/pr27090.C: Remove XFAILs. * gcc.dg/tree-ssa/ssa-fre-1.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-3.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-5.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-4.c: Likewise, remove scan for now obsolete simplification. From-SVN: r128251
2007-09-07revert: re PR tree-optimization/32586 (New VN misses FRE opportunities)Richard Guenther1-54/+12
2007-09-07 Richard Guenther <rguenther@suse.de> Revert 2007-09-06 Richard Guenther <rguenther@suse.de> PR tree-optimization/32586 * tree-ssa-sccvn.c (simplify_binary_expression): Avoid folding if nothing changed. (simplify_unary_expression): New function. Do tree combining on conversion like codes. (try_to_simplify): Call it. * g++.dg/tree-ssa/pr27090.C: Remove XFAILs. * gcc.dg/tree-ssa/ssa-fre-1.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-3.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-5.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-4.c: Likewise, remove scan for now obsolete simplification. From-SVN: r128236
2007-09-06re PR tree-optimization/32586 (New VN misses FRE opportunities)Richard Guenther1-12/+54
2007-09-06 Richard Guenther <rguenther@suse.de> PR tree-optimization/32586 * tree-ssa-sccvn.c (simplify_binary_expression): Avoid folding if nothing changed. (simplify_unary_expression): New function. Do tree combining on conversion like codes. (try_to_simplify): Call it. * builtins.c (fold_builtin_cexp): Fold the built expressions. * fold-const.c (fold_unary): Test result of get_callee_fndecl(). * g++.dg/tree-ssa/pr27090.C: Remove XFAILs. * gcc.dg/tree-ssa/ssa-fre-1.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-3.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-5.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-4.c: Likewise, remove scan for now obsolete simplification. From-SVN: r128189
2007-08-26tree-ssa-sccvn.c, [...]: Remove unnecessary trailing whitespace.Bernhard Fischer1-10/+10
2007-08-26 Bernhard Fischer <aldot@gcc.gnu.org> * tree-ssa-sccvn.c, tree-ssa-sccvn.h, tree-vn.c, tree-ssa-pre.c: Remove unnecessary trailing whitespace. From-SVN: r127816
2007-08-01re PR tree-optimization/32919 (SSA corruption because of abnormal edges and PRE)Daniel Jacobowitz1-0/+5
PR tree-optimization/32919 * tree-ssa-sccvn.c (visit_phi): Do not visit abnormal PHIs. * tree-ssa-coalesce.c (ssa_conflicts_dump): New. (coalesce_ssa_name): Call it. From-SVN: r127132
2007-07-26Change copyright header to refer to version 3 of the GNU General Public ↵Nick Clifton1-5/+4
License and to point readers at the COPYING3 file and the FSF's license web page. From-SVN: r126948
2007-07-25c-common.c (fname_as_string, [...]): Constify.Kaveh R. Ghazi1-14/+19
* c-common.c (fname_as_string, c_type_hash): Constify. * c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise. * cgraph.c (edge_hash, edge_eq): Likewise. * dwarf2out.c (decl_die_table_eq, decl_loc_table_eq): Likewise. * emit-rtl.c (mem_attrs_htab_eq, reg_attrs_htab_hash, reg_attrs_htab_eq): Likewise. * except.c (t2r_eq, t2r_hash, ttypes_filter_eq, ehl_hash, ehl_eq): Likewise. * genautomata.c (const_reserv_sets_t, const_unit_decl_t, const_decl_t, const_state_t, const_automata_list_el_t): New. (first_out_arc, DECL_UNIT, DECL_BYPASS, DECL_AUTOMATON, DECL_EXCL, DECL_PRESENCE, DECL_ABSENCE, DECL_RESERV, DECL_INSN_RESERV, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, alt_state_cmp, reserv_sets_cmp, reserv_sets_eq, state_hash, state_eq_p, automata_list_hash, automata_list_eq_p, compare_states_for_equiv, compare_max_occ_cycle_nums, out_state_arcs_num, compare_transition_els_num, units_cmp, state_reservs_cmp): Constify. * genmodes.c (cmp_modes): Likewise. * ggc-common.c (saving_htab_hash, saving_htab_eq): Likewise. * gimplify.c (compare_case_labels): Likewise. * ipa-type-escape.c (get_name_of_type, type_brand_s): Likewise. * loop-unroll.c (si_info_hash, ve_info_hash): Likewise. * matrix-reorg.c (mtt_info_hash): Likewise. * postreload-gcse.c (hash_expr_for_htab, expr_equiv_p): Likewise. * rtl-factoring.c (const_p_hash_bucket, const_p_hash_elem): New. (htab_hash_bucket, htab_hash_elem): Constify. * tree-browser.c (TB_parent_eq): Likewise. * tree-scalar-evolution.c (hash_scev_info): Likewise. * tree-ssa-alias.c (sort_tags_by_id): Likewise. * tree-ssa-coalesce.c (const_coalesce_pair_p): New. (coalesce_pair_map_hash, coalesce_pair_map_eq, compare_pairs): Constify. * tree-ssa-dom.c (avail_expr_hash, avail_expr_eq): Likewise. * tree-ssa-pre.c (const_expr_pred_trans_t): New. (expr_pred_trans_hash, expr_pred_trans_eq): Constify. * tree-ssa-sccvn.c (const_vn_binary_op_t, const_vn_unary_op_t, const_vn_phi_t, const_vn_reference_op_t, const_vn_reference_t): New. (vn_reference_op_eq, vn_reference_hash, vn_reference_eq, vn_unary_op_hash, vn_unary_op_eq, vn_binary_op_hash, vn_binary_op_eq, vn_phi_hash, vn_phi_eq): Constify. * tree-ssa-threadupdate.c (redirection_data_hash, redirection_data_eq): Likewise. * tree-ssa-uncprop.c (equiv_hash, equiv_eq): Likewise. * tree-ssa.c (var_ann_eq): Likewise. * tree-vrp.c (compare_case_labels): Likewise. * tree.c (int_cst_hash_hash, int_cst_hash_eq, tree_map_base_marked_p, type_hash_marked_p, tree_check_failed, tree_not_check_failed, tree_class_check_failed, tree_range_check_failed, tree_not_class_check_failed, omp_clause_check_failed, omp_clause_range_check_failed, tree_contains_struct_check_failed, tree_operand_check_failed): Likewise. * tree.h (tree_contains_struct_check_failed, tree_check_failed, tree_not_check_failed, tree_class_check_failed, tree_range_check_failed, tree_not_class_check_failed, tree_operand_check_failed, omp_clause_operand_check_failed, tree_operand_length): Likewise. * var-tracking.c (const_variable): New. (variable_htab_hash, variable_htab_eq): Constify. * varasm.c (const_desc_hash): Likewise. cp: * decl.c (typename_hash, typename_compare): Constify. * mangle.c (hash_type, compare_type): Likewise. * pt.c (eq_local_specializations, hash_local_specialization): Likewise. * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq, list_hash): Likewise. * typeck2.c (pat_compare): Likewise. fortran: * gfortran.h (generate_isocbinding_symbol): Constify. * symbol.c (gen_special_c_interop_ptr, gen_cptr_param, generate_isocbinding_symbol): Likewise. java: * class.c (java_treetreehash_hash, java_treetreehash_compare): Constify. * expr.c (type_assertion_eq): Likewise. * jcf-io.c (compare_path): Likewise. * jcf-parse.c (cmpstringp): Likewise. * verify-impl.c (get_one_type, compute_argument_types, compute_return_type): Likewise. objc: * objc-act.c (volatilized_hash, volatilized_eq, string_hash, string_eq): Constify. From-SVN: r126925
2007-07-18tree-ssa-sccvn.c (try_to_simplify): Use valid_gimple_expressionDaniel Berlin1-1/+1
2007-07-18 Daniel Berlin <dberlin@dberlin.org> * tree-ssa-sccvn.c (try_to_simplify): Use valid_gimple_expression * tree-ssa-propagate (valid_gimple_expression): Handle ADDR_EXPR properly. From-SVN: r126721
2007-07-14re PR tree-optimization/32705 (ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022)Eric Botcazou1-6/+8
PR tree-optimization/32705 * tree-ssa-sccvn.c (set_ssa_val_to): Accept VN_TOP as value number. (simplify_binary_expression): Use SSA_VAL consistently. From-SVN: r126637
2007-07-12re PR tree-optimization/32663 (revision 126369 went into an infinite loop)Daniel Berlin1-0/+8
2007-07-11 Daniel Berlin <dberlin@dberlin.org> PR tree-optimization/32663 * tree.h (VALUE_HANDLE_VUSES): Remove. (struct tree_value_handle): Remove vuses. * tree-vn.c (create_value_handle_for_expr): Don't set VALUE_HANDLE_VUSES. * tree-ssa-pre.c (expression_vuses): New. (alloc_expression_id): Set up expression_vuses. (get_expression_vuses): New. (set_expression_vuses): Ditto. (clear_expression_ids): Modify for expression_vuses. (phi_translate_1): Ditto. (phi_translate_set): Ditto. (value_dies_in_block_x): Ditto (valid_in_sets): Ditto. (add_to_sets): Ditto. (find_existing_value_expr): Ditto. (create_value_handle_for_expr): Ditto. (make_values_for_stmt): Ditto. (vuse_equiv): Remove. From-SVN: r126568
2007-07-11re PR tree-optimization/32713 (ICE in copy_reference_ops_from_ref, at ↵Eric Botcazou1-0/+1
tree-ssa-sccvn.c:550) PR tree-optimization/32713 * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle REAL_CST. From-SVN: r126547
2007-07-11re PR tree-optimization/32589 (exp_dbug.adb:981: error: invalid array index)Eric Botcazou1-30/+5
PR tree-optimization/32589 * doc/tree-ssa.texi (Rough GIMPLE Grammar): Add missing rule. * tree-gimple.c (is_gimple_min_invariant): Clarify head comment. * tree-ssa-propagate.c (valid_gimple_expression_p): New predicate, extracted from... (set_rhs): ...here. Call it for the expression on entry. * tree-ssa-propagate.h (valid_gimple_expression_p): Declare. * tree-ssa-sccvn.c: Include tree-ssa-propagate.h. (simplify_binary_expression): Use valid_gimple_expression_p to validate the simplification. * Makefile.in (tree-ssa-sccvn.o): Depends on tree-ssa-propagate.h. From-SVN: r126545
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-07re PR middle-end/23488 (GCSE load PRE does not work with non sets (or ↵Daniel Berlin1-2/+3
missing load PRE with plain decls)) 2007-07-06 Daniel Berlin <dberlin@dberlin.org> Fix PR tree-optimization/23488 * tree-ssa-sccvn.c (expr_has_constants): Handle tcc_declaration. (try_to_simplify): Ditto. (visit_use): Ditto. * tree-vn.c (set_value_handle): Use decl_vh_map for decl value handles. * tree-flow-inline.h (get_value_handle): Ditto. * tree-ssa-pre.c (decl_vh_map): New. (decl_node_pool): New. (can_value_number_operation): Support DECL_P. (can_PRE_operation): Ditto. (create_expression_by_pieces): Ditto. (find_existing_value_expr): Modify to differnetiate between addressing and top level. (create_value_handle_for_expr): Handle DECL's. (poolify_tree): Ditto. (make_values_for_phi): Don't insert into PHI_GEN during FRE. (make_values_for_stmt): Handle DECL's properly. (init_pre): Reorg to not init useless things during FRE. (fini_pre): Ditto. * tree-flow.h: Include pointer-set.h. (decl_vh_map): Declare. * Makefile.in (TREE_FLOW_H): Add pointer-set.h From-SVN: r126434
2007-07-04re PR tree-optimization/32604 (miscompilation at -O2)Daniel Berlin1-8/+0
2007-07-04 Daniel Berlin <dberlin@dberlin.org> PR tree-optimization/32604 PR tree-optimization/32606 * tree-ssa-pre.c (bb_bitmap_sets): Removed antic_safe_loads. (compute_antic_safe): Removed. (ANTIC_SAFE_LOADS): Ditto. (compute_antic_aux): Don't print ANTIC_SAFE_LOADS. (execute_pre): Don't call compute_antic_safe. (vuse_equiv): New function. (make_values_for_stmt): Use it * tree-ssa-sccvn.c (set_ssa_val_to): Remove assert, since it is not always true. From-SVN: r126338
2007-07-03tree-ssa-sccvn.c (set_ssa_val_to): Check for operand_equal_p before ↵Daniel Berlin1-1/+4
declaring inequality. 2007-07-03 Daniel Berlin <dberlin@dberlin.org> * tree-ssa-sccvn.c (set_ssa_val_to): Check for operand_equal_p before declaring inequality. From-SVN: r126252
2007-07-02re PR tree-optimization/32571 (ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1011)Daniel Berlin1-2/+7
2007-07-01 Daniel Berlin <dberlin@dberlin.org> Fix PR tree-optimization/32571 * tree-ssa-sccvn.c (visit_use): Shortcut copies to avoid simplifying them. From-SVN: r126186
2007-07-01tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle constants and ohter ↵Daniel Berlin1-2/+17
expected operations explicitly... 2007-07-01 Daniel Berlin <dberlin@dberlin.org> * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle constants and ohter expected operations explicitly, change default to gcc_unreachable. From-SVN: r126179
2007-06-30Fix PR tree-optimization/32540 Fix PR tree-optimization/31651Daniel Berlin1-0/+2043
2007-06-30 Daniel Berlin <dberlin@dberlin.org> Fix PR tree-optimization/32540 Fix PR tree-optimization/31651 * tree-ssa-sccvn.c: New file. * tree-ssa-sccvn.h: Ditto. * tree-vn.c: Include tree-ssa-sccvn.h (val_expr_paid_d): Removed. (value_table): Ditto. (vn_compute): Ditto. (val_expr_pair_hash): Ditto. (val_expr_pair_expr_eq): Ditto. (copy_vuses_from_stmt): Ditto. (vn_delete): Ditto. (vn_init): Ditto. (shared_vuses_from_stmt): Ditto. (print_creation_to_file): Moved up. (sort_vuses): Ditto. (sort_vuses_heap): Ditto. (set_value_handle): Make non-static. (make_value_handle): Ditto. (vn_add): Rewritten to use sccvn lookups. (vn_add_with_vuses): Ditto. (vn_lookup): Ditto (and second argument removed). (vn_lookup_with_vuses): Ditto. (vn_lookup_or_add): Ditto (and second argument removed); (vn_lookup_or_add_with_vuses): Ditto. (vn_lookup_with_stmt): New. (vn_lookup_or_add_with_stmt): Ditto. (create_value_handle_for_expr): Ditto. * tree-ssa-pre.c: Include tree-ssa-sccvn.h. (seen_during_translate): New function. (phi_trans_lookup): Use iterative_hash_expr, not vn_compute. (phi_trans_add): Ditto. (constant_expr_p): FIELD_DECL is always constant. (phi_translate_1): Renamed from phi_translate, add seen bitmap. Use constant_expr_p. Avoid infinite recursion on mutually valued expressions. Change callers of vn_lookup_or_add. (phi_translate): New function. (compute_antic_safe): Allow phi nodes. (create_component_ref_by_pieces): Update for FIELD_DECL change. (find_or_generate_expression): Rewrite slightly. (create_expression_by_pieces): Updated for vn_lookup_or_add change. Update VN_INFO for new names. (insert_into_preds_of_block): Update for new names. (add_to_exp_gen): New function. (add_to_sets): Use vn_lookup_or_add_with_stmt. (find_existing_value_expr): Rewrite to changed vn_lookup. (create_value_expr_from): Ditto, and use add_to_exp_gen. (try_look_through_load): Removed. (try_combine_conversion): Ditto. (get_sccvn_value): New function. (make_values_for_phi): Ditto. (make_values_for_stmt): Ditto. (compute_avail): Rewritten for vn_lookup_or_add changes and to use SCCVN. (init_pre): Update for SCCVN changes. (fini_pre): Ditto. (execute_pre): Ditto. * tree-flow.h (make_value_handle): Declare. (set_value_handle): Ditto. (sort_vuses_heap): Ditto. (vn_lookup_or_add_with_stmt): Ditto. (vn_lookup_with_stmt): Ditto. (vn_compute): Remove. (vn_init): Ditto. (vn_delete): Ditto. (vn_lookup): Update arguments. * Makefile.in (tree-ssa-pre.o): Add tree-ssa-sccvn.h (tree-vn.o): Ditto. (tree-ssa-sccvn.o): New. (OBJS-common): Add tree-ssa-sccvn.o From-SVN: r126149