Commit Graph

277 Commits

Author SHA1 Message Date
Martin Liska 40fbc3ff0c Backport r248489
2017-06-22  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-05-26  Martin Liska  <mliska@suse.cz>

	PR ipa/80663
	* params.def: Bound partial-inlining-entry-probability param.
2017-06-22  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-05-26  Martin Liska  <mliska@suse.cz>

	PR ipa/80663
	* g++.dg/ipa/pr80212.C: Remove the test as it does not longer
	split at the problematic spot.
	* gcc.dg/ipa/pr48195.c: Change 101 to 100 as 101 is no longer
	a valid value of the param.

From-SVN: r249548
2017-06-22 11:40:00 +00:00
Richard Biener 91cd87db7e re PR other/79991 (typo in params.def, PARAM_VECT_MAX_PEELING_FOR_ALIGNMENT)
2017-03-13  Richard Biener  <rguenther@suse.de>

	PR other/79991
	* params.def (vect-max-peeling-for-alignment): Fix typo.

From-SVN: r246083
2017-03-13 09:13:14 +00:00
Kyrylo Tkachov c242d6154c PR c/79855: add full stop to store merging param descriptions
PR c/79855
	* params.def (PARAM_STORE_MERGING_ALLOW_UNALIGNED): Add full stop
	to end of description.
	(PARAM_MAX_STORES_TO_MERGE): Likewise.

From-SVN: r245948
2017-03-07 09:36:44 +00:00
Martin Liska 91ebcfce9a Change default of param not being smaller that min.
2017-02-23  Martin Liska  <mliska@suse.cz>

	* params.def (PARAM_MIN_NONDEBUG_INSN_UID): Change default to 0.

From-SVN: r245677
2017-02-23 08:38:35 +00:00
Martin Liska 6c12bd5b31 Increase minimum for a param (PR rtl-optimization/79577).
2017-02-17  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/79577
	* params.def (selsched-max-sched-times): Increase minimum to 1.

From-SVN: r245532
2017-02-17 14:47:08 +00:00
Richard Biener 830afa4b0c re PR tree-optimization/79576 (ICE in gimple_stmt_nonnegative_warnv_p in gcc/gimple-fold.c:6979)
2017-02-17  Richard Biener  <rguenther@suse.de>

	PR middle-end/79576
	* params.def (max-ssa-name-query-depth): Limit to 10.

From-SVN: r245529
2017-02-17 13:36:39 +00:00
Jan Hubicka 540b7af068 re PR tree-optimization/79224 (Large C-Ray slowdown)
PR ipa/79224
	* params.def (inline-min-speedup) Change from 10 to 8.

From-SVN: r245366
2017-02-11 21:49:51 +00:00
Jeff Law d155c6fef0 re PR tree-optimization/33562 (aggregate DSE disabled)
PR tree-optimization/33562
        PR tree-optimization/61912
        PR tree-optimization/77485
	* doc/invoke.texi: Document new dse-max-object-size param.
	* params.def (PARM_DSE_MAX_OBJECT_SIZE): New PARAM.
	* tree-ssa-dse.c: Include params.h.
	(dse_store_status): New enum.
	(initialize_ao_ref_for_dse): New, partially extracted from
	dse_optimize_stmt.
	(valid_ao_ref_for_dse, normalize_ref): New.
	(setup_live_bytes_from_ref, compute_trims): Likewise.
	(clear_bytes_written_by, maybe_trim_complex_store): Likewise.
	(maybe_trim_partially_dead_store): Likewise.
	(maybe_trim_complex_store): Likewise.
	(dse_classify_store): Renamed from dse_possibly_dead_store_p.
	Track what bytes live from the original store.  Return tri-state
	for dead, partially dead or live.
	(dse_dom_walker): Add constructor, destructor and new private members.
	(delete_dead_call, delete_dead_assignment): New extracted from
	dse_optimize_stmt.
	(dse_optimize_stmt): Make a member of dse_dom_walker.
	Use initialize_ao_ref_for_dse.

        PR tree-optimization/33562
        PR tree-optimization/61912
        PR tree-optimization/77485
	* gcc.dg/tree-ssa/complex-4.c: Remove xfail.
	* gcc.dg/tree-ssa/complex-5.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-9.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-18.c: New test.
	* gcc.dg/tree-ssa/ssa-dse-19.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-20.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-21.c: Likewise.

From-SVN: r244442
2017-01-13 08:42:08 -07:00
Jakub Jelinek bd2c62704b re PR translation/79019 (translatable string typo in cif-code.def:141)
PR translation/79019
	PR translation/79020
	* params.def (PARAM_INLINE_MIN_SPEEDUP,
	PARAM_IPA_CP_SINGLE_CALL_PENALTY,
	PARAM_USE_AFTER_SCOPE_DIRECT_EMISSION_THRESHOLD): Fix typos
	in descriptions.
	* config/avr/avr.opt (maccumulate-args): Likewise.
	* config/msp430/msp430.opt (mwarn-mcu): Likewise.
	* common.opt (freport-bug): Likewise.
	* cif-code.def (CIF_FINAL_ERROR): Likewise.
	* doc/invoke.texi (ipa-cp-single-call-penalty): Likewise.
	* config/s390/s390.c (s390_invalid_binary_op): Fix spelling in
	translatable string.
	* config/i386/i386.c (function_value_32): Likewise.
	* config/nios2/nios2.c (nios2_valid_target_attribute_rec): Likewise.
	* config/msp430/msp430.c (msp430_option_override, msp430_attr):
	Likewise.
	* config/msp430/driver-msp430.c (msp430_select_hwmult_lib): Likewise.
	* common/config/msp430/msp430-common.c (msp430_handle_option):
	Likewise.
	* symtab.c (symtab_node::verify_base): Likewise.
	* opts.c (set_debug_level): Likewise.
	* tree.c (verify_type_variant): Likewise.  Fix typo in comment.
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Add
	missing whitespace to translatable strings.
	* config/avr/avr.md (bswapsi2): Fix typo in comment.
	* config/sh/superh.h: Likewise.
	* config/i386/xopintrin.h: Likewise.
	* config/i386/znver1.md: Likewise.
	* config/rs6000/rs6000.c (struct rs6000_opt_mask): Likewise.
	* ipa-inline-analysis.c (compute_inline_parameters): Likewise.
	* double-int.h (struct double_int): Likewise.
	* double-int.c (div_and_round_double): Likewise.
	* wide-int.cc: Likewise.
	* tree-ssa.c (non_rewritable_mem_ref_base): Likewise.
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Likewise.
	* cfgcleanup.c (crossjumps_occured): Renamed to ...
	(crossjumps_occurred): ... this.
	(try_crossjump_bb, try_head_merge_bb, try_optimize_cfg, cleanup_cfg):
	Adjust all uses.
cp/
	* semantics.c (finish_omp_clauses): Add missing whitespace to
	translatable strings.
	* cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
lto/
	* lto-symtab.c (lto_symtab_merge_symbols): Fix comment typo.
fortran/
	* decl.c (attr_decl1): Fix spelling in translatable string.
	* intrinsic.texi: Fix spelling - invokation -> invocation.
	* lang.opt (faggressive-function-elimination, gfc_convert): Fix
	typos in descriptions.
	* openmp.c (resolve_omp_clauses): Add missing whitespace to
	translatable strings.
c-family/
	* c.opt (Wnormalized=): Fix typo in description.
testsuite/
	* c-c++-common/goacc/host_data-2.c (f): Adjust expected spelling of
	diagnostics.
	* gfortran.dg/initialization_17.f90: Likewise.

From-SVN: r244245
2017-01-09 22:48:33 +01:00
Jakub Jelinek 0fc08a17f0 re PR translation/79018 (translatable string typo in params.def:1105)
PR translation/79018
	* params.def (PARAM_MAX_STORES_TO_MERGE): Add missing space between
	the and store.

From-SVN: r244195
2017-01-07 09:37:06 +01:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Yuri Rumyantsev 598eaaa2a2 Support non-masked epilogue vectoriziation
gcc/

