[PATCH, PR82391] Fold acc_on_device with const arg

2017-12-26 Thread Tom de Vries
reg-tested on x86_64. Build and reg-tested for x86_64 with nvptx accelerator. OK for trunk? Thanks, - Tom Fold acc_on_device with const arg 2017-12-22 Tom de Vries <t...@codesourcery.com> PR libgomp/82391 * omp-offload.c (fold_builtin_acc_on_device_cst_arg) (o

Re: Fold acc_on_device

2015-10-06 Thread Segher Boessenkool
On Thu, Oct 01, 2015 at 08:33:07AM -0400, Nathan Sidwell wrote: > 2015-10-01 Nathan Sidwell <nat...@codesourcery.com> > > * builtins.c: Don't include gomp-constants.h. > (fold_builtin_1): Don't fold acc_on_device here. > * gimple-fold.c: Inc

Re: Fold acc_on_device

2015-10-06 Thread Nathan Sidwell
On 10/06/15 02:12, Segher Boessenkool wrote: On Thu, Oct 01, 2015 at 08:33:07AM -0400, Nathan Sidwell wrote: 2015-10-01 Nathan Sidwell <nat...@codesourcery.com> * builtins.c: Don't include gomp-constants.h. (fold_builtin_1): Don't fold acc_on_device here. *

Re: Fold acc_on_device

2015-10-01 Thread Richard Biener
On Thu, Oct 1, 2015 at 2:33 PM, Nathan Sidwell wrote: > On 10/01/15 06:03, Richard Biener wrote: >> >> On Wed, Sep 30, 2015 at 9:22 PM, Jakub Jelinek wrote: > > >>> Wouldn't it be better to just emit GIMPLE here instead? >>> So >>>tree res = make_ssa_name

Re: Fold acc_on_device

2015-10-01 Thread Nathan Sidwell
, arg0, build_int_cst (integer_type_node, val_host)); gsi_insert_before (gsi, g); ... Like this? nathan 2015-10-01 Nathan Sidwell <nat...@codesourcery.com> * builtins.c: Don't include gomp-constants.h. (fold_builtin_1): Don't fold acc_on_device here. * gimple-fol

Re: Fold acc_on_device

2015-10-01 Thread Nathan Sidwell
athan 2015-10-01 Nathan Sidwell <nat...@codesourcery.com> * builtins.c: Don't include gomp-constants.h. (fold_builtin_1): Don't fold acc_on_device here. * gimple-fold.c: Include gomp-constants.h. (gimple_fold_builtin_acc_on_device): New. (gimple_fold_builtin): Call it. Index: g

[gomp4] gimple fold acc_on_device

2015-10-01 Thread Nathan Sidwell
I've applied this version of the acc_on_device folding to gomp4. See https://gcc.gnu.org/ml/gcc-patches/2015-10/msg00074.html for the trunk discussion. nathan 2015-10-01 Nathan Sidwell <nat...@codesourcery.com> * builtins.c: Don't include gomp-constants.h. (fold_builtin_1): Don'

Re: Fold acc_on_device

2015-10-01 Thread Andrew MacLeod
On 09/30/2015 08:46 AM, Richard Biener wrote: On Wed, Sep 30, 2015 at 2:18 PM, Nathan Sidwell wrote: Please don't add any new GENERIC based builtin folders. Instead add to gimple-fold.c:gimple_fold_builtin Otherwise you're just generating more work for us who move foldings

Re: Fold acc_on_device

2015-10-01 Thread Nathan Sidwell
On 10/01/15 13:00, Andrew MacLeod wrote: btw, not that it's necessarily important, but I'm about to submit the include reduction patches today, and it turns out this line is the first use of anything from cgraph.h in builtins.c. So if this is "the way" of doing the test, be aware it adds a

Re: Fold acc_on_device

2015-10-01 Thread Andrew MacLeod
On 10/01/2015 01:11 PM, Nathan Sidwell wrote: On 10/01/15 13:00, Andrew MacLeod wrote: btw, not that it's necessarily important, but I'm about to submit the include reduction patches today, and it turns out this line is the first use of anything from cgraph.h in builtins.c. So if this is

Re: Fold acc_on_device

