This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, 4/16] Implement -foffload-alias
- From: Richard Biener <rguenther at suse dot de>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 11 Nov 2015 11:51:02 +0100 (CET)
- Subject: Re: [PATCH, 4/16] Implement -foffload-alias
- Authentication-results: sourceware.org; auth=none
- References: <5640BD31 dot 2060602 at mentor dot com> <5640C560 dot 1000007 at mentor dot com>
On Mon, 9 Nov 2015, Tom de Vries wrote:
> On 09/11/15 16:35, Tom de Vries wrote:
> > Hi,
> >
> > this patch series for stage1 trunk adds support to:
> > - parallelize oacc kernels regions using parloops, and
> > - map the loops onto the oacc gang dimension.
> >
> > The patch series contains these patches:
> >
> > 1 Insert new exit block only when needed in
> > transform_to_exit_first_loop_alt
> > 2 Make create_parallel_loop return void
> > 3 Ignore reduction clause on kernels directive
> > 4 Implement -foffload-alias
> > 5 Add in_oacc_kernels_region in struct loop
> > 6 Add pass_oacc_kernels
> > 7 Add pass_dominator_oacc_kernels
> > 8 Add pass_ch_oacc_kernels
> > 9 Add pass_parallelize_loops_oacc_kernels
> > 10 Add pass_oacc_kernels pass group in passes.def
> > 11 Update testcases after adding kernels pass group
> > 12 Handle acc loop directive
> > 13 Add c-c++-common/goacc/kernels-*.c
> > 14 Add gfortran.dg/goacc/kernels-*.f95
> > 15 Add libgomp.oacc-c-c++-common/kernels-*.c
> > 16 Add libgomp.oacc-fortran/kernels-*.f95
> >
> > The first 9 patches are more or less independent, but patches 10-16 are
> > intended to be committed at the same time.
> >
> > Bootstrapped and reg-tested on x86_64.
> >
> > Build and reg-tested with nvidia accelerator, in combination with a
> > patch that enables accelerator testing (which is submitted at
> > https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01771.html ).
> >
> > I'll post the individual patches in reply to this message.
>
> this patch addresses the problem that once the offloading region has been
> split off from the original function, alias analysis can no longer use
> information available in the original function that would allow it to do a
> more precise analysis for the offloading function. [ At some point we could
> use fipa-pta for that, as discussed in PR46032, but that's not feasible now. ]
>
> The basic idea behind the patch is that for typical usage, the base pointers
> used in an offloaded region are non-aliasing. The patch works by adding
> restrict to the types of the fields used to pass data to an offloading region.
>
>
> The patch implements a new option
> -foffload-alias=<none|pointer|all>.
>
> The option -foffload-alias=none instructs the compiler to assume that
> object references and pointer dereferences in an offload region do not
> alias.
>
> The option -foffload-alias=pointer instructs the compiler to assume that
> objects references in an offload region do not alias.
>
> The option -foffload-alias=all instructs the compiler to make no
> assumptions about aliasing in offload regions.
>
> The default value is -foffload-alias=none.
I think global options for this is nonsense. Please follow what
we do for #pragma GCC ivdep for example, thus allow the alias
behavior to be specified per "region" (whatever makes sense here
in the context of offloading).
Thanks,
Richard.
> Thanks,
> - Tom
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)