2016-11-16  Yuri Rumyantsev  <ysrumyan@gmail.com>

	* params.def (PARAM_VECT_EPILOGUES_NOMASK): New.
	* tree-if-conv.c (tree_if_conversion): Make public.
	* * tree-if-conv.h: New file.
	* tree-vect-data-refs.c (vect_analyze_data_ref_dependences) Avoid
	dynamic alias checks for epilogues.
	* tree-vect-loop-manip.c (vect_do_peeling): Return created epilog.
	* tree-vect-loop.c: include tree-if-conv.h.
	(new_loop_vec_info): Add zeroing orig_loop_info field.
	(vect_analyze_loop_2): Don't try to enhance alignment for epilogues.
	(vect_analyze_loop): Add argument ORIG_LOOP_INFO which is not NULL
	if epilogue is vectorized, set up orig_loop_info field of loop_vinfo
	using passed argument.
	(vect_transform_loop): Check if created epilogue should be returned
	for further vectorization with less vf.  If-convert epilogue if
	required. Print vectorization success for epilogue.
	* tree-vectorizer.c (vectorize_loops): Add epilogue vectorization
	if it is required, pass loop_vinfo produced during vectorization of
	loop body to vect_analyze_loop.
	* tree-vectorizer.h (struct _loop_vec_info): Add new field
	orig_loop_info.
	(LOOP_VINFO_ORIG_LOOP_INFO): New.
	(LOOP_VINFO_EPILOGUE_P): New.
	(LOOP_VINFO_ORIG_VECT_FACTOR): New.
	(vect_do_peeling): Change prototype to return epilogue.
	(vect_analyze_loop): Add argument of loop_vec_info type.
	(vect_transform_loop): Return created loop.

gcc/testsuite/

2016-11-16  Yuri Rumyantsev  <ysrumyan@gmail.com>

	* lib/target-supports.exp (check_avx2_hw_available): New.
	(check_effective_target_avx2_runtime): New.
	* gcc.dg/vect/vect-tail-nomask-1.c: New test.

From-SVN: r242501
2016-11-16 08:22:39 -08:00
Martin Liska 6dc4a60450 Introduce -fsanitize-address-use-after-scope
* c-warn.c (warn_for_unused_label): Save all labels used
	in goto or in &label.
	* asan.c (enum asan_check_flags): Move the enum to header file.
	(asan_init_shadow_ptr_types): Make type creation more generic.
	(shadow_mem_size): New function.
	(asan_emit_stack_protection): Use newly added ASAN_SHADOW_GRANULARITY.
	Rewritten stack unpoisoning code.
	(build_shadow_mem_access): Add new argument return_address.
	(instrument_derefs): Instrument local variables if use after scope
	sanitization is enabled.
	(asan_store_shadow_bytes): New function.
	(asan_expand_mark_ifn): Likewise.
	(asan_sanitize_stack_p): Moved from asan_sanitize_stack_p.
	* asan.h (enum asan_mark_flags): Moved here from asan.c
	(asan_protect_stack_decl): Protect all declaration that need
	to live in memory.
	(asan_sanitize_use_after_scope): New function.
	(asan_no_sanitize_address_p): Likewise.
	* cfgexpand.c (partition_stack_vars): Consider
	asan_sanitize_use_after_scope in condition.
	(expand_stack_vars): Likewise.
	* common.opt (-fsanitize-address-use-after-scope): New option.
	* doc/invoke.texi (use-after-scope-direct-emission-threshold):
	Explain the parameter.
	* flag-types.h (enum sanitize_code): Define SANITIZE_USE_AFTER_SCOPE.
	* gimplify.c (build_asan_poison_call_expr): New function.
	(asan_poison_variable): Likewise.
	(gimplify_bind_expr): Generate poisoning/unpoisoning for local
	variables that have address taken.
	(gimplify_decl_expr): Likewise.
	(gimplify_target_expr): Likewise for C++ temporaries.
	(sort_by_decl_uid): New function.
	(gimplify_expr): Unpoison all variables for a label we can jump
	from outside of a scope.
	(gimplify_switch_expr): Unpoison variables defined in the switch
	context.
	(gimplify_function_tree): Clear asan_poisoned_variables.
	(asan_poison_variables): New function.
	(warn_switch_unreachable_r): Handle IFN_ASAN_MARK.
	* internal-fn.c (expand_ASAN_MARK): New function.
	* internal-fn.def (ASAN_MARK): Declare.
	* opts.c (finish_options): Handle -fstack-reuse if
	-fsanitize-address-use-after-scope is enabled.
	(common_handle_option): Enable address sanitization if
	-fsanitize-address-use-after-scope is enabled.
	* params.def (PARAM_USE_AFTER_SCOPE_DIRECT_EMISSION_THRESHOLD):
	New parameter.
	* params.h: Likewise.
	* sancov.c (pass_sanopt::execute): Handle IFN_ASAN_MARK.
	* sanitizer.def: Define __asan_poison_stack_memory and
	__asan_unpoison_stack_memory functions.
	* asan.c (asan_mark_poison_p): New function.
	(transform_statements): Handle asan_mark_poison_p calls.
	* gimple.c (nonfreeing_call_p): Handle IFN_ASAN_MARK.

From-SVN: r241896
2016-11-07 10:23:38 +00:00
Kyrylo Tkachov f663d9ad6e GIMPLE store merging pass
2016-10-28  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	PR middle-end/22141
	* Makefile.in (OBJS): Add gimple-ssa-store-merging.o.
	* common.opt (fstore-merging): New Optimization option.
	* opts.c (default_options_table): Add entry for
	OPT_ftree_store_merging.
	* fold-const.h (can_native_encode_type_p): Declare prototype.
	* fold-const.c (can_native_encode_type_p): Define.
	* params.def (PARAM_STORE_MERGING_ALLOW_UNALIGNED): Define.
	(PARAM_MAX_STORES_TO_MERGE): Likewise.
	* timevar.def (TV_GIMPLE_STORE_MERGING): New timevar.
	* passes.def: Insert pass_tree_store_merging.
	* tree-pass.h (make_pass_store_merging): Declare extern
	prototype.
	* gimple-ssa-store-merging.c: New file.
	* doc/invoke.texi (Optimization Options): Document
	-fstore-merging.
	(--param documentation): Document store-merging-allow-unaligned
	and max-stores-to-merge.

2016-10-28  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
            Jakub Jelinek  <jakub@redhat.com>
            Andrew Pinski  <pinskia@gmail.com>

	PR middle-end/22141
	PR rtl-optimization/23684
	* gcc.c-torture/execute/pr22141-1.c: New test.
	* gcc.c-torture/execute/pr22141-2.c: Likewise.
	* gcc.target/aarch64/ldp_stp_1.c: Adjust for -fstore-merging.
	* gcc.target/aarch64/ldp_stp_4.c: Likewise.
	* gcc.dg/store_merging_1.c: New test.
	* gcc.dg/store_merging_2.c: Likewise.
	* gcc.dg/store_merging_3.c: Likewise.
	* gcc.dg/store_merging_4.c: Likewise.
	* gcc.dg/store_merging_5.c: Likewise.
	* gcc.dg/store_merging_6.c: Likewise.
	* gcc.dg/store_merging_7.c: Likewise.
	* gcc.target/i386/pr22141.c: Likewise.
	* gcc.target/i386/pr34012.c: Add -fno-store-merging to dg-options.
	* g++.dg/init/new17.C: Likewise.



Co-Authored-By: Andrew Pinski <pinskia@gmail.com>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r241649
2016-10-28 14:18:50 +00:00
Patrick Palka 524cf1e47a Teach VRP to register assertions along default switch labels (PR18046)
gcc/ChangeLog:

	PR tree-optimization/18046
	* genmodes.c (emit_mode_size_inline): Emit an assert that
	verifies that mode is a valid array index.
	(emit_mode_nuinits_inline): Likewise.
	(emit_mode_inner_inline): Likewise.
	(emit_mode_unit_size_inline): Likewise.
	(emit_mode_unit_precision_inline): Likewise.
	* tree-vrp.c: Include params.h.
	(find_switch_asserts): Register edge assertions for the default
	label which correspond to the anti-ranges of each case label.
	* params.def (PARAM_MAX_VRP_SWITCH_ASSERTIONS): New.
	* doc/invoke.texi: Document it.

gcc/testsuite/ChangeLog:

	PR tree-optimization/18046
	* gcc.dg/tree-ssa/ssa-dom-thread-6.c: Bump FSM count to 5.
	* gcc.dg/tree-ssa/vrp103.c: New test.
	* gcc.dg/tree-ssa/vrp104.c: New test.

From-SVN: r238761
2016-07-26 15:19:58 +00:00
James Greenhalgh e914c11a99 [Patch 1/2 ifcvt costs] New target hook: max_noce_ifcvt_seq_cost
gcc/

	* target.def (max_noce_ifcvt_seq_cost): New.
	* doc/tm.texi.in (TARGET_MAX_NOCE_IFCVT_SEQ_COST): Document it.
	* doc/tm.texi: Regenerate.
	* targhooks.h (default_max_noce_ifcvt_seq_cost): New.
	* targhooks.c (default_max_noce_ifcvt_seq_cost): New.
	* params.def (PARAM_MAX_RTL_IF_CONVERSION_PREDICTABLE_COST): New.
	(PARAM_MAX_RTL_IF_CONVERSION_UNPREDICTABLE_COST): Likewise.
	* doc/invoke.texi: Document new params.