2015-10-01 Thread Richard Biener
olders. Instead add to >> >>>gimple-fold.c:gimple_fold_builtin >> >> Is this patch ok? >> >> nathan > >> 2015-09-30 Nathan Sidwell <nat...@codesourcery.com> >> >> * builtins.c: Don't include gomp-constants.h. >&g

Re: Fold acc_on_device

2015-09-30 Thread Jakub Jelinek
nathan > 2015-09-30 Nathan Sidwell <nat...@codesourcery.com> > > * builtins.c: Don't include gomp-constants.h. > (fold_builtin_1): Don't fold acc_on_device here. > * gimple-fold.c: Include gomp-constants.h. > (gimple_fold_builtin_acc_on_device): New.

Re: Fold acc_on_device

2015-09-30 Thread Nathan Sidwell
ltin_1): Don't fold acc_on_device here. * gimple-fold.c: Include gomp-constants.h. (gimple_fold_builtin_acc_on_device): New. (gimple_fold_builtin): Call it. Index: gimple-fold.c === --- gimple-fold.c (revision 228288) +++ gimple-

Re: Fold acc_on_device

2015-09-30 Thread Richard Biener
On Tue, Sep 29, 2015 at 8:21 PM, Nathan Sidwell wrote: > This patch folds acc_on_device as a regular builtin, but postponed until we > know which compiler we're in. As suggested by Bernd, we use the existing > builtin folding machinery. > > Trunk is still using the older PTX

Re: Fold acc_on_device

2015-09-30 Thread Richard Biener
On Wed, Sep 30, 2015 at 2:18 PM, Nathan Sidwell wrote: > On 09/30/15 04:07, Richard Biener wrote: >> >> On Tue, Sep 29, 2015 at 8:21 PM, Nathan Sidwell wrote: >>> >>> This patch folds acc_on_device as a regular builtin, but postponed until >>> we >>> know which

Re: Fold acc_on_device

2015-09-30 Thread Nathan Sidwell
On 09/30/15 04:07, Richard Biener wrote: On Tue, Sep 29, 2015 at 8:21 PM, Nathan Sidwell wrote: This patch folds acc_on_device as a regular builtin, but postponed until we know which compiler we're in. As suggested by Bernd, we use the existing builtin folding machinery.

Re: Fold acc_on_device

2015-09-30 Thread Bernd Schmidt
On 09/30/2015 02:18 PM, Nathan Sidwell wrote: On 09/30/15 04:07, Richard Biener wrote: Please don't add any new GENERIC based builtin folders. Instead add to gimple-fold.c:gimple_fold_builtin Otherwise you're just generating more work for us who move foldings from builtins.c to gimple-fold.c.

Re: Fold acc_on_device

2015-09-30 Thread Nathan Sidwell
On 09/30/15 08:46, Richard Biener wrote: I'll add a comment to builtins.c (not that I expect anyone sees it ;)) Put one instance at the default: label in expand_builtin? nathan

[gomp4] fold acc_on_device

2015-09-29 Thread Nathan Sidwell
t call it. (fold_builtin_1): Fold acc_on_device. libgomp/ * oacc-init.c (acc_on_device): Compile with optimization. * config/nvptx/oacc-init.c (acc_on_device): Compile with optimization. Index: gcc/omp-low.c === --- gcc/omp-low.c (re

Fold acc_on_device

2015-09-29 Thread Nathan Sidwell
there is in the host-side libgomp piece. Ok for trunk? nathan 2015-09-29 Nathan Sidwell <nat...@codesourcery.com> gcc/ * builtins.c (expand_builtin_acc_on_device): Delete. (expand_builtin): Don't call it. (fold_builtin_1): Fold acc_on_device. libgomp/ * oacc-init.c (acc_on_device): Force optimi

Re: Fold acc_on_device

2015-09-29 Thread Bernd Schmidt
On 09/29/2015 08:21 PM, Nathan Sidwell wrote: This patch folds acc_on_device as a regular builtin, but postponed until we know which compiler we're in. As suggested by Bernd, we use the existing builtin folding machinery. Trunk is still using the older PTX runtime scheme (Thomas is working on

Re: Fold acc_on_device

2015-09-29 Thread Nathan Sidwell
On 09/29/15 15:52, Bernd Schmidt wrote: Ok, although I really don't quite see the need to drop the expander. Unnecessary code duplication. It's better to say something once in one place, than try and say it twice in two different places. nathan