Re: [PATCH 2/7] Include new generated gcc/params.opt file.

2019-11-21 Thread Martin Liška

On 11/20/19 10:12 PM, David Malcolm wrote:

On Wed, 2019-11-20 at 16:07 +0100, Martin Liška wrote:

On 11/20/19 4:02 PM, David Malcolm wrote:

On Wed, 2019-11-20 at 15:51 +0100, Martin Liška wrote:

On 11/20/19 3:49 PM, David Malcolm wrote:

On Wed, 2019-11-06 at 11:30 +0100, Martin Liska wrote:

gcc/ChangeLog:

2019-11-06  Martin Liska  

* Makefile.in: Include params.opt.
* flag-types.h (enum parloops_schedule_type): Add
parloops_schedule_type used in params.opt.
* params.opt: New file.
---
gcc/Makefile.in  |   2 +-
gcc/flag-types.h |  11 +
gcc/params.opt   | 967
+++
3 files changed, 979 insertions(+), 1 deletion(-)
create mode 100644 gcc/params.opt


Is your params.def -> params.opt script available
somewhere?  (sorry if
I missed it, I didn't see it looking over the patch kit)


Hi David.


(I'm rebasing my static analyzer patch kit and am about to
convert
my
params.def additions to be params.opt additions, though I'm
only
adding
4 params, so hopefully doing it by hand will be trivial)


No, it's not public. Please convert it by hand, it will be faster
;)


Fair enough.

Does this new machinery mean we can have per-frontend params (by
putting the Param options in the pertinent .opt file) ?  (not sure
what
that will do to LTO)


I guess so. Note that now parameters are first class citizens same as
options.
So that, having a per-FE should work fine.


Thanks.

FWIW, given my branch adds support for in-tree plugins (which can add
options), I've added them to the plugin.opt file:


Which seams reasonable to me! We already have a target-specific parameter
that lives in the corresponding target .opt file:

gcc/config/aarch64/aarch64.opt:-param=aarch64-sve-compare-costs=

Martin



https://gcc.gnu.org/ml/gcc-patches/2019-11/msg02030.html

Dave





Re: [PATCH 2/7] Include new generated gcc/params.opt file.

2019-11-20 Thread David Malcolm
On Wed, 2019-11-20 at 16:07 +0100, Martin Liška wrote:
> On 11/20/19 4:02 PM, David Malcolm wrote:
> > On Wed, 2019-11-20 at 15:51 +0100, Martin Liška wrote:
> > > On 11/20/19 3:49 PM, David Malcolm wrote:
> > > > On Wed, 2019-11-06 at 11:30 +0100, Martin Liska wrote:
> > > > > gcc/ChangeLog:
> > > > > 
> > > > > 2019-11-06  Martin Liska  
> > > > > 
> > > > >   * Makefile.in: Include params.opt.
> > > > >   * flag-types.h (enum parloops_schedule_type): Add
> > > > >   parloops_schedule_type used in params.opt.
> > > > >   * params.opt: New file.
> > > > > ---
> > > > >gcc/Makefile.in  |   2 +-
> > > > >gcc/flag-types.h |  11 +
> > > > >gcc/params.opt   | 967
> > > > > +++
> > > > >3 files changed, 979 insertions(+), 1 deletion(-)
> > > > >create mode 100644 gcc/params.opt
> > > > 
> > > > Is your params.def -> params.opt script available
> > > > somewhere?  (sorry if
> > > > I missed it, I didn't see it looking over the patch kit)
> > > 
> > > Hi David.
> > > 
> > > > (I'm rebasing my static analyzer patch kit and am about to
> > > > convert
> > > > my
> > > > params.def additions to be params.opt additions, though I'm
> > > > only
> > > > adding
> > > > 4 params, so hopefully doing it by hand will be trivial)
> > > 
> > > No, it's not public. Please convert it by hand, it will be faster
> > > ;)
> > 
> > Fair enough.
> > 
> > Does this new machinery mean we can have per-frontend params (by
> > putting the Param options in the pertinent .opt file) ?  (not sure
> > what
> > that will do to LTO)
> 
> I guess so. Note that now parameters are first class citizens same as
> options.
> So that, having a per-FE should work fine.

Thanks.

FWIW, given my branch adds support for in-tree plugins (which can add
options), I've added them to the plugin.opt file:

https://gcc.gnu.org/ml/gcc-patches/2019-11/msg02030.html

Dave



Re: [PATCH 2/7] Include new generated gcc/params.opt file.

2019-11-20 Thread Martin Liška

On 11/20/19 4:02 PM, David Malcolm wrote:

On Wed, 2019-11-20 at 15:51 +0100, Martin Liška wrote:

On 11/20/19 3:49 PM, David Malcolm wrote:

On Wed, 2019-11-06 at 11:30 +0100, Martin Liska wrote:

gcc/ChangeLog:

2019-11-06  Martin Liska  