From-SVN: r238593
2016-07-21 15:37:50 +00:00
Martin Liska 4661839ee3 Introduce new param: AVG_LOOP_NITER
* params.def: Add avg-loop niter.
	* tree-ssa-loop-ivopts.c (avg_loop_niter): Use the param.
	* cfgloopanal.c (expected_loop_iterations_unbounded): Likewise.
	* doc/invoke.texi: Document the new parameter.

From-SVN: r238252
2016-07-12 15:27:36 +00:00
Kyrylo Tkachov ff7b374b78 [typo] alignement -> alignment
2016-06-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * params.def (PARAM_ALIGN_LOOP_ITERATIONS): Use "alignment" instead of
    "alignement".
    * tree.h (TYPE_ALIGN): Likewise.

2016-06-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * exp_util.adb (Safe_Unchecked_Type_Conversion): Use "alignment"
    instead of "alignement".

2016-06-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * gfortran.dg/common_align_2.f90: Use "alignment" instead of
    "alignement".

From-SVN: r237590
2016-06-20 11:12:07 +00:00
Jan Hubicka 568876dc70 invoke.texi (max-loop-headers-insns): Document.
* invoke.texi (max-loop-headers-insns): Document.
	* params.def (PARAM_MAX_LOOP_HEADER_INSNS): New.
	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Update comment.
	(ch_base::copy_headers): Use PARAM_MAX_LOOP_HEADER_INSNS.

From-SVN: r237219
2016-06-08 14:11:51 +00:00
Bin Cheng 1cfcd39eee re PR tree-optimization/56541 (vectorizaton fails in conditional assignment of a constant)
PR tree-optimization/56541
	* doc/invoke.texi (@item max-tree-if-conversion-phi-args): New item.
	* params.def (PARAM_MAX_TREE_IF_CONVERSION_PHI_ARGS): new param.
	* tree-if-conv.c (MAX_PHI_ARG_NUM): new macro.
	(any_complicated_phi): new static variable.
	(aggressive_if_conv): delete.
	(if_convertible_phi_p): support phis with more than two arguments.
	(if_convertible_bb_p): remvoe check on aggressive_if_conv and
	critical pred edges.
	(ifcvt_split_critical_edges): support phis with more than two
	arguments by checking new parameter.  only split critical edges
	if needed.
	(tree_if_conversion): handle simd pragma marked loop using new
	local variable aggressive_if_conv.  check any_complicated_phi.

	gcc/testsuite
	PR tree-optimization/56541
	* gcc.dg/tree-ssa/ifc-pr56541.c: new test.
	* gcc.dg/vect/pr56541.c: new test.

From-SVN: r235808
2016-05-03 09:04:46 +00:00
Prathamesh Kulkarni 4245b0871c params.def (MIN_PARTITION_SIZE): Set default value to 10000.
2016-04-27  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	* params.def (MIN_PARTITION_SIZE): Set default value to 10000.

From-SVN: r235538
2016-04-27 22:39:43 +00:00
Prathamesh Kulkarni a2e76867ad params.def (MAX_PARTITION_SIZE): New param.
2016-04-27  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	* params.def (MAX_PARTITION_SIZE): New param.
	* invoke.texi: Document lto-max-partition.
lto/
	* lto-partition.h (lto_balanced_map): New parameter.
	* lto-partition.c (lto_balanced_map): New parameter
	max_partition_size.
	Check if partition size is greater than max_partition_size.
	* lto.c (do_whole_program_analysis): Adjust calls to
	lto_balanced_map() to pass 2nd argument.

From-SVN: r235478
2016-04-27 10:46:16 +00:00
Michael Matz 9c49362f03 re PR middle-end/12392 (very long optimized compile)
2016-03-30  Michael Matz  <matz@suse.de>
	Richard Biener  <rguenther@suse.de>

	PR ipa/12392
	* ipa-polymorphic-call.c (struct type_change_info): Change
	speculative to an unsigned allowing to limit the work we do.
	(csftc_abort_walking_p): New inline function..
	(check_stmt_for_type_change): Limit the number of may-defs
	skipped for speculative devirtualization to
	max-speculative-devirt-maydefs.
	* params.def (max-speculative-devirt-maydefs): New param.
	* doc/invoke.texi (--param max-speculative-devirt-maydefs): Document.

Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r234546
2016-03-30 07:47:40 +00:00
Bin Cheng 9bf63f8cb2 re PR tree-optimization/69042 (Missed optimization in ivopts)
PR tree-optimization/69042
	* params.def (PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND): Increase the
	parameter from 30 to 40.

From-SVN: r234430
2016-03-23 15:26:43 +00:00
Jakub Jelinek d46cfcc0b9 re PR c/69918 (gcc.dg/torture/builtin-integral-1.c FAILs)
PR c/69918
	* params.def (PARAM_MAX_SSA_NAME_QUERY_DEPTH): Bump default from
	2 to 3.

From-SVN: r233657
2016-02-24 09:37:41 +01:00
Jeff Law da9a8da809 re PR testsuite/68580 (FAIL: c-c++-common/tsan/pr65400-1.c -O0 execution test)
PR tree-optimization/68580
	* params.def (FSM_MAXIMUM_PHI_ARGUMENTS): New param.
	* tree-ssa-threadbackward.c
	(fsm_find_control_statement_thread_paths): Do not try to walk
	through large PHI nodes.

From-SVN: r233053
2016-02-01 15:03:57 -07:00
Jeff Law 2b572b3c21 re PR tree-optimization/68398 (coremark regression due to r229685)
PR tree-optimization/68398
	* params.def (PARAM_FSM_SCALE_PATH_STMTS): New parameter.
	(PARAM_FSM_SCALE_PATH_BLOCKS): Likewise.
	* tree-ssa-threadbackward.c (fsm_find_control_statement_thread_paths):
	Only count PHIs in the last block in the path.  The others will
	const/copy propagate away.  Add heuristic to allow more irreducible
	subloops to be created when it is likely profitable to do so.

	* tree-ssa-threadbackward.c (fsm_find_control_statement_thread_paths):
	Fix typo in comment.  Use gsi_after_labels and remove the GIMPLE_LABEL
	check from within the loop.  Use gsi_next_nondebug rather than gsi_next.

	PR tree-optimization/68398
	* gcc.dg/tree-ssa/pr66752-3.c: Update expected output.
	* gcc.dg/tree-ssa/ssa-dom-thread-2c.c: Add extra statements on thread
	path to avoid new heuristic allowing more irreducible regions
	* gcc.dg/tree-ssa/ssa-dom-thread-2d.c: Likewise.
	* gcc.dg/tree-ssa/vrp46.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dom-thread-7.c: Update expected output.
	* gcc.dg/tree-ssa/ssa-dom-thread-2g.c: New test.
	* gcc.dg/tree-ssa/ssa-dom-thread-2h.c: Likewise.

From-SVN: r232897
2016-01-27 12:19:47 -07:00
Martin Jambor b2b4005150 Merge of HSA
2016-01-19  Martin Jambor  <mjambor@suse.cz>
	    Martin Liska  <mliska@suse.cz>
	    Michael Matz <matz@suse.de>

