aboutsummaryrefslogtreecommitdiff
path: root/gcc/params.def
AgeCommit message (Collapse)AuthorFilesLines
2018-01-16re PR rtl-optimization/83620 (ICE: in assign_by_spills, at ↵Jakub Jelinek1-1/+1
lra-assigns.c:1470: unable to find a register to spill with -flive-range-shrinkage --param=max-sched-ready-insns=0) PR rtl-optimization/86620 * params.def (max-sched-ready-insns): Bump minimum value to 1. * gcc.dg/pr64935-2.c: Use --param=max-sched-ready-insns=1 instead of --param=max-sched-ready-insns=0. * gcc.target/i386/pr83620.c: New test. * gcc.dg/pr83620.c: New test. From-SVN: r256729
2018-01-13Allow the number of iterations to be smaller than VFRichard Sandiford1-1/+1
Fully-masked loops can be profitable even if the iteration count is smaller than the vectorisation factor. In this case we're effectively doing a complete unroll followed by SLP. The documentation for min-vect-loop-bound says that the default value was 0, but actually the default and minimum were 1. We need it to be 0 for this case since the parameter counts a whole number of vector iterations. 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * doc/sourcebuild.texi (vect_fully_masked): Document. * params.def (PARAM_MIN_VECT_LOOP_BOUND): Change minimum and default value to 0. * tree-vect-loop.c (vect_analyze_loop_costing): New function, split out from... (vect_analyze_loop_2): ...here. Don't check the vectorization factor against the number of loop iterations if the loop is fully-masked. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_vect_fully_masked): New proc. * gcc.dg/vect/slp-3.c: Expect all loops to be vectorized if vect_fully_masked. * gcc.target/aarch64/sve/loop_add_4.c: New test. * gcc.target/aarch64/sve/loop_add_4_run.c: Likewise. * gcc.target/aarch64/sve/loop_add_5.c: Likewise. * gcc.target/aarch64/sve/loop_add_5_run.c: Likewise. * gcc.target/aarch64/sve/miniloop_1.c: Likewise. * gcc.target/aarch64/sve/miniloop_2.c: Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256629
2018-01-12Deferring FMA transformations in tight loopsMartin Jambor1-0/+5
2018-01-12 Martin Jambor <mjambor@suse.cz> PR target/81616 * params.def: New parameter PARAM_AVOID_FMA_MAX_BITS. * tree-ssa-math-opts.c: Include domwalk.h. (convert_mult_to_fma_1): New function. (fma_transformation_info): New type. (fma_deferring_state): Likewise. (cancel_fma_deferring): New function. (result_of_phi): Likewise. (last_fma_candidate_feeds_initial_phi): Likewise. (convert_mult_to_fma): Added deferring logic, split actual transformation to convert_mult_to_fma_1. (math_opts_dom_walker): New type. (math_opts_dom_walker::after_dom_children): New method, body moved here from pass_optimize_widening_mul::execute, added deferring logic bits. (pass_optimize_widening_mul::execute): Moved most of code to math_opts_dom_walker::after_dom_children. * config/i386/x86-tune.def (X86_TUNE_AVOID_128FMA_CHAINS): New. * config/i386/i386.c (ix86_option_override_internal): Added maybe_setting of PARAM_AVOID_FMA_MAX_BITS. From-SVN: r256581
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2017-12-12[SFN] introduce statement frontier notes, still disabledAlexandre Oliva1-0/+9
This patch completes the infrastructure for the introduction of statement frontiers in C-family languages. It brings in all the code remaining code needed to introduce and transform begin stmt trees, gimple stmts, insns and notes, and ultimately use them to generate the is_stmt column in DWARF2+ line number tables/programs, however none of it is activated: the option that would do so will be introduced in a subsequent patch. This patch depends on an earlier patch with not-quite-boilerplate changes towards SFN. for gcc/c-family/ChangeLog * c-semantics.c (pop_stmt_list): Move begin stmt marker into subsequent statement list. for gcc/c/ChangeLog * c-objc-common.h (LANG_HOOKS_EMITS_BEGIN_STMT): Redefine as true. * c-parser.c (add_debug_begin_stmt): New. (c_parser_declaration_or_fndef): Call it. (c_parser_compound_statement_nostart): Likewise. (c_parser_statement_after_labels): Likewise. * c-typeck (c_finish_stmt_expr): Skip begin stmts markers. for gcc/cp/ChangeLog * constexpr.c (check_constexpr_ctor_body_1): Skip begin stmt markers. (constexpr_fn_retval): Likewise. (potential_constant_expression_1): Likewise. (cxx_eval_statement_list): Check that a begin stmt marker is not used as the value of a statement list. (cxx_eval_constant_expression): Return begin stmt markers unchanged. * cp-array-notation.c (stmt_location): New. (cp_expand_cond_array_notations): Use it. * cp-objcp-common.h (LANG_HOOKS_EMITS_BEGIN_STMT): Redefine as true. * parser.c (add_debug_begin_stmt): New. (cp_parser_statement): Call it. * pt.c (tsubst_copy): Handle begin stmt markers. for gcc/ChangeLog * cfgexpand.c (expand_gimple_basic_block): Handle begin stmt markers. Integrate source bind into debug stmt expand loop. (pass_expand::execute): Check debug marker limit. Avoid deep TER and expand debug locations for debug bind insns only. * cse.c (insn_live_p): Keep nonbind markers and debug bindings followed by them. * df-scan.c (df_insn_delete): Accept out-of-block debug insn. * final.c (reemit_insn_block_notes): Take current block from nonbind markers. Declare note where it's first set. (final_scan_insn): Handle begin stmt notes. Emit is_stmt according to begin stmt markers if enabled. (notice_source_line): Handle nonbind markers. Fail if their location is unknown or that of builtins. (rest_of_handle_final): Convert begin stmt markers to notes if var-tracking didn't run. (rest_of_clean_state): Skip begin stmt markers. * gimple-pretty-print.c (dump_gimple_debug): Handle begin stmt markers. * function.c (allocate_struct_function): Set begin_stmt_markers. * function.h (struct function): Add debug_marker_count counter and debug_nonbind_markers flag. * gimple-iterator.c (gsi_remove): Adjust debug_marker_count. * gimple-low.c (lower_function_body): Adjust debug_nonbind_markers. (lower_stmt): Drop or skip gimple debug stmts. (lower_try_catch): Skip debug stmts. * gimple.c (gimple_build_debug_begin_stmt): New. (gimple_copy): Increment debug_marker_count if copying one. * gimple.h (gimple_build_debug_begin_stmt): Declare. * gimplify.c (rexpr_location): New. (rexpr_has_location): New. (warn_switch_unreachable_r): Handle gimple debug stmts. (shortcut_cond_r): Call expr_location. (find_goto): New. (find_goto_label): New. (shortcut_cond_expr): Call expr_has_location, expr_location, and find_goto_label. (gimplify_cond_expr): Call find_goto_label, expr_has_location, and expr_location. (gimplify_expr): Handle begin stmt markers. Reject debug expr decls. * langhooks-def.h (LANG_HOOKS_EMITS_BEGIN_STMT): New. Add to... (LANG_HOOKS_INITIALIZER): ... this. * langhooks.h (struct lang_hooks): Add emits_begin_stmt. * lra-contraints.c (inherit_reload_reg): Tolerate between-blocks debug insns. (update_ebb_live_info): Skip debug insn markers. * lra.c (debug_insn_static_data): Rename to... (debug_bind_static_data): ... this. (debug_marker_static_data): New. (lra_set_insn_recog_data): Select one of the above depending on debug insn kind. (lra_update_isn_regno_info): Don't assume debug insns have freqs. (push_insns): Skip debug insns. * lto-streamer-in.c (input_function): Drop debug stmts depending on active options. Adjust debug_nonbind_markers. * params.def (PARAM_MAX_DEBUG_MARKER_COUNT): New. * print-rtl.c (rtx_writer::print_rtx_operand_code_0): Handle begin stmt marker notes. (print_insn): Likewise. * recog.c (extract_insn): Recognize rtl for debug markers. * rtl.def (DEBUG_MARKER): New. * tree-inline.c: Include params.h. (remap_gimple_stmt): Handle nonbind markers. (maybe_move_debug_stmts_to_successors): Likewise. (copy_debug_stmt): Likewise. * tree-iterator.c (append_to_statement_list_1): Append begin stmt markers regardless of no side effects. (tsi_link_before): Don't update container's side effects when adding a begin stmt marker. (tsi_link_after): Likewise. (expr_first): Skip begin stmt markers. (expr_last): Likewise. * tree-pretty-print (dump_generic_node): Handle begin stmt markers. * tree-ssa-threadedge.c (propagate_threaded_block_debug_info): Disregard nonbind markers. * tree.c (make_node_stat): Don't set side effects for begin stmt markers. (build1_stat): Likewise. * tree.def (DEBUG_BEGIN_STMT): New. * tree.h (GOTO_DESTINATION): Require a GOTO_EXPR. * var-tracking.c (delete_debug_insns): Renamed to... (delete_vta_debug_insns): ... this. (reemit_marker_as_note): New. (vt_initialize): Reemit markers. (delete_vta_debug_insns): Likewise. (vt_debug_insns_local): Reemit or delete markers. (variable_tracking_main_1): Likewise. * doc/generic.texi (DEBUG_BEGIN_STMT): Document. * doc/gimple.texi (gimple_debug_begin_stmt_p): New. (gimple_debug_nonbind_marker_p): New. (gimple_build_debug_bind): Adjust. (gimple_build_debug_begin_stmt): New. * doc/invoke.texi (max-debug-marker-count): New param. * doc/rtl.texi (debug_implicit_ptr, entry_value): New. (debug_parameter_ref, debug_marker): New. (NOTE_INSN_BEGIN_STMT): New. (DEBUG_INSN): Describe begin stmt markers. From-SVN: r255568
2017-12-07re PR tree-optimization/81303 (410.bwaves regression caused by r249919)Bin Cheng1-0/+14
PR tree-optimization/81303 * Makefile.in (gimple-loop-interchange.o): New object file. * common.opt (floop-interchange): Reuse the option from graphite. * doc/invoke.texi (-floop-interchange): Ditto. New document for -floop-interchange and mention it for -O3. * opts.c (default_options_table): Enable -floop-interchange at -O3. * gimple-loop-interchange.cc: New file. * params.def (PARAM_LOOP_INTERCHANGE_MAX_NUM_STMTS): New parameter. (PARAM_LOOP_INTERCHANGE_STRIDE_RATIO): New parameter. * passes.def (pass_linterchange): New pass. * timevar.def (TV_LINTERCHANGE): New time var. * tree-pass.h (make_pass_linterchange): New declaration. * tree-ssa-loop-ivcanon.c (create_canonical_iv): Change to external interchange. Record IV before/after increment in new parameters. * tree-ssa-loop-ivopts.h (create_canonical_iv): New declaration. * tree-vect-loop.c (vect_is_simple_reduction): Factor out reduction path check into... (check_reduction_path): ...New function here. * tree-vectorizer.h (check_reduction_path): New declaration. gcc/testsuite * gcc.dg/tree-ssa/loop-interchange-1.c: New test. * gcc.dg/tree-ssa/loop-interchange-1b.c: New test. * gcc.dg/tree-ssa/loop-interchange-2.c: New test. * gcc.dg/tree-ssa/loop-interchange-3.c: New test. * gcc.dg/tree-ssa/loop-interchange-4.c: New test. * gcc.dg/tree-ssa/loop-interchange-5.c: New test. * gcc.dg/tree-ssa/loop-interchange-6.c: New test. * gcc.dg/tree-ssa/loop-interchange-7.c: New test. * gcc.dg/tree-ssa/loop-interchange-8.c: New test. * gcc.dg/tree-ssa/loop-interchange-9.c: New test. * gcc.dg/tree-ssa/loop-interchange-10.c: New test. * gcc.dg/tree-ssa/loop-interchange-11.c: New test. * gcc.dg/tree-ssa/loop-interchange-12.c: New test. * gcc.dg/tree-ssa/loop-interchange-13.c: New test. Co-Authored-By: Richard Biener <rguenther@suse.de> From-SVN: r255472
2017-12-07Add unroll and jam passMichael Matz1-0/+10
* gimple-loop-jam.c: New file. * Makefile.in (OBJS): Add gimple-loop-jam.o. * common.opt (funroll-and-jam): New option. * opts.c (default_options_table): Add unroll-and-jam at -O3. * params.def (PARAM_UNROLL_JAM_MIN_PERCENT): New param. (PARAM_UNROLL_JAM_MAX_UNROLL): Ditto. * passes.def: Add pass_loop_jam. * timevar.def (TV_LOOP_JAM): Add. * tree-pass.h (make_pass_loop_jam): Declare. * cfgloop.c (flow_loop_tree_node_add): Add AFTER argument. * cfgloop.h (flow_loop_tree_node_add): Adjust declaration. * cfgloopmanip.c (duplicate_loop): Add AFTER argument, adjust call to flow_loop_tree_node_add. (duplicate_subloops, copy_loops_to): Append to sibling list. * cfgloopmanip.h: (duplicate_loop): Adjust declaration. * doc/invoke.texi (-funroll-and-jam): Document new option. (unroll-jam-min-percent, unroll-jam-max-unroll): Document new params. testsuite/ * gcc.dg/unroll-and-jam.c: New test. From-SVN: r255467
2017-11-27[PR 81248] Fix ipa-sra size checkMartin Jambor1-2/+2
2017-11-27 Martin Jambor <mjambor@suse.cz> PR tree-optimization/81248 * tree-sra.c (splice_param_accesses): Remove size check. (decide_one_param_reduction): Fix size check. * gimple-pretty-print.c (dump_profile): Silence warning. * params.def (PARAM_IPA_SRA_PTR_GROWTH_FACTOR): Adjust description. testsuite/ * g++.dg/ipa/pr81248.C: New test. * gcc.dg/tree-ssa/ssa-pre-31.c: Disable IPA-SRA. * gcc/testsuite/gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. From-SVN: r255163
2017-11-17re PR fortran/83017 (DO CONCURRENT not parallelizing)Richard Biener1-0/+6
2017-11-17 Richard Biener <rguenther@suse.de> PR tree-optimization/83017 * tree-parloops.c (MIN_PER_THREAD): Use --param parloops-min-per-thread. (gen_parallel_loop): Properly count iterations. (parallelize_loops): Handle loop->can_be_parallel independent of flag_loop_parallelize_all. Make static profitability test match the runtime one. * params.def (PARAM_PARLOOPS_MIN_PER_THREAD): New. * invoke.texi (parloops-min-per-thread): Document. * gcc.dg/autopar/pr49960.c: Adjust. From-SVN: r254867
2017-10-132017-10-13 Richard Biener <rguenther@suse.de>Richard Biener1-7/+0
* graphite-isl-ast-to-gimple.c (translate_isl_ast_to_gimple::get_rename_from_scev): Remove unused parameters and dominance check. (translate_isl_ast_to_gimple::graphite_copy_stmts_from_block): Adjust. (translate_isl_ast_to_gimple::copy_bb_and_scalar_dependences): Likewise. (translate_isl_ast_to_gimple::graphite_regenerate_ast_isl): Do not update SSA form here or do intermediate IL verification. * graphite.c: Include tree-ssa.h and tree-into-ssa.h. (graphite_initialize): Remove check on the number of loops in the function and inline into graphite_transform_loops. (graphite_finalize): Inline into graphite_transform_loops. (graphite_transform_loops): Perform SSA update and IL verification here. * params.def (PARAM_GRAPHITE_MIN_LOOPS_PER_FUNCTION): Remove. * gcc.dg/graphite/pr35356-3.c: XFAIL again. * gcc.dg/graphite/pr81373-2.c: Copy from gcc.dg/graphite/pr81373.c with alternate flags. From-SVN: r253720
2017-10-02graphite-isl-ast-to-gimple.c (set_codegen_error): With -fchecking and ↵Richard Biener1-0/+6
--param graphite-allow-codegen-errors=0 ICE. 2017-10-02 Richard Biener <rguenther@suse.de> * graphite-isl-ast-to-gimple.c (set_codegen_error): With -fchecking and --param graphite-allow-codegen-errors=0 ICE. * params.def (PARAM_GRAPHITE_ALLOW_CODEGEN_ERRORS): New param. * gcc.dg/graphite/graphite.exp: Add -fdump-tree-graphite-details. * gcc.dg/graphite/id-15.c: Adjust for existing codegen errors. * gcc.dg/graphite/id-16.c: Likewise. * gcc.dg/graphite/pr46168.c: Likewise. * gcc.dg/graphite/pr68756.c: Likewise. * gcc.dg/graphite/pr69728.c: Likewise. * gcc.dg/graphite/pr71575-2.c: Likewise. * gcc.dg/graphite/pr77362.c: Likewise. * gcc.dg/graphite/pr81373.c: Likewise. * gcc.dg/graphite/run-id-pr67700-1.c: Likewise. * gfortran.dg/graphite/interchange-1.f: Likewise. * gfortran.dg/graphite/pr29581.f90: Likewise. * gfortran.dg/graphite/pr42334-1.f: Likewise. * gfortran.dg/graphite/pr42393-1.f90: Likewise. * gfortran.dg/graphite/pr42393.f90: Likewise. * gfortran.dg/graphite/pr47019.f: Likewise. From-SVN: r253342
2017-09-27invoke.texi (graphite-max-bbs-per-function): Remove.Richard Biener1-8/+1
2017-09-27 Richard Biener <rguenther@suse.de> * doc/invoke.texi (graphite-max-bbs-per-function): Remove. (graphite-max-nb-scop-params): Document special value zero. * domwalk.h (dom_walker::STOP): New symbolical constant. (dom_walker::dom_walker): Add optional parameter for bb to RPO mapping. (dom_walker::~dom_walker): Declare. (dom_walker::before_dom_children): Document STOP return value. (dom_walker::m_user_bb_to_rpo): New member. (dom_walker::m_bb_to_rpo): Likewise. * domwalk.c (dom_walker::dom_walker): Compute bb to RPO mapping here if not provided by the user. (dom_walker::~dom_walker): Free bb to RPO mapping if not provided by the user. (dom_walker::STOP): Define. (dom_walker::walk): Do not compute bb to RPO mapping here. Support STOP return value from before_dom_children to stop walking. * graphite-optimize-isl.c (optimize_isl): If the schedule is the same still generate code if -fgraphite-identity or -floop-parallelize-all are given. * graphite-scop-detection.c: Include cfganal.h. (gather_bbs::gather_bbs): Get and pass through bb to RPO mapping. (gather_bbs::before_dom_children): Return STOP for BBs not in the region. (build_scops): Compute bb to RPO mapping and pass it to the domwalk. Treat --param graphite-max-nb-scop-params=0 as not limiting the number of params. * graphite.c (graphite_initialize): Remove limit on the number of basic-blocks in a function. * params.def (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Remove. (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Adjust to documented default value of 10. From-SVN: r253226
2017-09-19common.opt (-fstack-clash-protection): New option.Jeff Law1-0/+10
* common.opt (-fstack-clash-protection): New option. * flag-types.h (enum stack_check_type): Note difference between -fstack-check= and -fstack-clash-protection. * params.def (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE): New PARAM. (PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL): Likewise. * toplev.c (process_options): Issue warnings/errors for cases not handled with -fstack-clash-protection. * doc/invoke.texi (-fstack-clash-protection): Document new option. (-fstack-check): Note additional problem with -fstack-check=generic. Note that -fstack-check is primarily for Ada and refer users to -fstack-clash-protection for stack-clash-protection. Document new params for stack clash protection. * gcc.dg/stack-check-2.c: New test. * lib/target-supports.exp (check_effective_target_supports_stack_clash_protection): New function. (check_effective_target_frame_pointer_for_non_leaf): Likewise. (check_effective_target_caller_implicit_probes): Likewise. From-SVN: r252994
2017-07-06asan.h (asan_sanitize_allocas_p): Declare.Maxim Ostapenko1-0/+5
gcc/ * asan.h (asan_sanitize_allocas_p): Declare. * asan.c (asan_sanitize_allocas_p): New function. (handle_builtin_stack_restore): Bail out if !asan_sanitize_allocas_p. (handle_builtin_alloca): Likewise. * cfgexpand.c (expand_used_vars): Do not add allocas unpoisoning stuff if !asan_sanitize_allocas_p. * params.def (asan-instrument-allocas): Add new option. * params.h (ASAN_PROTECT_ALLOCAS): Define. * opts.c (common_handle_option): Disable allocas sanitization for KASan by default. gcc/testsuite/ * c-c++-common/asan/kasan-alloca-1.c: New test. * c-c++-common/asan/kasan-alloca-2.c: Likewise. From-SVN: r250032
2017-05-26Bound partial-inlining-entry-probability param (PR ipa/80663).Martin Liska1-1/+1
2017-05-26 Martin Liska <mliska@suse.cz> PR ipa/80663 * params.def: Bound partial-inlining-entry-probability param. 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: r248489
2017-03-13re PR other/79991 (typo in params.def, PARAM_VECT_MAX_PEELING_FOR_ALIGNMENT)Richard Biener1-1/+1
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-07PR c/79855: add full stop to store merging param descriptionsKyrylo Tkachov1-2/+2
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-02-23Change default of param not being smaller that min.Martin Liska1-1/+1
2017-02-23 Martin Liska <mliska@suse.cz> * params.def (PARAM_MIN_NONDEBUG_INSN_UID): Change default to 0. From-SVN: r245677
2017-02-17Increase minimum for a param (PR rtl-optimization/79577).Martin Liska1-1/+1
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-17re PR tree-optimization/79576 (ICE in gimple_stmt_nonnegative_warnv_p in ↵Richard Biener1-1/+1
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-11re PR tree-optimization/79224 (Large C-Ray slowdown)Jan Hubicka1-1/+1
PR ipa/79224 * params.def (inline-min-speedup) Change from 10 to 8. From-SVN: r245366
2017-01-13re PR tree-optimization/33562 (aggregate DSE disabled)Jeff Law1-0/+5
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-09re PR translation/79019 (translatable string typo in cif-code.def:141)Jakub Jelinek1-3/+3
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-07re PR translation/79018 (translatable string typo in params.def:1105)Jakub Jelinek1-1/+1
PR translation/79018 * params.def (PARAM_MAX_STORES_TO_MERGE): Add missing space between the and store. From-SVN: r244195
2017-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r243994
2016-11-16Support non-masked epilogue vectoriziationYuri Rumyantsev1-0/+5
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-07Introduce -fsanitize-address-use-after-scopeMartin Liska1-0/+6
* 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-10-28GIMPLE store merging passKyrylo Tkachov1-0/+12
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-07-26Teach VRP to register assertions along default switch labels (PR18046)Patrick Palka1-0/+6
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-21[Patch 1/2 ifcvt costs] New target hook: max_noce_ifcvt_seq_costJames Greenhalgh1-0/+14
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-12Introduce new param: AVG_LOOP_NITERMartin Liska1-0/+5
* 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-06-20[typo] alignement -> alignmentKyrylo Tkachov1-1/+1
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-08invoke.texi (max-loop-headers-insns): Document.Jan Hubicka1-0/+7
* 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-05-03re PR tree-optimization/56541 (vectorizaton fails in conditional assignment ↵Bin Cheng1-0/+6
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-04-27params.def (MIN_PARTITION_SIZE): Set default value to 10000.Prathamesh Kulkarni1-1/+1
2016-04-27 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * params.def (MIN_PARTITION_SIZE): Set default value to 10000. From-SVN: r235538
2016-04-27params.def (MAX_PARTITION_SIZE): New param.Prathamesh Kulkarni1-0/+5
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-03-30re PR middle-end/12392 (very long optimized compile)Michael Matz1-0/+6
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-23re PR tree-optimization/69042 (Missed optimization in ivopts)Bin Cheng1-1/+1
PR tree-optimization/69042 * params.def (PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND): Increase the parameter from 30 to 40. From-SVN: r234430
2016-02-24re PR c/69918 (gcc.dg/torture/builtin-integral-1.c FAILs)Jakub Jelinek1-1/+1
PR c/69918 * params.def (PARAM_MAX_SSA_NAME_QUERY_DEPTH): Bump default from 2 to 3. From-SVN: r233657
2016-02-01re PR testsuite/68580 (FAIL: c-c++-common/tsan/pr65400-1.c -O0 execution test)Jeff Law1-0/+5
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-01-27re PR tree-optimization/68398 (coremark regression due to r229685)Jeff Law1-0/+10
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-19Merge of HSAMartin Jambor1-0/+5
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-11re PR rtl-optimization/68920 (Undesirable if-conversion for a rarely taken ↵Yuri Rumyantsev1-0/+6
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-04Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r232055
2015-12-17replace ISL with islSebastian Pop1-1/+1
From-SVN: r231784
2015-11-12[PATCH] Make disabled-optimization warning more informative; increase ↵Brad Lucier1-1/+1
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-10-21Improve --help output to generate references to option aliases.Martin Sebor1-174/+174
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-21add an upper limit on the number of array referencesAditya Kumar1-0/+7
* 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-13Add param parloops-scheduleTom de Vries1-0/+12
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-08Make tree_expr_nonnegative_warnv_p recurse into SSA namesRichard Sandiford1-0/+6
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