* Makefile.in: Include params.opt.
* flag-types.h (enum parloops_schedule_type): Add
parloops_schedule_type used in params.opt.
* params.opt: New file.
---
   gcc/Makefile.in  |   2 +-
   gcc/flag-types.h |  11 +
   gcc/params.opt   | 967
+++
   3 files changed, 979 insertions(+), 1 deletion(-)
   create mode 100644 gcc/params.opt


Is your params.def -> params.opt script available
somewhere?  (sorry if
I missed it, I didn't see it looking over the patch kit)


Hi David.


(I'm rebasing my static analyzer patch kit and am about to convert
my
params.def additions to be params.opt additions, though I'm only
adding
4 params, so hopefully doing it by hand will be trivial)


No, it's not public. Please convert it by hand, it will be faster ;)


Fair enough.

Does this new machinery mean we can have per-frontend params (by
putting the Param options in the pertinent .opt file) ?  (not sure what
that will do to LTO)


I guess so. Note that now parameters are first class citizens same as options.
So that, having a per-FE should work fine.

Martin



Dave





Re: [PATCH 2/7] Include new generated gcc/params.opt file.

2019-11-20 Thread David Malcolm
On Wed, 2019-11-20 at 15:51 +0100, Martin Liška wrote:
> On 11/20/19 3:49 PM, David Malcolm wrote:
> > On Wed, 2019-11-06 at 11:30 +0100, Martin Liska wrote:
> > > gcc/ChangeLog:
> > > 
> > > 2019-11-06  Martin Liska  
> > > 
> > >   * Makefile.in: Include params.opt.
> > >   * flag-types.h (enum parloops_schedule_type): Add
> > >   parloops_schedule_type used in params.opt.
> > >   * params.opt: New file.
> > > ---
> > >   gcc/Makefile.in  |   2 +-
> > >   gcc/flag-types.h |  11 +
> > >   gcc/params.opt   | 967
> > > +++
> > >   3 files changed, 979 insertions(+), 1 deletion(-)
> > >   create mode 100644 gcc/params.opt
> > 
> > Is your params.def -> params.opt script available
> > somewhere?  (sorry if
> > I missed it, I didn't see it looking over the patch kit)
> 
> Hi David.
> 
> > (I'm rebasing my static analyzer patch kit and am about to convert
> > my
> > params.def additions to be params.opt additions, though I'm only
> > adding
> > 4 params, so hopefully doing it by hand will be trivial)
> 
> No, it's not public. Please convert it by hand, it will be faster ;)

Fair enough.

Does this new machinery mean we can have per-frontend params (by
putting the Param options in the pertinent .opt file) ?  (not sure what
that will do to LTO)

Dave



Re: [PATCH 2/7] Include new generated gcc/params.opt file.

2019-11-20 Thread Martin Liška

On 11/20/19 3:49 PM, David Malcolm wrote:

On Wed, 2019-11-06 at 11:30 +0100, Martin Liska wrote:

gcc/ChangeLog:

2019-11-06  Martin Liska  

* Makefile.in: Include params.opt.
* flag-types.h (enum parloops_schedule_type): Add
parloops_schedule_type used in params.opt.
* params.opt: New file.
---
  gcc/Makefile.in  |   2 +-
  gcc/flag-types.h |  11 +
  gcc/params.opt   | 967
+++
  3 files changed, 979 insertions(+), 1 deletion(-)
  create mode 100644 gcc/params.opt


Is your params.def -> params.opt script available somewhere?  (sorry if
I missed it, I didn't see it looking over the patch kit)


Hi David.



(I'm rebasing my static analyzer patch kit and am about to convert my
params.def additions to be params.opt additions, though I'm only adding
4 params, so hopefully doing it by hand will be trivial)


No, it's not public. Please convert it by hand, it will be faster ;)

Martin



Thanks
Dave






Re: [PATCH 2/7] Include new generated gcc/params.opt file.

2019-11-20 Thread David Malcolm
On Wed, 2019-11-06 at 11:30 +0100, Martin Liska wrote:
> gcc/ChangeLog:
> 
> 2019-11-06  Martin Liska  
> 
>   * Makefile.in: Include params.opt.
>   * flag-types.h (enum parloops_schedule_type): Add
>   parloops_schedule_type used in params.opt.
>   * params.opt: New file.
> ---
>  gcc/Makefile.in  |   2 +-
>  gcc/flag-types.h |  11 +
>  gcc/params.opt   | 967
> +++
>  3 files changed, 979 insertions(+), 1 deletion(-)
>  create mode 100644 gcc/params.opt

Is your params.def -> params.opt script available somewhere?  (sorry if
I missed it, I didn't see it looking over the patch kit)

(I'm rebasing my static analyzer patch kit and am about to convert my
params.def additions to be params.opt additions, though I'm only adding
4 params, so hopefully doing it by hand will be trivial)

Thanks
Dave




[PATCH 2/7] Include new generated gcc/params.opt file.

2019-11-07 Thread Martin Liska

gcc/ChangeLog:

2019-11-06  Martin Liska  

* Makefile.in: Include params.opt.
* flag-types.h (enum parloops_schedule_type): Add
parloops_schedule_type used in params.opt.
* params.opt: New file.
---
 gcc/Makefile.in  |   2 +-
 gcc/flag-types.h |  11 +
 gcc/params.opt   | 967 +++
 3 files changed, 979 insertions(+), 1 deletion(-)
 create mode 100644 gcc/params.opt

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 95f054c4d4f..ed47a346689 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -567,7 +567,7 @@ xm_include_list=@xm_include_list@
 xm_defines=@xm_defines@
 lang_checks=
 lang_checks_parallelized=
-lang_opt_files=@lang_opt_files@ $(srcdir)/c-family/c.opt $(srcdir)/common.opt
+lang_opt_files=@lang_opt_files@ $(srcdir)/c-family/c.opt $(srcdir)/common.opt $(srcdir)/params.opt
 lang_specs_files=@lang_specs_files@
 lang_tree_files=@lang_tree_files@
 target_cpu_default=@target_cpu_default@
diff --git a/gcc/flag-types.h b/gcc/flag-types.h
index b23d3a271f1..0c23aadefed 100644
--- a/gcc/flag-types.h
+++ b/gcc/flag-types.h
@@ -370,4 +370,15 @@ enum cf_protection_level
   CF_FULL = CF_BRANCH | CF_RETURN,
   CF_SET = 1 << 2
 };
+
+/* Parloops schedule type.  */
+enum parloops_schedule_type
+{
+  PARLOOPS_SCHEDULE_STATIC = 0,
+  PARLOOPS_SCHEDULE_DYNAMIC,
+  PARLOOPS_SCHEDULE_GUIDED,
+  PARLOOPS_SCHEDULE_AUTO,
+  PARLOOPS_SCHEDULE_RUNTIME
+};
+
 #endif /* ! GCC_FLAG_TYPES_H */
diff --git a/gcc/params.opt b/gcc/params.opt
new file mode 100644
index 000..7f2f8610c40
--- /dev/null
+++ b/gcc/params.opt
@@ -0,0 +1,967 @@
+; Parameter options of the compiler.
+
+; Copyright (C) 2019 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3.  If not see
+; .
+
+; See the GCC internals manual (options.texi) for a description of this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+-param=align-loop-iterations=
+Common Joined UInteger Var(param_align_loop_iterations) Optimization Init(4) Param
+Loops iterating at least selected number of iterations will get loop alignment.
+
+-param=align-threshold=
+Common Joined UInteger Var(param_align_threshold) Optimization Init(100) IntegerRange(1, 65536) Param
+Select fraction of the maximal frequency of executions of basic block in function given basic block get alignment.
+
+-param=asan-globals=
+Common Joined UInteger Var(param_asan_globals) Init(1) IntegerRange(0, 1) Param
+Enable asan globals protection.
+
+-param=asan-instrument-allocas=
+Common Joined UInteger Var(param_asan_protect_allocas) Init(1) IntegerRange(0, 1) Param
+Enable asan allocas/VLAs protection.
+
+-param=asan-instrument-reads=
+Common Joined UInteger Var(param_asan_instrument_reads) Init(1) IntegerRange(0, 1) Param
+Enable asan load operations protection.
+
+-param=asan-instrument-writes=
+Common Joined UInteger Var(param_asan_instrument_writes) Init(1) IntegerRange(0, 1) Param
+Enable asan store operations protection.
+
+-param=asan-instrumentation-with-call-threshold=
+Common Joined UInteger Var(param_asan_instrumentation_with_call_threshold) Optimization Init(7000) Param
+Use callbacks instead of inline code if number of accesses in function becomes greater or equal to this number.
+
+-param=asan-memintrin=
+Common Joined UInteger Var(param_asan_memintrin) Init(1) IntegerRange(0, 1) Param
+Enable asan builtin functions protection.
+
+-param=asan-stack=
+Common Joined UInteger Var(param_asan_stack) Init(1) IntegerRange(0, 1) Param
+Enable asan stack protection.
+
+-param=asan-use-after-return=
+Common Joined UInteger Var(param_asan_use_after_return) Init(1) IntegerRange(0, 1) Param
+Enable asan detection of use-after-return bugs.
+
+-param=avg-loop-niter=
+Common Joined UInteger Var(param_avg_loop_niter) Optimization Init(10) IntegerRange(1, 65536) Param
+Average number of iterations of a loop.
+
+-param=avoid-fma-max-bits=
+Common Joined UInteger Var(param_avoid_fma_max_bits) Optimization IntegerRange(0, 512) Param
+Maximum number of bits for which we avoid creating FMAs.
+
+-param=builtin-expect-probability=
+Common Joined UInteger Var(param_builtin_expect_probability) Optimization Init(90) IntegerRange(0, 100) Param
+Set the estimated probability in percentage for builtin expect. The default value is 90% probability.
+
+-param=builtin-string-cmp-inline-length=
+Common Joined