libgomp/
	* plugin/Makefrag.am: Add HSA plugin requirements.
	* plugin/configfrag.ac (HSA_RUNTIME_INCLUDE): New variable.
	(HSA_RUNTIME_LIB): Likewise.
	(HSA_RUNTIME_CPPFLAGS): Likewise.
	(HSA_RUNTIME_INCLUDE): New substitution.
	(HSA_RUNTIME_LIB): Likewise.
	(HSA_RUNTIME_LDFLAGS): Likewise.
	(hsa-runtime): New configure option.
	(hsa-runtime-include): Likewise.
	(hsa-runtime-lib): Likewise.
	(PLUGIN_HSA): New substitution variable.
	Fill HSA_RUNTIME_INCLUDE and HSA_RUNTIME_LIB according to the new
	configure options.
	(PLUGIN_HSA_CPPFLAGS): Likewise.
	(PLUGIN_HSA_LDFLAGS): Likewise.
	(PLUGIN_HSA_LIBS): Likewise.
	Check that we have access to HSA run-time.
	* libgomp-plugin.h (offload_target_type): New element
	OFFLOAD_TARGET_TYPE_HSA.
	* libgomp.h (gomp_target_task): New fields firstprivate_copies and
	args.
	(bool gomp_create_target_task): Updated.
	(gomp_device_descr): Extra parameter of run_func and async_run_func,
	new field can_run_func.
	* libgomp_g.h (GOMP_target_ext): Update prototype.
	* oacc-host.c (host_run): Added a new parameter args.
	* target.c (calculate_firstprivate_requirements): New function.
	(copy_firstprivate_data): Likewise.
	(gomp_target_fallback_firstprivate): Use them.
	(gomp_target_unshare_firstprivate): New function.
	(gomp_get_target_fn_addr): Allow returning NULL for shared memory
	devices.
	(GOMP_target): Do host fallback for all shared memory devices.  Do not
	pass any args to plugins.
	(GOMP_target_ext): Introduce device-specific argument parameter args.
	Allow host fallback if device shares memory.  Do not remap data if
	device has shared memory.
	(gomp_target_task_fn): Likewise.  Also treat shared memory devices
	like host fallback for mappings.
	(GOMP_target_data): Treat shared memory devices like host fallback.
	(GOMP_target_data_ext): Likewise.
	(GOMP_target_update): Likewise.
	(GOMP_target_update_ext): Likewise.  Also pass NULL as args to
	gomp_create_target_task.
	(GOMP_target_enter_exit_data): Likewise.
	(omp_target_alloc): Treat shared memory devices like host fallback.
	(omp_target_free): Likewise.
	(omp_target_is_present): Likewise.
	(omp_target_memcpy): Likewise.
	(omp_target_memcpy_rect): Likewise.
	(omp_target_associate_ptr): Likewise.
	(gomp_load_plugin_for_device): Also load can_run.
	* task.c (GOMP_PLUGIN_target_task_completion): Free
	firstprivate_copies.
	(gomp_create_target_task): Accept new argument args and store it to
	ttask.
	* plugin/plugin-hsa.c: New file.

gcc/
	* Makefile.in (OBJS): Add new source files.
	(GTFILES): Add hsa.c.
	* common.opt (disable_hsa): New variable.
	(-Whsa): New warning.
	* config.in (ENABLE_HSA): New.
	* configure.ac: Treat hsa differently from other accelerators.
	(OFFLOAD_TARGETS): Define ENABLE_OFFLOADING according to
	$enable_offloading.
	(ENABLE_HSA): Define ENABLE_HSA according to $enable_hsa.
	* doc/install.texi (Configuration): Document --with-hsa-runtime,
	--with-hsa-runtime-include, --with-hsa-runtime-lib and
	--with-hsa-kmt-lib.
	* doc/invoke.texi (-Whsa): Document.
	(hsa-gen-debug-stores): Likewise.
	* lto-wrapper.c (compile_images_for_offload_targets): Do not attempt
	to invoke offload compiler for hsa acclerator.
	* opts.c (common_handle_option): Determine whether HSA offloading
	should be performed.
	* params.def (PARAM_HSA_GEN_DEBUG_STORES): New parameter.
	* builtin-types.def (BT_FN_VOID_UINT_PTR_INT_PTR): New.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): Removed.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): New.
	* gimple-low.c (lower_stmt): Also handle GIMPLE_OMP_GRID_BODY.
	* gimple-pretty-print.c (dump_gimple_omp_for): Also handle
	GF_OMP_FOR_KIND_GRID_LOOP.
	(dump_gimple_omp_block): Also handle GIMPLE_OMP_GRID_BODY.
	(pp_gimple_stmt_1): Likewise.
	* gimple-walk.c (walk_gimple_stmt): Likewise.
	* gimple.c (gimple_build_omp_grid_body): New function.
	(gimple_copy): Also handle GIMPLE_OMP_GRID_BODY.
	* gimple.def (GIMPLE_OMP_GRID_BODY): New.
	* gimple.h (enum gf_mask): Added GF_OMP_PARALLEL_GRID_PHONY,
	GF_OMP_FOR_KIND_GRID_LOOP, GF_OMP_FOR_GRID_PHONY and
	GF_OMP_TEAMS_GRID_PHONY.
	(gimple_statement_omp_single_layout): Updated comments.
	(gimple_build_omp_grid_body): New function.
	(gimple_has_substatements): Also handle GIMPLE_OMP_GRID_BODY.
	(gimple_omp_for_grid_phony): New function.
	(gimple_omp_for_set_grid_phony): Likewise.
	(gimple_omp_parallel_grid_phony): Likewise.
	(gimple_omp_parallel_set_grid_phony): Likewise.
	(gimple_omp_teams_grid_phony): Likewise.
	(gimple_omp_teams_set_grid_phony): Likewise.
	(gimple_return_set_retbnd): Also handle GIMPLE_OMP_GRID_BODY.
	* omp-builtins.def (BUILT_IN_GOMP_OFFLOAD_REGISTER): New.
	(BUILT_IN_GOMP_OFFLOAD_UNREGISTER): Likewise.
	(BUILT_IN_GOMP_TARGET): Updated type.
	* omp-low.c: Include symbol-summary.h, hsa.h and params.h.
	(adjust_for_condition): New function.
	(get_omp_for_step_from_incr): Likewise.
	(extract_omp_for_data): Moved parts to adjust_for_condition and
	get_omp_for_step_from_incr.
	(build_outer_var_ref): Handle GIMPLE_OMP_GRID_BODY.
	(fixup_child_record_type): Bail out if receiver_decl is NULL.
	(scan_sharing_clauses): Handle OMP_CLAUSE__GRIDDIM_.
	(scan_omp_parallel): Do not create child functions for phony
	constructs.
	(check_omp_nesting_restrictions): Handle GIMPLE_OMP_GRID_BODY.
	(scan_omp_1_op): Checking assert we are not remapping to
	ERROR_MARK.  Also also handle GIMPLE_OMP_GRID_BODY.
	(parallel_needs_hsa_kernel_p): New function.
	(expand_parallel_call): Register apprpriate parallel child
	functions as HSA kernels.
	(grid_launch_attributes_trees): New type.
	(grid_attr_trees): New variable.
	(grid_create_kernel_launch_attr_types): New function.
	(grid_insert_store_range_dim): Likewise.
	(grid_get_kernel_launch_attributes): Likewise.
	(get_target_argument_identifier_1): Likewise.
	(get_target_argument_identifier): Likewise.
	(get_target_argument_value): Likewise.
	(push_target_argument_according_to_value): Likewise.
	(get_target_arguments): Likewise.
	(expand_omp_target): Call get_target_arguments instead of looking
	up for teams and thread limit.
	(grid_expand_omp_for_loop): New function.
	(grid_arg_decl_map): New type.
	(grid_remap_kernel_arg_accesses): New function.
	(grid_expand_target_kernel_body): New function.
	(expand_omp): Call it.
	(lower_omp_for): Do not emit phony constructs.
	(lower_omp_taskreg): Do not emit phony constructs but create for them
	a temporary variable receiver_decl.
	(lower_omp_taskreg): Do not emit phony constructs.
	(lower_omp_teams): Likewise.
	(lower_omp_grid_body): New function.
	(lower_omp_1): Call it.
	(grid_reg_assignment_to_local_var_p): New function.
	(grid_seq_only_contains_local_assignments): Likewise.
	(grid_find_single_omp_among_assignments_1): Likewise.
	(grid_find_single_omp_among_assignments): Likewise.
	(grid_find_ungridifiable_statement): Likewise.
	(grid_target_follows_gridifiable_pattern): Likewise.
	(grid_remap_prebody_decls): Likewise.
	(grid_copy_leading_local_assignments): Likewise.
	(grid_process_kernel_body_copy): Likewise.
	(grid_attempt_target_gridification): Likewise.
	(grid_gridify_all_targets_stmt): Likewise.
	(grid_gridify_all_targets): Likewise.
	(execute_lower_omp): Call grid_gridify_all_targets.
	(make_gimple_omp_edges): Handle GIMPLE_OMP_GRID_BODY.
	* tree-core.h (omp_clause_code): Added OMP_CLAUSE__GRIDDIM_.
	(tree_omp_clause): Added union field dimension.
	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__GRIDDIM_.
	* tree.c (omp_clause_num_ops): Added number of arguments of
	OMP_CLAUSE__GRIDDIM_.
	(omp_clause_code_name): Added name of OMP_CLAUSE__GRIDDIM_.
	(walk_tree_1): Handle OMP_CLAUSE__GRIDDIM_.
	* tree.h (OMP_CLAUSE_GRIDDIM_DIMENSION): New.
	(OMP_CLAUSE_SET_GRIDDIM_DIMENSION): Likewise.
	(OMP_CLAUSE_GRIDDIM_SIZE): Likewise.
	(OMP_CLAUSE_GRIDDIM_GROUP): Likewise.
	* passes.def: Schedule pass_ipa_hsa and pass_gen_hsail.
	* tree-pass.h (make_pass_gen_hsail): Declare.
	(make_pass_ipa_hsa): Likewise.
	* ipa-hsa.c: New file.
	* lto-section-in.c (lto_section_name): Add hsa section name.
	* lto-streamer.h (lto_section_type): Add hsa section.
	* timevar.def (TV_IPA_HSA): New.
        * hsa-brig-format.h: New file.
	* hsa-brig.c: New file.
	* hsa-dump.c: Likewise.
	* hsa-gen.c: Likewise.
	* hsa.c: Likewise.
	* hsa.h: Likewise.
	* toplev.c (compile_file): Call hsa_output_brig.
	* hsa-regalloc.c: New file.

