1. 18 Mar, 2019 1 commit
  2. 13 Mar, 2019 1 commit
  3. 08 Mar, 2019 1 commit
    • re PR tree-optimization/89550 (Spurious array-bounds warning when using… · 1db01ff9
      re PR tree-optimization/89550 (Spurious array-bounds warning when using __PRETTY_FUNCTION__ as a string_view)
      
      	PR tree-optimization/89550
      	* builtins.c (c_strlen): Only set TREE_NO_WARNING if warning_at
      	returned true.  Formatting fixes.
      	(expand_builtin_strnlen): Formatting fixes.
      	* tree-vrp.c (vrp_prop::check_mem_ref): Only set TREE_NO_WARNING
      	if warning_at returned true.
      	* tree-cfg.c (pass_warn_function_return::execute): Likewise.
      c-family/
      	* c-common.c (c_common_truthvalue_conversion): Only set
      	TREE_NO_WARNING if warning_at returned true.
      	* c-warn.c (overflow_warning, warn_logical_operator): Likewise.
      c/
      	* c-decl.c (finish_function): Only set TREE_NO_WARNING if warning_at
      	returned true.
      	(c_write_global_declarations_1): Only set TREE_NO_WARNING if pedwarn
      	or warning returned true.
      cp/
      	* semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
      	warning_at returned true.
      	* decl2.c (c_parse_final_cleanups): Likewise.
      	* typeck.c (convert_for_assignment): Likewise.
      	* decl.c (finish_function): Likewise.
      
      From-SVN: r269485
      Jakub Jelinek committed
  4. 01 Feb, 2019 1 commit
  5. 01 Jan, 2019 1 commit
  6. 17 Dec, 2018 1 commit
    • Add a loop versioning pass · 13e08dc9
      This patch adds a pass that versions loops with variable index strides
      for the case in which the stride is 1.  E.g.:
      
          for (int i = 0; i < n; ++i)
            x[i * stride] = ...;
      
      becomes:
      
          if (stepx == 1)
            for (int i = 0; i < n; ++i)
              x[i] = ...;
          else
            for (int i = 0; i < n; ++i)
              x[i * stride] = ...;
      
      This is useful for both vector code and scalar code, and in some cases
      can enable further optimisations like loop interchange or pattern
      recognition.
      
      The pass gives a 7.6% improvement on Cortex-A72 for 554.roms_r at -O3
      and a 2.4% improvement for 465.tonto.  I haven't found any SPEC tests
      that regress.
      
      Sizewise, there's a 10% increase in .text for both 554.roms_r and
      465.tonto.  That's obviously a lot, but in tonto's case it's because
      the whole program is written using assumed-shape arrays and pointers,
      so a large number of functions really do benefit from versioning.
      roms likewise makes heavy use of assumed-shape arrays, and that
      improvement in performance IMO justifies the code growth.
      
      The next biggest .text increase is 4.5% for 548.exchange2_r.  I did see
      a small (0.4%) speed improvement there, but although both 3-iteration runs
      produced stable results, that might still be noise.  There was a slightly
      larger (non-noise) improvement for a 256-bit SVE model.
      
      481.wrf and 521.wrf_r .text grew by 2.8% and 2.5% respectively, but
      without any noticeable improvement in performance.  No other test grew
      by more than 2%.
      
      Although the main SPEC beneficiaries are all Fortran tests, the
      benchmarks we use for SVE also include some C and C++ tests that
      benefit.
      
      Using -frepack-arrays gives the same benefits in many Fortran cases.
      The problem is that using that option inappropriately can force a full
      array copy for arguments that the function only reads once, and so it
      isn't really something we can turn on by default.  The new pass is
      supposed to give most of the benefits of -frepack-arrays without
      the risk of unnecessary repacking.
      
      The patch therefore enables the pass by default at -O3.
      
      2018-12-17  Richard Sandiford  <richard.sandiford@arm.com>
      	    Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
      	    Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
      
      gcc/
      	* doc/invoke.texi (-fversion-loops-for-strides): Document
      	(loop-versioning-group-size, loop-versioning-max-inner-insns)
      	(loop-versioning-max-outer-insns): Document new --params.
      	* Makefile.in (OBJS): Add gimple-loop-versioning.o.
      	* common.opt (fversion-loops-for-strides): New option.
      	* opts.c (default_options_table): Enable fversion-loops-for-strides
      	at -O3.
      	* params.def (PARAM_LOOP_VERSIONING_GROUP_SIZE)
      	(PARAM_LOOP_VERSIONING_MAX_INNER_INSNS)
      	(PARAM_LOOP_VERSIONING_MAX_OUTER_INSNS): New parameters.
      	* passes.def: Add pass_loop_versioning.
      	* timevar.def (TV_LOOP_VERSIONING): New time variable.
      	* tree-ssa-propagate.h
      	(substitute_and_fold_engine::substitute_and_fold): Add an optional
      	block parameter.
      	* tree-ssa-propagate.c
      	(substitute_and_fold_engine::substitute_and_fold): Likewise.
      	When passed, only walk blocks dominated by that block.
      	* tree-vrp.h (range_includes_p): Declare.
      	(range_includes_zero_p): Turn into an inline wrapper around
      	range_includes_p.
      	* tree-vrp.c (range_includes_p): New function, generalizing...
      	(range_includes_zero_p): ...this.
      	* tree-pass.h (make_pass_loop_versioning): Declare.
      	* gimple-loop-versioning.cc: New file.
      
      gcc/testsuite/
      	* gcc.dg/loop-versioning-1.c: New test.
      	* gcc.dg/loop-versioning-10.c: Likewise.
      	* gcc.dg/loop-versioning-11.c: Likewise.
      	* gcc.dg/loop-versioning-2.c: Likewise.
      	* gcc.dg/loop-versioning-3.c: Likewise.
      	* gcc.dg/loop-versioning-4.c: Likewise.
      	* gcc.dg/loop-versioning-5.c: Likewise.
      	* gcc.dg/loop-versioning-6.c: Likewise.
      	* gcc.dg/loop-versioning-7.c: Likewise.
      	* gcc.dg/loop-versioning-8.c: Likewise.
      	* gcc.dg/loop-versioning-9.c: Likewise.
      	* gfortran.dg/loop_versioning_1.f90: Likewise.
      	* gfortran.dg/loop_versioning_2.f90: Likewise.
      	* gfortran.dg/loop_versioning_3.f90: Likewise.
      	* gfortran.dg/loop_versioning_4.f90: Likewise.
      	* gfortran.dg/loop_versioning_5.f90: Likewise.
      	* gfortran.dg/loop_versioning_6.f90: Likewise.
      	* gfortran.dg/loop_versioning_7.f90: Likewise.
      	* gfortran.dg/loop_versioning_8.f90: Likewise.
      
      From-SVN: r267197
      Richard Sandiford committed
  7. 11 Dec, 2018 1 commit
    • re PR tree-optimization/88444 (ICE: tree check: expected ssa_name, have… · ccef6716
      re PR tree-optimization/88444 (ICE: tree check: expected ssa_name, have integer_cst in live_on_edge, at tree-vrp.c:468; or ICE: tree check: expected ssa_name, have integer_cst in get_value_range, at vr-values.c:84)
      
      	PR tree-optimization/88444
      	* tree-vrp.c (register_edge_assert_for_2): Only register assertions
      	for conversions if rhs1 is a SSA_NAME.
      
      	* gcc.dg/pr88444.c: New test.
      
      From-SVN: r267026
      Jakub Jelinek committed
  8. 06 Dec, 2018 1 commit
    • re PR tree-optimization/88367 (-fno-delete-null-pointer-checks doesn't work properly) · b8a003c1
      	PR c/88367
      	* tree-vrp.c (extract_range_from_binary_expr): For POINTER_PLUS_EXPR
      	with -fno-delete-null-pointer-checks, set_nonnull only if the pointer
      	is non-NULL and offset is known to have most significant bit clear.
      	* vr-values.c (vr_values::vrp_stmt_computes_nonzero): For ADDR_EXPR
      	of MEM_EXPR, return true if the MEM_EXPR has non-zero offset with
      	most significant bit clear.  If offset does have most significant bit
      	set and -fno-delete-null-pointer-checks, don't return true even if
      	the base pointer is non-NULL.
      
      	* gcc.dg/tree-ssa/pr88367.c: New test.
      
      From-SVN: r266878
      Jakub Jelinek committed
  9. 04 Dec, 2018 1 commit
  10. 03 Dec, 2018 1 commit
  11. 30 Nov, 2018 1 commit
  12. 16 Nov, 2018 1 commit
  13. 14 Nov, 2018 1 commit
    • * gimple-ssa-evrp-analyze.c · ff361cc6
      	(evrp_range_analyzer::record_ranges_from_incoming_edge): Rename
      	ignore_equivs_equal_p to equal_p.
      	* ipa-cp.c (meet_with_1): Use equal_p instead of
      	ignore_equivs_equal_p.
      	* ipa-prop.c (ipa_vr_ggc_hash_traits::equal): Same.
      	* tree-vrp.c (value_range::ignore_equivs_equal_p): Remove.
      	(value_range::operator==): Remove.
      	(value_range::operator!=): Remove.
      	(vrp_prop::visit_stmt): Use equal_p.
      	* tree-vrp.h (value_range): Remove operator==, operator!=,
      	ignore_equivs_equal_p.
      	* vr-values.c (update_value_range): Use equal_p.
      
      From-SVN: r266150
      Aldy Hernandez committed
  14. 13 Nov, 2018 2 commits
    • tree-vrp.c (value_range_base::dump): Dump type. · f824e18c
      	* tree-vrp.c (value_range_base::dump): Dump type.
      	Do not use INF nomenclature for 1-bit types.
      	(dump_value_range): Group all variants to common dumping code.
      	(debug): New overloaded functions for value_ranges.
      	(value_range_base::dump): Remove no argument version.
      	(value_range::dump): Same.
      
      testsuite/
      	* gcc.dg/tree-ssa/pr64130.c: Adjust for new value_range pretty
      	printer.
      	* gcc.dg/tree-ssa/vrp92.c: Same.
      
      From-SVN: r266077
      Aldy Hernandez committed
    • tree-ssanames.h (set_range_info): Use value_range_base. · 9384a5af
      2018-11-13  Richard Biener  <rguenther@suse.de>
      
      	* tree-ssanames.h (set_range_info): Use value_range_base.
      	(get_range_info): Likewise.
      	* tree-ssanames.c (set_range_info): Likewise.
      	(get_range_info): Likewise.
      	* tree-vrp.c (value_range_base::union_helper): Split
      	out common parts of value_range[_base]::union_.
      	(value_range_base::union_): Update.
      	(value_range::union_): Likewise.
      	(determine_value_range_1): Use value_range_base.
      	(determine_value_range): Likewise.
      	* tree-vrp.h (value_range_base::union_helper): Move ...
      	(value_range::union_helper): ... from here.
      
      From-SVN: r266061
      Richard Biener committed
  15. 12 Nov, 2018 3 commits
    • 2018-11=12 Richard Biener <rguenther@suse.de> · 27922d51
      	* tree-vrp.h (value_range[_base]::set): Make public.  Provide
      	overload for single value.
      	(value_range[_base]::set_nonnull): New.
      	(value_range[_base]::set_null): Likewise.
      	(value_range): Document bitmap copying behavior, mark
      	copy constructor and assignment operator deleted.
      	(value_range::move): New.
      	(value_range::set_and_canonicalize): Default bitmap to zero.
      	(set_value_range_to_nonnull): Remove.
      	(set_value_range_to_null): Likewise.
      	(set_value_range): Likewise.
      	(set_value_range_to_value): Likewise.
      	(extract_range_from_unary_expr): Work on value_range_base.
      	(extract_range_from_binary_expr_1): Likewise.  Rename to...
      	(extract_range_from_binary_expr): ... this.
      	* tree-vrp.c (value_range::update): Clear equiv bitmap
      	if required.
      	(value_range::move): New, move equiv bitmap.
      	(value_range_base::set_undefined): Avoid assignment.
      	(value_range::set_undefined): Likewise.
      	(value_range_base::set_varying): Likewise.
      	(value_range::set_varying): Likewise.
      	(set_value_range): Remove.
      	(value_range_base::set): New overload for value.
      	(value_range::set): Likewise.
      	(set_value_range_to_nonnull): Remove.
      	(value_range_base::set_nonnull): New.
      	(value_range::set_nonnull): Likewise.
      	(set_value_range_to_null): Remove.
      	(value_range_base::set_null): New.
      	(value_range::set_null): Likewise.
      	(range_is_null): Work on value_range_base.
      	(range_is_nonnull): Likewise.
      	(ranges_from_anti_range): Likewise.
      	(extract_range_into_wide_ints): Likewise.
      	(extract_range_from_multiplicative_op): Likewise.
      	(extract_range_from_binary_expr): Likewise.  Update for API changes.
      	(extract_range_from_unary_expr): Likewise.  Remove OBJ_TYPE_REF
      	handling.
      	(value_range::intersect_helper): Avoid copy and assignment.
      	(value_range::union_helper): Likewise.
      	(determine_value_range_1): Adjust.
      	* gimple-ssa-evrp-analyze.c (evrp_range_analyzer::try_find_new_range):
      	Avoid assignment by using move.
      	(evrp_range_analyzer::record_ranges_from_stmt): Avoid assignment.
      	* tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
      	Likewise.
      	* tree-ssanames.c (get_range_info): Likewise.
      	* vr-values.h (vr_values::get_vr_for_comparison): Adjust API.
      	* vr-values.c (vr_values::get_value_range): Adjust.
      	(vr_values::update_value_range): Likewise.
      	(symbolic_range_based_on_p): Work on value_range_base.
      	(vr_values::extract_range_from_binary_expr): Use value_range_base.
      	(vr_values::extract_range_from_unary_expr): Likewise.
      	(vr_values::extract_range_from_cond_expr): Avoid assignment.
      	(vr_values::extract_range_from_comparison): Adjust.
      	(vr_values::check_for_binary_op_overflow): Use value_range_base.
      	(vr_values::extract_range_basic): Adjust.
      	(vr_values::adjust_range_with_scev): Likewise.
      	(vr_values::vrp_visit_assignment_or_call): Likewise.
      	(vr_values::get_vr_for_comparison): Change API to avoid
      	assignment and copy construction.
      	(vr_values::compare_name_with_value): Adjust accordingly.
      	(vr_values::compare_names): Likewise.
      	(vr_values::extract_range_from_phi_node): Avoid assignment and
      	bogus in-place modify of equiv bitmap.
      	(vr_values::simplify_bit_ops_using_ranges): Use value_range_base.
      	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Adjust
      	for extract_range_from_unary_expr API change.
      	* ipa-cp.c (ipa_vr_operation_and_type_effects): Likewise.
      
      From-SVN: r266030
      Richard Biener committed
    • tree-vrp.h (value_range_base::symbolic_p, [...]): Move from value_range. · c49eeac3
      2018-11-12  Richard Biener  <rguenther@suse.de>
      
      	* tree-vrp.h (value_range_base::symbolic_p,
      	value_range_base::constant_p, value_range_base::zero_p,
      	value_range_base::singleton_p): Move from value_range.
      	(value_range::dump): Add.
      	* gimple-ssa-evrp-analyze.c
      	(evrp_range_analyzer::record_ranges_from_phis): Use set_varying.
      	* ipa-cp.c (ipcp_vr_lattice::print): Use dump_value_range.
      	* tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
      	Use set_varying.
      	* tree-vrp.c (value_range::symbolic_p): Move to value_range_base.
      	(value_range::constant_p): Likewise.
      	(value_range::singleton_p): Likewise.
      	(value_range_base::dump): Add.
      	(set_value_range_to_undefined): Remove.
      	(set_value_range_to_varying): Likewise.
      	(range_int_cst_p): Take value_range_base argument.
      	(range_int_cst_singleton_p): Likewise.
      	(value_range_constant_singleton): Likewise.
      	(vrp_set_zero_nonzero_bits): Likewise.
      	(extract_range_from_multiplicative_op): Use set_varying.
      	(extract_range_from_binary_expr_1): Likewise. Use set_undefined.
      	(extract_range_from_unary_expr): Likewise.
      	(dump_value_range_base): Change to overload of dump_value_range.
      	(vrp_prop::vrp_initialize): Use set_varying and set_undefined.
      	(vrp_prop::visit_stmt): Likewise.
      	(value_range::intersect_helper): Likewise.
      	(value_range::union_helper): Likewise.
      	(determine_value_range_1): Likewise.
      
      From-SVN: r266028
      Richard Biener committed
    • tree-vrp.c (set_value_range_to_nonnull): Clear equiv. · bdfac905
      2018-11-12  Richard Biener  <rguenther@suse.de>
      
      	* tree-vrp.c (set_value_range_to_nonnull): Clear equiv.
      	(set_value_range_to_null): Likewise.
      	* vr-values.c (vr_values::extract_range_from_comparison):
      	Clear equiv for constant singleton ranges.
      
      From-SVN: r266027
      Richard Biener committed
  16. 11 Nov, 2018 1 commit
    • tree-vrp.h (class value_range_base): New base class for value_range containing… · 2506b92c
      tree-vrp.h (class value_range_base): New base class for value_range containing all but the m_equiv member.
      
      2018-11-11  Richard Biener  <rguenther@suse.de>
      
      	* tree-vrp.h (class value_range_base): New base class for
      	value_range containing all but the m_equiv member.
      	(dump_value_range_base): Add.
      	(range_includes_zero_p): Work on value_range_base.
      	* tree-vrp.c (value_range_base::set): Split out base handling
      	from...
      	(value_range::set): this.
      	(value_range::set_equiv): New.
      	(value_range_base::value_range_base): New constructors.
      	(value_range_base::check): Split out base handling from...
      	(value_range::check): this.
      	(value_range::equal_p): Refactor in terms of
      	ignore_equivs_equal_p which is now member of the base.
      	(value_range_base::set_undefined): New.
      	(value_range_base::set_varying): Likewise.
      	(value_range_base::dump):Split out base handling from...
      	(value_range::dump): this.
      	(value_range_base::set_and_canonicalize): Split out base handling
      	from...
      	(value_range::set_and_canonicalize): this.
      	(value_range_base::union_): New.
      	* ipa-prop.h (struct ipa_jump_func): Use value_range_base *
      	for m_vr.
      	* ipa-cp.c (class ipcp_vr_lattice): Use value_range_base
      	instead of value_range everywhere.
      	(ipcp_vr_lattice::print): Use dump_value_range_base.
      	(ipcp_vr_lattice::meet_with): Adjust.
      	(ipcp_vr_lattice::meet_with_1): Likewise.
      	(ipa_vr_operation_and_type_effects): Likewise.
      	(propagate_vr_across_jump_function): Likewise.
      	* ipa-prop.c (struct ipa_vr_ggc_hash_traits): Likewise.
      	(ipa_get_value_range): Likewise.
      	(ipa_set_jfunc_vr): Likewise.
      	(ipa_compute_jump_functions_for_edge): Likewise.
      
      From-SVN: r266011
      Richard Biener committed
  17. 09 Nov, 2018 3 commits
  18. 23 Oct, 2018 1 commit
  19. 22 Oct, 2018 2 commits
    • 2018-10-22 Richard Biener <rguenther@suse.de> · e86087ee
      	* gimple-ssa-evrp-analyze.c
      	(evrp_range_analyzer::record_ranges_from_incoming_edge): Be
      	smarter about what ranges to use.
      	* tree-vrp.c (add_assert_info): Dump here.
      	(register_edge_assert_for_2): Instead of here at multiple but
      	not all places.
      
      	* gcc.dg/tree-ssa/evrp12.c: New testcase.
      	* gcc.dg/predict-6.c: Adjust.
      	* gcc.dg/tree-ssa/vrp33.c: Disable EVRP.
      	* gcc.dg/tree-ssa/vrp02.c: Likewise.
      	* gcc.dg/tree-ssa/cunroll-9.c: Likewise.
      
      From-SVN: r265391
      Richard Biener committed
    • re PR bootstrap/87640 (internal compiler error: in check, at tree-vrp.c:155) · 893ade8b
      2018-10-22  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/87640
      	* tree-vrp.c (set_value_range_with_overflow): Decompose
      	incomplete result.
      	(extract_range_from_binary_expr_1): Adjust.
      
      	* gcc.dg/torture/pr87640.c: New testcase.
      
      From-SVN: r265375
      Richard Biener committed
  20. 17 Oct, 2018 3 commits
    • bitmap.c (bitmap_head::dump): New. · 54994253
      	* bitmap.c (bitmap_head::dump): New.
      	* bitmap.h (bitmap_head): Add dump().
      	* gimple-ssa-evrp-analyze.c
      	(evrp_range_analyzer::try_find_new_range): Adjust for value_range API.
      	(evrp_range_analyzer::set_ssa_range_info): Same.
      	(evrp_range_analyzer::record_ranges_from_phis): Same.
      	(evrp_range_analyzer::record_ranges_from_stmt): Same.
      	* gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children): Same.
      	* gimple-ssa-sprintf.c (get_int_range): Same.
      	(format_integer): Same.
      	(sprintf_dom_walker::handle_gimple_call): Same.
      	* ipa-cp.c (ipcp_vr_lattice::meet_with_1): Same.
      	(ipcp_vr_lattice::top_p): Same.
      	(ipcp_vr_lattice::bottom_p): Same.
      	(ipcp_vr_lattice::set_to_bottom): Same.
      	(ipa_vr_operation_and_type_effects): Same.
      	(propagate_vr_across_jump_function): Same.
      	(ipcp_store_vr_results): Same.
      	* ipa-prop.c (struct ipa_vr_ggc_hash_traits): Same.
      	(ipa_print_node_jump_functions_for_edge): Same.
      	(ipa_get_value_range): Same.
      	(ipa_compute_jump_functions_for_edge): Same.
      	(ipa_write_jump_function): Same.
      	* tree-ssa-dom.c (simplify_stmt_for_jump_threading): Same.
      	* tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
      	Same.
      	* vr-values.c (set_value_range_to_nonnegative): Same.
      	(set_value_range_to_truthvalue): Same.
      	(vr_values::get_value_range): Same.
      	(vr_values::set_defs_to_varying): Same.
      	(vr_values::update_value_range): Same.
      	(symbolic_range_based_on_p): Same.
      	(vr_values::op_with_boolean_value_range_p): Same.
      	(vr_values::extract_range_for_var_from_comparison_expr): Same.
      	(vr_values::extract_range_from_ssa_name): Same.
      	(vr_values::extract_range_from_binary_expr): Same.
      	(vr_values::extract_range_from_unary_expr): Same.
      	(vr_values::extract_range_from_cond_expr): Same.
      	(vr_values::extract_range_from_comparison): Same.
      	(vr_values::check_for_binary_op_overflow): Same.
      	(vr_values::extract_range_basic): Same.
      	(vr_values::extract_range_from_assignment): Same.
      	(compare_ranges): Same.
      	(compare_range_with_value): Same.
      	(vr_values::adjust_range_with_scev): Same.
      	(vrp_valueize): Same.
      	(vrp_valueize_1): Same.
      	(vr_values::get_vr_for_comparison): Same.
      	(vr_values::compare_name_with_value): Same.
      	(vr_values::compare_names): Same.
      	(vr_values::vrp_evaluate_conditional): Same.
      	(find_case_label_ranges): Same.
      	(vr_values::vrp_visit_switch_stmt): Same.
      	(vr_values::extract_range_from_phi_node): Same.
      	(vr_values::simplify_div_or_mod_using_ranges): Same.
      	(vr_values::simplify_bit_ops_using_ranges): Same.
      	(test_for_singularity): Same.
      	(range_fits_type_p): Same.
      	(vr_values::simplify_cond_using_ranges_1): Same.
      	(vr_values::simplify_switch_using_ranges): Same.
      	(vr_values::simplify_float_conversion_using_ranges): Same.
      	(vr_values::two_valued_val_range_p): Same.
      	(vr_values::add_equivalence): Move to value_range::equiv_add.
      	* vr-values.h (vr_values::add_equivalence): Remove.
      	(VR_INITIALIZER): Remove.
      	* tree-vrp.c (value_range::set): New.
      	(value_range::equiv_add): New.
      	(value_range::value_range): New.
      	(value_range::deep_copy): New.
      	(value_range::check): New.
      	(value_range::equal_p): New.
      	(value_range::ignore_equivs_equal_p): New.
      	(value_range::operator==): New.
      	(value_range::operator!=): New.
      	(value_range::symbolic_p): New.
      	(value_range::numeric_p): New.
      	(value_range::set_undefined): New.
      	(value_range::set_varying): New.
      	(value_range::may_contain_p): New.
      	(value_range::equiv_clear): New.
      	(value_range::singleton_p): New.
      	(value_range::intersect): New.
      	(value_range::dump): New.
      	(value_range::set_and_canonicalize): New.
      	(set_value_range): Adjust for value_range API.
      	(set_value_range_to_undefined): Same.
      	(set_value_range_to_varying): Same.
      	(set_and_canonicalize_value_range): Same.
      	(set_value_range_to_nonnull): Same.
      	(set_value_range_to_null): Same.
      	(range_is_null): Same.
      	(range_is_nonnull): Same.
      	(range_int_cst_p): Same.
      	(range_int_cst_singleton_p): Same.
      	(symbolic_range_p): Same.
      	(range_includes_zero_p): Same.
      	(value_range_constant_singleton): Same.
      	(vrp_set_zero_nonzero_bits): Same.
      	(ranges_from_anti_range): Same.
      	(extract_range_into_wide_ints): Same.
      	(extract_range_from_multiplicative_op): Same.
      	(set_value_range_with_overflow): Same.
      	(extract_range_from_binary_expr_1): Same.
      	(extract_range_from_unary_expr): Same.
      	(dump_value_range): Same.
      	(debug_value_range): Same.
      	(vrp_prop::check_array_ref): Same.
      	(vrp_prop::check_mem_ref): Same.
      	(vrp_prop::vrp_initialize): Same.
      	(vrp_prop::visit_stmt): Same.
      	(intersect_ranges): Same.
      	(vrp_prop::visit_phi): Same.
      	(vrp_prop::vrp_finalize): Same.
      	(determine_value_range_1): Same.
      	(determine_value_range): Same.
      	(vrp_intersect_ranges_1): Rename to...
      	(vrp_intersect_1): this.
      	(vrp_intersect_ranges): Rename to...
      	(value_range::intersect_helper): ...this.
      	(vrp_meet_1): Rename to...
      	(value_range::union_helper): ...this.
      	(vrp_meet): Rename to...
      	(value_range::union_): ...this.
      	(copy_value_range): Remove.
      	* tree-vrp.h (struct value_range): Rewrite into a proper class.
      	(value_range::vrtype): New.
      	(value_range::type): New.
      	(value_range::equiv): New.
      	(value_range::min): New.
      	(value_range::max): New.
      	(value_range::varying_p): New.
      	(value_range::undefined_p): New.
      	(value_range::null_p): New.
      	(value_range::equiv_add): New.
      	(copy_value_range): Remove.
      
      From-SVN: r265241
      Aldy Hernandez committed
    • tree-vrp.c (extract_range_from_multiplicative_op): Remove overflow wraps argument. · e8f1d5cb
              * tree-vrp.c (extract_range_from_multiplicative_op): Remove
      	overflow wraps argument.
              (extract_range_from_binary_expr_1): Do not pass overflow wraps to
      	wide_int_range_multiplicative_op.
              * wide-int-range.cc (wide_int_range_mult_wrapping): Remove
      	overflow wraps argument.
              (wide_int_range_multiplicative_op): Same.
              (wide_int_range_lshift): Same.
              (wide_int_range_div): Same.
              * wide-int-range.h (wide_int_range_multiplicative_op): Same.
              (wide_int_range_lshift): Same.
              (wide_int_range_div): Same.
      
      From-SVN: r265238
      Aldy Hernandez committed
    • wide-int-range.h (wide_int_range_shift_undefined_p): Adjust to use sign as argument. · fa6b20f3
      	* wide-int-range.h (wide_int_range_shift_undefined_p): Adjust to
      	use sign as argument.
      	* tree-vrp.c (extract_range_from_binary_expr_1): Pass sign to
      	wide_int_range_shift_undefined_p.
      
      From-SVN: r265237
      Aldy Hernandez committed
  21. 03 Oct, 2018 2 commits
  22. 25 Sep, 2018 1 commit
    • Remove unused functions and fields. · 72744f65
      2018-09-25  Martin Liska  <mliska@suse.cz>
      
      	* alias.c (set_dest_equal_p): Remove unused function.
      	* config/i386/i386.c (def_builtin_pure2): Likewise.
      	* diagnostic-show-locus.c (class layout): Remove
      	unused field.
      	(layout::layout): Likewise here.
      	* dump-context.h (class temp_dump_context): Likewise.
      	* dwarf2out.c (add_AT_fde_ref): Remove unused function.
      	(add_AT_loclistsptr): Likewise.
      	(add_AT_offset): Likewise.
      	(get_AT_hi_pc): Likewise.
      	(is_comdat_die): Likewise.
      	(type_is_enum): Likewise.
      	(ceiling): Likewise.
      	(add_AT_vms_delta): Likewise.
      	(is_class_die): Likewise.
      	* edit-context.c (class line_event): Remove unused field.
      	* graphite-sese-to-poly.c (tree_int_to_gmp): Remove
      	unused function.
      	* ipa-cp.c (ipa_get_vr_lat): Likewise.
      	* lra-constraints.c (ok_for_index_p_nonstrict): Likewise.
      	(ok_for_base_p_nonstrict): Likewise.
      	* tree-chrec.c (is_not_constant_evolution): Likewise.
      	(chrec_fold_poly_cst): Likewise.
      	* tree-if-conv.c (has_pred_critical_p): Likewise.
      	* tree-ssa-coalesce.c (print_exprs): Likewise.
      	* tree-ssa-pre.c (bitmap_set_contains_expr): Likewise.
      	* tree-ssa-uninit.c (is_and_or_or_p): Likewise.
      	* tree-vrp.c (value_ranges_intersect_p): Likewise.
      	(value_range_nonnegative_p): Likewise.
      2018-09-25  Martin Liska  <mliska@suse.cz>
      
      	* name-lookup.c (namespace_scope_ht_size): Remove
      	unused function.
      	* parser.c (cp_lexer_next_token_is_not_keyword): Likewise.
      2018-09-25  Martin Liska  <mliska@suse.cz>
      
      	* trans.c (remove_suffix): Remove
      	unused function.
      2018-09-25  Martin Liska  <mliska@suse.cz>
      
      	* gofrontend/escape.cc (Gogo::analyze_escape): Remove
      	usage of a parameter.
      	(Gogo::assign_connectivity): Likewise.
      	(class Escape_analysis_tag): Likewise.
      	(Gogo::tag_function): Likewise.
      	* gofrontend/expressions.cc (Call_expression::do_type): Likewise.
      	* gofrontend/gogo.h (class Gogo): Likewise.
      	* gofrontend/types.cc (class Call_multiple_result_type): Likewise.
      	(Type::make_call_multiple_result_type): Likewise.
      	* gofrontend/types.h (class Type): Likewise.
      	* gofrontend/wb.cc (class Check_escape): Likewise.
      	(Gogo::add_write_barriers): Likewise.
      
      From-SVN: r264561
      Martin Liska committed
  23. 21 Sep, 2018 1 commit
    • gimple-ssa-evrp.c (evrp_dom_walker::cleanup): Call vr_values::cleanup_edges_and_switches. · 35b66f30
      	* gimple-ssa-evrp.c (evrp_dom_walker::cleanup): Call
      	vr_values::cleanup_edges_and_switches.
      	* tree-vrp.c (to_remove_edges, to_update_switch_stmts): Moved into
      	vr_values class.
      	(identify_jump_threads): Remove EDGE_IGNORE handling.
      	(execute_vrp): Move handling of to_remove_edges and
      	to_update_switch_stmts into vr_values class member functions.
      	* tree-vrp.h (switch_update, to_remove_edges): Remove declarations.
      	(to_update_switch_stmts): Likewise.
      	* vr-values.c: Include cfghooks.h.
      	(vr_values::vr_values): Initialize to_remove_edges and
      	to_update_switch_stmts.
      	(vr_values::~vr_values): Verify to_remove_edges and
      	to_update_switch_stmts are empty.
      	(vr_values::simplify_switch_using_ranges): Set EDGE_IGNORE as needed.
      	(vr_values::cleanup_edges_and_switches): New member function.
      	* vr-values.h (vr_values): Add cleanup_edges_and_switches member
      	function.  Add new data members.
      
      	* gcc.dg/tree-ssa/vrp113.c: Disable EVRP.
      	* gcc.dg/tree-ssa/vrp120.c: New test.
      
      From-SVN: r264491
      Jeff Law committed
  24. 17 Sep, 2018 1 commit
  25. 14 Sep, 2018 1 commit
  26. 12 Sep, 2018 1 commit
  27. 11 Sep, 2018 1 commit
  28. 04 Sep, 2018 2 commits
    • wide-int-range.cc (wide_int_range_convert): New. · 150655ee
      	* wide-int-range.cc (wide_int_range_convert): New.
      	* wide-int-range.h (wide_int_range_convert): New.
      	* tree-vrp.c (extract_range_from_unary_expr): Abstract wide int
      	code into wide_int_range_convert.
      	(extract_range_into_wide_ints): Do not munge anti range constants
      	into the entire domain.  Just return the range back.
      
      From-SVN: r264085
      Aldy Hernandez committed
    • tree-vrp.c (vrp_can_optimize_bit_op): Remove. · e20d979b
      	* tree-vrp.c (vrp_can_optimize_bit_op): Remove.
      	(extract_range_from_binary_expr_1): Do not call
      	vrp_can_optimize_bit_op.
      	* wide-int-range.cc (wide_int_range_can_optimize_bit_op): Make
      	static.
      	(wide_int_range_get_mask_and_bounds): New.
      	(wide_int_range_optimize_bit_op): New.
      	(wide_int_range_bit_ior): Call wide_int_range_optimize_bit_op.
      	(wide_int_range_bit_and): Same.
      	* wide-int-range.h (wide_int_range_can_optimize_bit_op): Remove.
      	(wide_int_range_optimize_bit_op): New.
      	(wide_int_range_get_mask_and_bounds): New.
      
      From-SVN: r264078
      Aldy Hernandez committed
  29. 31 Aug, 2018 1 commit
    • tree-vrp: add "const" qualifier to various value_range pointers · 01540df2
      gcc/ChangeLog:
      	* tree-vrp.c (copy_value_range): Convert param "from" from
      	"value_range *" to "const value_range *".
      	(range_is_null): Likewise for param "vr".
      	(range_int_cst_p): Likewise.
      	(range_int_cst_singleton_p): Likewise.
      	(symbolic_range_p): Likewise.
      	(value_ranges_intersect_p): Likewise for both params.
      	(value_range_nonnegative_p): Likewise for param "vr".
      	(value_range_constant_singleton): Likewise.
      	(vrp_set_zero_nonzero_bits): Likewise for param "ar".
      	(extract_range_into_wide_ints): Likewise for param "vr".
      	(extract_range_from_multiplicative_op): Likewise for params "vr0"
      	and "vr1".
      	(vrp_can_optimize_bit_op): Likewise.
      	(extract_range_from_binary_expr_1): Likewise for params "vr0_" and
      	"vr1_".
      	(extract_range_from_unary_expr): Likewise.
      	(debug_value_range): Likewise for param "vr".
      	(value_range::dump): Add "const" qualifier.
      	(vrp_prop::check_array_ref): Convert local "vr" from
      	"value_range *" to "const value_range *".
      	(vrp_prop::check_mem_ref): Likewise.
      	(vrp_prop::visit_stmt): Likewise for local "old_vr".
      	(vrp_intersect_ranges_1): Likewise for param "vr_1".
      	(vrp_intersect_ranges): Likewise.
      	(simplify_stmt_for_jump_threading): Likewise for local "vr".
      	(vrp_prop::vrp_finalize): Likewise.
      	* tree-vrp.h (value_range::dump): Add "const" qualifier.
      	(vrp_intersect_ranges): Add "const" qualifier to params as above.
      	(extract_range_from_unary_expr): Likewise.
      	(value_range_constant_singleton): Likewise.
      	(symbolic_range_p): Likewise.
      	(copy_value_range): Likewise.
      	(extract_range_from_binary_expr_1): Likewise.
      	(range_int_cst_p): Likewise.
      	(vrp_set_zero_nonzero_bits): Likewise.
      	(range_int_cst_singleton_p): Likewise.
      
      From-SVN: r264020
      David Malcolm committed
  30. 27 Aug, 2018 1 commit
    • Add new gswitch related functions into tree-cfg.c. · 61ff5d6f
      2018-08-27  Martin Liska  <mliska@suse.cz>
      
      	* cfgexpand.c (expand_asm_stmt): Use label_to_block and pass
              cfun argument explicitly.
      	* gimple-pretty-print.c (dump_gimple_switch): Likewise.
      	* hsa-gen.c (gen_hsa_insns_for_switch_stmt): Use new
              function gimple_switch_default_bb.
      	(convert_switch_statements):
      	(expand_builtins):
      	* ipa-fnsummary.c (set_switch_stmt_execution_predicate):
      	* stmt.c (label_to_block_fn): Use label_to_block and pass
              cfun argument explicitly and use gimple_switch_label_bb.
      	(expand_case): Likewise.
      	* tree-cfg.c (lower_phi_internal_fn): Use label_to_block and pass
              cfun argument explicitly. Likewise.
      	(make_edges_bb): Likewise.
      	(make_cond_expr_edges): Likewise.
      	(get_cases_for_edge): Likewise.
      	(make_gimple_switch_edges): Likewise.
      	(label_to_block_fn): Likewise.
      	(label_to_block): Likewise.
      	(make_goto_expr_edges): Likewise.
      	(make_gimple_asm_edges): Likewise.
      	(main_block_label): Likewise.
      	(group_case_labels_stmt): Likewise.
      	(find_taken_edge_computed_goto): Likewise.
      	(find_taken_edge_switch_expr): Likewise.
      	(gimple_verify_flow_info): Likewise.
      	(gimple_redirect_edge_and_branch): Likewise.
      	(gimple_switch_label_bb): New function.
      	(gimple_switch_default_bb): Likewise.
      	(gimple_switch_edge): Likewise.
      	(gimple_switch_default_edge): Likewise.
      	* tree-cfg.h (label_to_block_fn): Remove and replace ...
      	(label_to_block): ... with this.
      	(gimple_switch_label_bb): New.
      	(gimple_switch_default_bb): Likewise.
      	(gimple_switch_edge): Likewise.
      	(gimple_switch_default_edge): Likewise.
      	* tree-cfgcleanup.c (convert_single_case_switch): Use
              new gimple functions and pass new argument to label_to_block.
      	(cleanup_control_flow_bb):
      	* tree-eh.c (make_eh_dispatch_edges): Use label_to_block and pass
              cfun argument explicitly.
      	(make_eh_edges): Likewise.
      	(redirect_eh_dispatch_edge): Likewise.
      	(lower_resx): Likewise.
      	(lower_eh_dispatch): Likewise.
      	(maybe_remove_unreachable_handlers): Likewise.
      	(unsplit_eh): Likewise.
      	(cleanup_empty_eh): Likewise.
      	(verify_eh_edges): Likewise.
      	(verify_eh_dispatch_edge): Likewise.
      	* tree-ssa-dom.c (record_edge_info): Likewise.
      	* tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
      	* tree-ssa-threadedge.c (thread_around_empty_blocks): Likewise.
      	(thread_through_normal_block): Likewise.
      	* tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
      	* tree-ssa-uninit.c (convert_control_dep_chain_into_preds):
      	* tree-switch-conversion.c (switch_conversion::collect): Use new
              gimple functions.
      	(switch_conversion::check_final_bb): Likewise.
      	(switch_conversion::gather_default_values): Pass new argument
              to label_to_block.
      	(switch_conversion::build_constructors): Likewise.
      	(switch_decision_tree::compute_cases_per_edge): Use new
              gimple_switch_edge function.
      	(switch_decision_tree::analyze_switch_statement): Pass new argument
              to label_to_block.
      	(switch_decision_tree::try_switch_expansion): Use
              gimple_switch_default_edge.
      	* tree-vrp.c (find_switch_asserts): Pass new argument
              to label_to_block.
      	* vr-values.c (vr_values::vrp_visit_switch_stmt): Likewise.
      	(vr_values::simplify_switch_using_ranges): Likewise.
      
      From-SVN: r263876
      Martin Liska committed