[PATCH][PR67476] Add param parloops-schedule

Jakub Jelinek jakub@redhat.com
Mon Sep 14 09:23:00 GMT 2015


On Fri, Sep 11, 2015 at 03:28:01PM +0200, Tom de Vries wrote:
> On 11/09/15 12:57, Jakub Jelinek wrote:
> >On Fri, Sep 11, 2015 at 12:55:00PM +0200, Tom de Vries wrote:
> >>>Hi,
> >>>
> >>>this patch adds a param parloops-schedule=<0-4>, which sets the omp schedule
> >>>for loops paralellized by parloops.
> >>>
> >>>The <0-4> maps onto <static|dynamic|guided|auto|runtime>.
> >>>
> >>>Bootstrapped and reg-tested on x86_64.
> >>>
> >>>OK for trunk?
> >I don't really like it, the mapping of the integers to the enum values
> >is non-obvious and hard to remember.
> >Perhaps add support for enumeration params if you want this instead?
> >
> 
> This patch adds handling of a DEFPARAMENUM macro, which is similar to the
> DEFPARAM macro, but allows the values to be named.
> 
> So the definition of param parloop-schedule becomes:
> ...
> DEFPARAMENUM PARAM_PARLOOPS_SCHEDULE,
>              "parloops-schedule",
>              "Schedule type of omp schedule for loops parallelized by "
>              "parloops (static, dynamic, guided, auto, runtime)",
>              0, 0, 4, "static", "dynamic", "guided", "auto", "runtime")
> ...
> [ I'll repost the original patch containing this update. ]
> 
> OK for trunk if x86_64 bootstrap and reg-test succeeds?

That still allows numeric arguments for the param, which is IMHO
undesirable.  If it is enum kind, only the enum values should be accepted.
Also, it would be nice if params.h in that case would define an enum with
the values like
PARAM_PARLOOPS_SCHEDULE_KIND_{static,dynamic,guided,auto,runtime}, so use
values not wrapped in ""s and only in a macro or generator make both
enums and string array out of that.

There is also the question if we can use __VA_ARGS__, isn't that C99 or
C++11 and later feature?  I see gengtype.h and ipa-icf-gimple.h use
that too, so maybe yes, but am not sure.

	Jakub



More information about the Gcc-patches mailing list