gcc/fortran/
	* types.def (BT_FN_VOID_UINT_PTR_INT_PTR): New.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): Removed.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): New.

gcc/lto/
	* lto-partition.c: Include "hsa.h"
	(add_symbol_to_partition_1): Put hsa implementations into the
	same partition as host implementations.

liboffloadmic/
	* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_async_run): New
	unused parameter.
	(GOMP_OFFLOAD_run): Likewise.

include/
	* gomp-constants.h (GOMP_DEVICE_HSA): New macro.
	(GOMP_VERSION_HSA): Likewise.
	(GOMP_TARGET_ARG_DEVICE_MASK): Likewise.
	(GOMP_TARGET_ARG_DEVICE_ALL): Likewise.
	(GOMP_TARGET_ARG_SUBSEQUENT_PARAM): Likewise.
	(GOMP_TARGET_ARG_ID_MASK): Likewise.
	(GOMP_TARGET_ARG_NUM_TEAMS): Likewise.
	(GOMP_TARGET_ARG_THREAD_LIMIT): Likewise.
	(GOMP_TARGET_ARG_VALUE_SHIFT): Likewise.
	(GOMP_TARGET_ARG_HSA_KERNEL_ATTRIBUTES): Likewise.

From-SVN: r232549
2016-01-19 11:35:10 +01:00
Yuri Rumyantsev ca90b1ed9a re PR rtl-optimization/68920 (Undesirable if-conversion for a rarely taken branch)
gcc/

2016-01-11  Yuri Rumyantsev  <ysrumyan@gmail.com>

	PR rtl-optimization/68920
	* config/i386/i386.c (ix86_option_override_internal): Restrict number
	of conditional moves for  RTL if-conversion to 1 for
	TARGET_ONE_IF_CONV_INSN.
	* config/i386/i386.h (TARGET_ONE_IF_CONV_INSN): New macros.
	* config/i386/x86-tune.def (X86_TUNE_ONE_IF_CONV_INSN): New macros.
	* params.def (PARAM_MAX_RTL_IF_CONVERSION_INSNS) : Introduce new
	parameter to restirct number of conditional moves for
	RTL if-conversion.
	* doc/invoke.texi (max-rtl-if-conversion-insns): Document it.
	* ifcvt.c (bb_ok_for_noce_convert_multiple_sets): Limit number of
	conditionl moves.

gcc/testsuite/

2016-01-11  Yuri Rumyantsev  <ysrumyan@gmail.com>

	PR rtl-optimization/68920
	* gcc.dg/ifcvt-4.c: Add "--param max-rtl-if-conversion-insns=3" option
	for ix86 targets.
	* gcc.dg/ifcvt-5.c: New test.

From-SVN: r232220
2016-01-11 12:07:31 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Sebastian Pop e357a5e03c replace ISL with isl
From-SVN: r231784
2015-12-17 18:50:05 +00:00
Brad Lucier 87d8dd6c45 [PATCH] Make disabled-optimization warning more informative; increase default max-gcse-memory
* gcc/cprop.c (is_too_expensive): Remove.
	(gcse.h): Include.
	(one_cprop_pass): Call gcse_or_cprop_is_too_expensive, not
	is_too_expensive.
	* gcc/gcse.h (gcse_or_cprop_is_too_expensive): Declare.
	* gcc/gcse.c (is_too_expensive): Rename to ...
	(gcse_or_cprop_is_too_expensive): ... this.
	Expand warning to add required size of max-gcse-memory.
	(one_pre_gcse_pass): Use it.
	(one_code_hoisting_pass): Use it.
 	* gcc/params.def (max-gcse-memory): Increase from 50MB to 128MB.

From-SVN: r230276
2015-11-12 15:27:47 -07:00
Martin Sebor a7b2e1845f Improve --help output to generate references to option aliases.
gcc/
	PR driver/68043
	* opts.c (undocumented_msg, use_diagnosed_msg): New globals.
	(print_filtered_help): Reference aliased option's name and encourage
	readers to use it in preference to the alias if the former is not
	documented.  Mention when using an option is diagnosed.
	* gcc.c (display_help): End each sentence with a period.

	* ada/gcc-interface/lang.opt: End each sentence that describes
	an option with a period.
	* c-family/c.opt: Same.
	* common.opt: Same.
	* config/aarch64/aarch64.opt: Same.
	* config/alpha/alpha.opt: Same.
	* config/arc/arc.opt: Same.
	* config/arm/arm.opt: Same.
	* config/avr/avr.opt: Same.
	* config/bfin/bfin.opt: Same.
	* config/c6x/c6x.opt: Same.
	* config/cr16/cr16.opt: Same.
	* config/cris/cris.opt: Same.
	* config/cris/linux.opt: Same.
	* config/darwin.opt: Same.
	* config/epiphany/epiphany.opt: Same.
	* config/fr30/fr30.opt: Same.
	* config/frv/frv.opt: Same.
	* config/ft32/ft32.opt: Same.
	* config/g.opt: Same.
	* config/h8300/h8300.opt: Same.
	* config/i386/cygming.opt: Same.
	* config/i386/djgpp.opt: Same.
	* config/i386/i386.opt: Same.
	* config/i386/interix.opt: Same.
	* config/i386/mingw-w64.opt: Same.
	* config/i386/mingw.opt: Same.
	* config/ia64/ia64.opt: Same.
	* config/ia64/ilp32.opt: Same.
	* config/iq2000/iq2000.opt: Same.
	* config/linux.opt: Same.
	* config/lm32/lm32.opt: Same.
	* config/lynx.opt: Same.
	* config/m32c/m32c.opt: Same.
	* config/m32r/m32r.opt: Same.
	* config/m68k/ieee.opt: Same.
	* config/m68k/m68k.opt: Same.
	* config/mcore/mcore.opt: Same.
	* config/mep/mep.opt: Same.
	* config/microblaze/microblaze.opt: Same.
	* config/mips/mips.opt: Same.
	* config/mmix/mmix.opt: Same.
	* config/mn10300/mn10300.opt: Same.
	* config/moxie/moxie.opt: Same.
	* config/msp430/msp430.opt: Same.
	* config/nios2/elf.opt: Same.
	* config/nios2/nios2.opt: Same.
	* config/nvptx/nvptx.opt: Same.
	* config/pa/pa-hpux.opt: Same.
	* config/pa/pa-hpux1010.opt: Same.
	* config/pa/pa-hpux1111.opt: Same.
	* config/pa/pa-hpux1131.opt: Same.
	* config/pa/pa.opt: Same.
	* config/pa/pa64-hpux.opt: Same.
	* config/pdp11/pdp11.opt: Same.
	* config/rl78/rl78.opt: Same.
	* config/rs6000/476.opt: Same.
	* config/rs6000/aix64.opt: Same.
	* config/rs6000/darwin.opt: Same.
	* config/rs6000/linux64.opt: Same.
	* config/rs6000/rs6000.opt: Same.
	* config/rs6000/sysv4.opt: Same.
	* config/s390/s390.opt: Same.
	* config/s390/tpf.opt: Same.
	* config/sh/sh.opt: Same.
	* config/sol2.opt: Same.
	* config/sparc/long-double-switch.opt: Same.
	* config/sparc/sparc.opt: Same.
	* config/spu/spu.opt: Same.
	* config/stormy16/stormy16.opt: Same.
	* config/tilegx/tilegx.opt: Same.
	* config/tilepro/tilepro.opt: Same.
	* config/v850/v850.opt: Same.
	* config/vax/vax.opt: Same.
	* config/visium/visium.opt: Same.
	* config/vms/vms.opt: Same.
	* config/vxworks.opt: Same.
	* config/xtensa/xtensa.opt: Same.
	* fortran/lang.opt: Same.

testsuite/
	PR driver/68043
	* gcc.misc-tests/help.exp: Adjust.
	* lib/options.exp (check_for_options): Add detail to output.

From-SVN: r229155
2015-10-21 16:24:41 -06:00
Aditya Kumar 8b76e7fef8 add an upper limit on the number of array references
* graphite-scop-detection.c (build_scops): Do not handle scops with more
	than PARAM_GRAPHITE_MAX_ARRAYS_PER_SCOP arrays.
	* params.def (PARAM_GRAPHITE_MAX_ARRAYS_PER_SCOP): New.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r229150
2015-10-21 21:18:17 +00:00
Tom de Vries 1f600feab0 Add param parloops-schedule
2015-10-13  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/67476
	* doc/invoke.texi (@item parloops-schedule): New item.
	* params.def (PARAM_PARLOOPS_SCHEDULE): New DEFPARAMENUM5.
	* tree-parloops.c: Include params-enum.h.
	(create_parallel_loop): Handle PARAM_PARLOOPS_SCHEDULE.

	* testsuite/libgomp.c/autopar-3.c: New test.
	* testsuite/libgomp.c/autopar-4.c: New test.
	* testsuite/libgomp.c/autopar-5.c: New test.
	* testsuite/libgomp.c/autopar-6.c: New test.
	* testsuite/libgomp.c/autopar-7.c: New test.
	* testsuite/libgomp.c/autopar-8.c: New test.

From-SVN: r228756
2015-10-13 10:08:59 +00:00
Richard Sandiford 68e57f040c Make tree_expr_nonnegative_warnv_p recurse into SSA names
The upcoming patch to move sqrt and cbrt simplifications to match.pd
caused a regression because the (abs @0)->@0 simplification didn't
trigger for:

        (abs (convert (abs X)))

The simplification is based on tree_expr_nonnegative_p, which at
the moment just gives up if it sees an SSA_NAME.

This patch makes tree_expr_nonnegative_p recurse into SSA name
definitions, but limits the depth of recursion to a small number
for the reason mentioned in the comment (adapted from an existing
comment in gimple_val_nonnegative_real_p).  The patch reuses code
in tree-vrp.c, moving it to gimple-fold.c.  It also replaces calls
to gimple_val_nonnegative_real_p with calls to tree_expr_nonnegative_p.

A knock-on effect is that we can now prove _i_589 < 0 is false in
sequences like:

      i_1917 = ASSERT_EXPR <i_1075, i_1075 == 0>;
      _i_589 = (const int) i_1917;
      _i_1507 = ASSERT_EXPR <_i_589, _i_589 < 0>;

This defeats an assert in tree-vrp.c that ASSERT_EXPR conditions
are never known to be false.  Previously the assert only ever used
local knowledge and so would be limited to cases like x != x for
integer x.  Now that we use global knowledge it's possible to prove
the assertion condition is false in blocks that are in practice
unreachable.  The patch therefore removes the assert.

Bootstrapped & regression-tested on x86_64-linux-gnu.  I didn't write
a specific test because this is already covered by the testsuite if
the follow-on patch is also applied.

gcc/
	* params.def (PARAM_MAX_SSA_NAME_QUERY_DEPTH): New param.
	* doc/invoke.texi (--param max-ssa-name-query-depth): Document.
	* fold-const.h (tree_unary_nonnegative_warnv_p)
	(tree_single_nonnegative_warnv_p, tree_call_nonnegative_warnv_p)
	(tree_expr_nonnegative_warnv_p): Add depth parameters.
	* fold-const.c: Include gimple-fold.h and params.h.
	(tree_ssa_name_nonnegative_warnv_p): New function.
	(tree_unary_nonnegative_warnv_p, tree_binary_nonnegative_warnv_p)
	(tree_single_nonnegative_warnv_p, tree_call_nonnegative_warnv_p)
	(tree_invalid_nonnegative_warnv_p, tree_expr_nonnegative_warnv_p):
	Add a depth parameter and increment it for recursive calls to
	tree_expr_nonnegative_warnv_p.  Use tree_ssa_name_nonnegative_warnv_p
	to handle SSA names.
	* gimple-fold.h (gimple_val_nonnegative_real_p): Delete.
	(gimple_stmt_nonnegative_warnv_p): Declare.
	* tree-vrp.c (remove_range_assertions): Remove assert that condition
	cannot be proven false.
	(gimple_assign_nonnegative_warnv_p, gimple_call_nonnegative_warnv_p)
	(gimple_stmt_nonnegative_warnv_p): Move to...
	* gimple-fold.c: ...here.  Add depth parameters and pass them
	down to the tree routines.  Accept statements that aren't
	assignments or calls but just return false for them.
	(gimple_val_nonnegative_real_p): Delete.
	* tree-ssa-math-opts.c (gimple_expand_builtin_pow): Use
	tree_expr_nonnegative_p instead of gimple_val_nonnegative_real_p.
	Check HONOR_NANs first.

From-SVN: r228614
2015-10-08 16:49:24 +00:00
Aditya Kumar 8bc2421c9b increase the number of parameters
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r228494
2015-10-05 16:03:21 +00:00
Sebastian Pop 7009b073c5 Redesign Graphite scop detection
Redesign Graphite scop detection for faster compiler time and detecting more SCoPs.

Existing algorithm for SCoP detection in graphite was based on dominator tree
where a tree (CFG) traversal was required for analyzing an SESE. The tree
traversal is linear in the number of basic blocks and SCoP detection is
(probably) linear in number of instructions. That algorithm utilized a generic
infrastructure of SESE which does not directly represent loops.  With regards to
graphite framework, we are only interested in subtrees with loops. The new
algorithm is geared towards tree traversal on loop structure. The algorithm is
linear in number of loops which is faster than the previous algorithm.

Briefly, we start the traversal at a loop-nest and analyze it recursively for
validity. Once a valid loop is found we find a valid adjacent loop. If an
adjacent loop is found and is valid, we merge both loop nests otherwise we form
a SCoP from the previous loop nest, and resume the algorithm from the adjacent
loop nest. The data structure to represent an SESE is an ordered pair of edges
(entry, exit). The new algoritm can extend a SCoP in both the directions. With
this approach, the number of instructions to be analyzed for validity reduces to
a minimal set.  We start by analyzing those statements which are inside a loop,
because validity of those statements is necessary for the validity of loop. The
statements outside the loop nest can be just excluded from the SESE if they are
not valid.

This patch depends on: https://gcc.gnu.org/ml/gcc-patches/2015-09/msg02024.html

Passes (c,c++,fortran) regtest and bootstrap.

gcc/ChangeLog:

2015-09-27  Aditya Kumar  <hiraditya@msn.com>
            Sebastian Pop  <s.pop@samsung.com>
        * graphite-optimize-isl.c (optimize_isl):
        * graphite-scop-detection.c (struct sese_l): New type.
        (get_entry_bb): API for getting entry bb of SESE.
        (get_exit_bb): API for getting exit bb of SESE.
        (class debug_printer): New type. Simple printer in debug mode.
        (trivially_empty_bb_p): New. Return true when BB is empty or
	contains only debug instructions.
        (graphite_can_represent_expr): Call scalar_evoution_in_region
	instead of analyze_scalar_evolution. Pass in scop instead of only
	the scop entry.
        (stmt_has_simple_data_refs_p): Pass in scop instead of only the
	scop entry.
        (stmt_simple_for_scop_p): Same.
        (harmful_stmt_in_bb): Same.
        (graphite_can_represent_loop): Deleted.
        (struct scopdet_info): Deleted.
        (scopdet_basic_block_info): Deleted.
        (build_scops_1): Deleted.
        (bb_in_sd_region): Deleted.
        (find_single_entry_edge): Deleted.
        (find_single_exit_edge): Deleted.
        (create_single_entry_edge): Deleted.
        (sd_region_without_exit): Deleted.
        (create_single_exit_edge): Deleted.
        (unmark_exit_edges): Deleted.
        (mark_exit_edges): Deleted.
        (create_sese_edges): Deleted.
        (build_graphite_scops): Deleted.
        (canonicalize_loop_closed_ssa): Recompute all dominators at the
	end.
        (build_scops): Use the new scop_builder to build scops.
        (dot_all_scops_1): Use the new pretty printer. Print loop father
	as well.
        (loop_body_is_valid_scop): New. Return true if loop body is a
	valid scop.
        (class scop_builder): New. Builds SCoPs for polyhedral
	optimizatios.
        (scop_builder): New. Constructor.
        (static sese_l invalid_sese): sese_l with invalid edges.
        (get_sese): Get an sese (from a loop) if possible, invalid_sese
	otherwise.
        (get_nearest_dom_with_single_entry): Get nearest dominator of a
	basic_block with single entry. Return NULL if we get to the
	beginning of a function.
        (get_nearest_pdom_with_single_exit): Get nearest post-dominator of
	a basic_block with single exit. Return NULL if we get to the
	beginning of a function.
        (print_sese): Pretty-print SESE.
        (merge_sese): Merge two SESEs if possible and return the new SESE.
        (build_scop_depth): Start building the SCoP within a loop nest.
        (build_scop_breadth): Start building the SCoP at a single loop
	depth. Merge adjacent SESEs if valid.
        (can_represent_loop_1): Returns true if Graphite can represent
	loop inside SCoP. Helper for can_represent_loop.
        (can_represent_loop): Returns true if Graphite can represent LOOP
	and all its nested loops in SCoP.
        (loop_is_valid_scop): Returns true if LOOP and all its nests
	constitute a valid SCoP.
        (region_has_one_loop): Returns true of a region has only one loop.
        (add_scop): Add SCoP to the list of valid scops. Removes an
	already existing scop if it intersects with or subsumed by this
	one.
        (harmful_stmt_in_region): Returns true if SCoP has any statment
	which cannot be represented by Graphite.
        (subsumes): Returns true of SCoP S1 subsumes SCoP S2.
        (remove_subscops): Remove any SCoP from the list of already found
	SCoPs, if subsumed by S1.
        (intersects): Return true if region bounded by SCoPs S1 and S2
	intersect.
        (remove_intersecting_scops): Remove any SCoP which intersects with
	S1.
        * graphite.c (print_graphite_scop_statistics):
        (print_graphite_statistics): Print SCoP info while debugging.
        (graphite_initialize): Early exit in case number of loops in a
	function is less than PARAM_GRAPHITE_MIN_LOOPS_PER_FUNCTION or
	basic blocks are more than PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION.
        (graphite_finalize):
        * params.def: Add PARAM_GRAPHITE_MIN_LOOPS_PER_FUNCTION.
        * sese.h (sese_loop_depth): Remove unnecessary gcc_assert.
        (recompute_all_dominators): Recalculate POST_DOMINATORS.
        * tree-cfg.c (print_loops): Print the function name while printing
	loops.

gcc/testsuite/ChangeLog:

2015-09-27  Aditya Kumar  <hiraditya@msn.com>
            Sebastian Pop  <s.pop@samsung.com>
        * gcc.dg/graphite/block-1.c: Modified to match the pattern.
        * gcc.dg/graphite/block-3.c: Same.
        * gcc.dg/graphite/block-4.c: Same.
        * gcc.dg/graphite/block-5.c: Same.
        * gcc.dg/graphite/block-6.c: Same.
        * gcc.dg/graphite/block-7.c: Same.
        * gcc.dg/graphite/block-8.c: Same.
        * gcc.dg/graphite/block-pr47654.c: Same.
        * gcc.dg/graphite/interchange-0.c: Same.
        * gcc.dg/graphite/interchange-1.c: Same.
        * gcc.dg/graphite/interchange-10.c: Same.
        * gcc.dg/graphite/interchange-11.c: Same.
        * gcc.dg/graphite/interchange-12.c: Same.
        * gcc.dg/graphite/interchange-13.c: Same.
        * gcc.dg/graphite/interchange-14.c: Same.
        * gcc.dg/graphite/interchange-15.c: Same.
        * gcc.dg/graphite/interchange-3.c: Same.
        * gcc.dg/graphite/interchange-4.c: Same.
        * gcc.dg/graphite/interchange-5.c: Same.
        * gcc.dg/graphite/interchange-6.c: Same.
        * gcc.dg/graphite/interchange-7.c: Same.
        * gcc.dg/graphite/interchange-8.c: Same.
        * gcc.dg/graphite/interchange-9.c: Same.
        * gcc.dg/graphite/interchange-mvt.c: Same.
        * gcc.dg/graphite/pr35356-1.c (foo): Same.
        * gcc.dg/graphite/pr35356-3.c: Same.
        * gcc.dg/graphite/pr37485.c: Same.
        * gcc/testsuite/gcc.dg/graphite/run-id-pr67700-1.c: New test case.
        * gcc.dg/graphite/scop-1.c (int toto): Modified to match the pattern.
        * gcc.dg/graphite/scop-11.c: Same.
        * gcc.dg/graphite/scop-5.c: Same.
        * gcc.dg/graphite/uns-block-1.c: Same.
        * gcc.dg/graphite/uns-interchange-9.c: Same.
        * gfortran.dg/graphite/block-1.f90: Same.
        * gfortran.dg/graphite/interchange-3.f90: Same.
        * gfortran.dg/graphite/pr14741.f90: Same.

From-SVN: r228215
2015-09-28 17:30:09 +00:00
Sebastian Pop 6b3ebcdda1 fix PR53852: stop ISL after a given number of operations
2015-09-02  Sebastian Pop  <s.pop@samsung.com>

            * config.in: Regenerate.
            * configure: Regenerate.
            * configure.ac (HAVE_ISL_CTX_MAX_OPERATIONS): Detect.
            * graphite-optimize-isl.c (optimize_isl): Stop computation when
            PARAM_MAX_ISL_OPERATIONS is reached.
            * params.def (PARAM_MAX_ISL_OPERATIONS): Add.

            * graphite-dependences.c (extend_schedule): Remove gcc_asserts on
            result equal to isl_stat_ok as the status now can be isl_error_quota.
            (subtract_commutative_associative_deps): Same.
            (compute_deps): Same.

testsuite/
            * gcc.dg/graphite/uns-interchange-12.c: Adjust pattern to pass with
            both isl-0.12 and isl-0.15.
            * gcc.dg/graphite/uns-interchange-14.c: Same.
            * gcc.dg/graphite/uns-interchange-15.c: Same.
            * gcc.dg/graphite/uns-interchange-mvt.c: Same.

From-SVN: r227572
2015-09-09 04:20:47 +00:00
Tom de Vries f7f186847d Add param parloops-chunk-size
2015-09-03  Tom de Vries  <tom@codesourcery.com>

	* doc/invoke.texi (parloops-chunk-size): Add item.
	* params.def (PARAM_PARLOOPS_CHUNK_SIZE): Add DEFPARAM.
	* tree-parloops.c: Include params.h.
	(create_parallel_loop): Set chunk-size of schedule of omp-for loop, if
	param parloops-chunk-size is used.

From-SVN: r227434
2015-09-03 11:00:46 +00:00
Sebastian Pop a5e5ea0c07 remove -floop-unroll-and-jam
* common.opt (floop-unroll-and-jam): Make alias of floop-nest-optimize.
	* doc/invoke.texi (-floop-unroll-and-jam): Document as alias of
	-floop-nest-optimize.
	* graphite-isl-ast-to-gimple.c (generate_luj_sepclass_opt): Remove.
	(generate_luj_sepclass): Remove.
	(generate_luj_options): Remove.
	(set_options): Remove opt_luj.
	(scop_to_isl_ast): Remove opt_luj.
	* graphite-optimize-isl.c (getScheduleForBand): Remove check for
	flag_loop_unroll_jam.
	(getPrevectorMap_full): Remove.
	(getScheduleForBandList): Remove map_sepcl.
	(getScheduleMap): Same.
	(apply_schedule_map_to_scop): Remove sepcl.
	(optimize_isl): Same.
	* graphite-poly.c (apply_poly_transforms): Remove check for
	flag_loop_unroll_jam.
	(new_poly_bb): Remove map_sepclass.
	* graphite-poly.h (struct poly_bb): Same.
	* graphite.c (gate_graphite_transforms): Remove flag_loop_unroll_jam.
	* params.def (PARAM_LOOP_UNROLL_JAM_SIZE)
	(PARAM_LOOP_UNROLL_JAM_DEPTH): Remove.
	* toplev.c (process_options): Remove flag_loop_unroll_jam.

From-SVN: r227275
2015-08-27 19:06:56 +00:00
Aditya Kumar ac73bb4c82 [graphite] reduce the number of params in a scop to 3
* params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Default to 3.

From-SVN: r226365
2015-07-29 21:28:27 +00:00
Sebastian Pop 49b8fe6c1a fix pr46851 and pr60340: remove unmaintained omega dependence test
Regstrapped on amd64-linux.

2015-07-18  Sebastian Pop  <s.pop@samsung.com>

	PR middle-end/46851
	PR middle-end/60340
	* Makefile.in: Removed omega.o.
	* common.opt: Remove flag fcheck-data-deps.
	* doc/invoke.texi: Remove documentation for fcheck-data-deps and
	its associated params: omega-max-vars, omega-max-geqs,
	omega-max-eqs, omega-max-wild-cards, omega-hash-table-size,
	omega-max-keys, omega-eliminate-redundant-constraints.
	* doc/loop.texi: Remove all the section on Omega.
	* graphite-blocking.c: Include missing params.h: it used to be
	included through tree-data-ref.h and omega.h.
	* graphite-isl-ast-to-gimple.c: Same.
	* graphite-optimize-isl.c: Same.
	* graphite-sese-to-poly.c: Same.
	* graphite.c: Same.
	* omega.c: Remove.
	* omega.h: Remove.
	* params.def: Removed PARAM_OMEGA_MAX_VARS, PARAM_OMEGA_MAX_GEQS,
	PARAM_OMEGA_MAX_EQS, PARAM_OMEGA_MAX_WILD_CARDS,
	PARAM_OMEGA_HASH_TABLE_SIZE, PARAM_OMEGA_MAX_KEYS, and
	PARAM_OMEGA_ELIMINATE_REDUNDANT_CONSTRAINTS.
	* passes.def: Remove pass_check_data_deps.
	* tree-data-ref.c (dump_affine_function): Declare DEBUG_FUNCTION.
	(dump_conflict_function): Same.
	(dump_subscript): Same.
	(print_direction_vector): Same.
	(print_dir_vectors): Same.
	(print_lambda_vector): Same.
	(print_dist_vectors): Same.
	(dump_data_dependence_relation): Same.
	(dump_data_dependence_relations): Same.
	(dump_dist_dir_vectors): Same.
	(dump_ddrs): Same.
	(init_omega_eq_with_af): Removed.
	(omega_extract_distance_vectors): Removed.
	(omega_setup_subscript): Removed.
	(init_omega_for_ddr_1): Removed.
	(init_omega_for_ddr): Removed.
	(ddr_consistent_p): Removed.
	(compute_affine_dependence): Do not use omega to check data
	dependences.
	(compute_data_dependences_for_bb): Removed.
	(analyze_all_data_dependences): Removed.
	(tree_check_data_deps): Removed.
	* tree-data-ref.h: Do not include omega.h.
	(compute_data_dependences_for_bb): Removed.
	(tree_check_data_deps): Removed.
	* tree-ssa-loop.c (pass_check_data_deps): Removed.
	(make_pass_check_data_deps): Removed.
	* tree-ssa-phiopt.c: Include params.h.
	* tree-vect-data-refs.c: Same.
	* tree-vect-slp.c: Same.

testsuite/
	* gcc.dg/tree-ssa/pr42327.c: Removed.
	* g++.dg/other/pr35011.C: Removed.

From-SVN: r225979
2015-07-18 01:11:05 +00:00
Kyrylo Tkachov b7dce216c7 [tree-ssa-math-opts] Expand pow (x, CONST) using square roots when possible
* params.def (PARAM_MAX_POW_SQRT_DEPTH): New param.
	* tree-ssa-math-opts.c: Include params.h
	(pow_synth_sqrt_info): New struct.
	(representable_as_half_series_p): New function.
	(get_fn_chain): Likewise.
	(print_nested_fn): Likewise.
	(dump_fractional_sqrt_sequence): Likewise.
	(dump_integer_part): Likewise.
	(expand_pow_as_sqrts): Likewise.
	(gimple_expand_builtin_pow): Use above to attempt to expand
	pow as series of square roots.  Removed now unused variables.

	* gcc.target/aarch64/pow-sqrt-synth-1.c: New test.
	* gcc.dg/pow-sqrt.x: New file.
	* gcc.dg/pow-sqrt-1.c: New test.
	* gcc.dg/pow-sqrt-2.c: Likewise.
	* gcc.dg/pow-sqrt-3.c: Likewise.

From-SVN: r223167
2015-05-13 15:26:14 +00:00
Jan Hubicka 9a820e8446 invoke.texi (inline-unit-growth): Increase growth to 20%
* invoke.texi (inline-unit-growth): Increase growth to 20%
	* params.def (PARAM_INLINE_UNIT_GROWTH): Likewise.

From-SVN: r221868
2015-04-04 21:07:46 +00:00
Martin Jambor af21714c7b re PR ipa/65478 (crafty performance regression)
PR ipa/65478
	* params.def (PARAM_IPA_CP_RECURSION_PENALTY) : New.
	(PARAM_IPA_CP_SINGLE_CALL_PENALTY): Likewise.
	* ipa-prop.h (ipa_node_params): New flags node_within_scc and
	node_calling_single_call.
	* ipa-cp.c (count_callers): New function.
	(set_single_call_flag): Likewise.
	(initialize_node_lattices): Count callers and set single_flag_call if
	necessary.
	(incorporate_penalties): New function.
	(good_cloning_opportunity_p): Use it, dump new flags.
	(propagate_constants_topo): Set node_within_scc flag if appropriate.
	* doc/invoke.texi (ipa-cp-recursion-penalty,
	ipa-cp-single-call-pentalty): Document.

From-SVN: r221763
2015-03-29 15:38:52 +00:00
Vladimir Makarov 9bc163e36e params.def (PARAM_LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF): Fix a typo in the description.
2015-02-27  Vladimir Makarov  <vmakarov@redhat.com>

	* params.def (PARAM_LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF): Fix
	a typo in the description.

From-SVN: r221071
2015-02-27 23:37:46 +00:00
Vladimir Makarov fb8a0e4094 re PR rtl-optimization/64317 (Ineffective allocation of PIC base register)
2015-02-27  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/64317
	* params.def (PARAM_LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF): New.
	* params.h (LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF): New.
	* lra-constraints.c: Include "params.h".
	(EBB_PROBABILITY_CUTOFF): Use
	LRA_INHERITANCE_EBB_PROBABILITY_CUTOFF.
	(lra_inheritance): Use '<' instead of '<=' for
	EBB_PROBABILITY_CUTOFF.
	* doc/invoke.texi (lra-inheritance-ebb-probability-cutoff):
	Document change.

From-SVN: r221070
2015-02-27 22:02:05 +00:00
Jan Hubicka c2db720467 params.def (inline-unit-growth): Drop to 15%.
* params.def (inline-unit-growth): Drop to 15%.
	* invoke.texi (inline-unit-growth): Document change.

From-SVN: r219863
2015-01-19 22:11:03 +00:00
Maxim Kuvyrkov 340c79045e Model cache auto-prefetcher in scheduler
* config/arm/arm-protos.h (struct tune_params): New field
	sched_autopref_queue_depth.
	* config/arm/arm.c (sched-int.h): Include header.
	(arm_first_cycle_multipass_dfa_lookahead_guard,)
	(TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Define hook.
	(arm_slowmul_tune, arm_fastmul_tune, arm_strongarm_tune,)
	(arm_xscale_tune, arm_9e_tune, arm_v6t2_tune, arm_cortex_tune,)
	(arm_cortex_a8_tune, arm_cortex_a7_tune, arm_cortex_a15_tune,)
	(arm_cortex_a53_tune, arm_cortex_a57_tune, arm_xgene1_tune,)
	(arm_cortex_a5_tune, arm_cortex_a9_tune, arm_cortex_a12_tune,)
	(arm_v7m_tune, arm_cortex_m7_tune, arm_v6m_tune, arm_fa726te_tune):
	Specify sched_autopref_queue_depth value.  Enabled for A15 and A57.
	* config/arm/t-arm (arm.o): Update.
	* haifa-sched.c (update_insn_after_change): Update.
	(rank_for_schedule): Use auto-prefetcher model, if requested.
	(autopref_multipass_init): New static function.
	(autopref_rank_for_schedule): New rank_for_schedule heuristic.
	(autopref_multipass_dfa_lookahead_guard_started_dump_p): New static
	variable for debug dumps.
	(autopref_multipass_dfa_lookahead_guard_1): New static helper function.
	(autopref_multipass_dfa_lookahead_guard): New global function that
	implements TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD hook.
	(init_h_i_d): Update.
	* params.def (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH): New tuning knob.
	* sched-int.h (enum autopref_multipass_data_status): New const enum.
	(autopref_multipass_data_): Structure for auto-prefetcher data.
	(autopref_multipass_data_def, autopref_multipass_data_t): New typedefs.
	(struct _haifa_insn_data:autopref_multipass_data): New field.
	(INSN_AUTOPREF_MULTIPASS_DATA): New access macro.
	(autopref_multipass_dfa_lookahead_guard): Declare.

From-SVN: r219789
2015-01-17 01:06:43 +00:00