[PATCH, PR82391] Fold acc_on_device with const arg

2017-12-26 Thread Tom de Vries
ice onto the builtin function. Bootstrapped and 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 PR libgomp/82391 * omp-offload.c (fold_builtin_acc_on_device_cst_arg

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 * builtins.c: Don't include gomp-constants.h. (fold_builtin_1): Don't fold acc_on_device here. * gimple-fold.c: In

Re: Fold acc_on_device

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

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 "th

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 dep

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 from builtins.c to

[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 * builtins.c: Don't include gomp-constants.h. (fold_builtin_1): Don't fold acc

Re: Fold acc_on_device

2015-10-01 Thread Nathan Sidwell
than Sidwell * 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: gcc

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 (boolean_type_node); >>>gimple g

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 * builtins.c: Don't include gomp-constants.h. (fold_builtin_1): Don't fold acc_on_device here. * gimple-fold.c: Include g

Re: Fold acc_on_device

2015-10-01 Thread Richard Biener
>>gimple-fold.c:gimple_fold_builtin >> >> Is this patch ok? >> >> nathan > >> 2015-09-30 Nathan Sidwell >> >> * builtins.c: Don't include gomp-constants.h. >> (fold_builtin_1): Don't fold acc_on_dev

Re: Fold acc_on_device

2015-09-30 Thread Jakub Jelinek
> > nathan > 2015-09-30 Nathan Sidwell > > * 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_devi

Re: Fold acc_on_device

2015-09-30 Thread Nathan Sidwell
On 09/30/15 08:46, Richard Biener wrote: Please don't add any new GENERIC based builtin folders. Instead add to gimple-fold.c:gimple_fold_builtin Is this patch ok? nathan 2015-09-30 Nathan Sidwell * builtins.c: Don't include gomp-constants.h. (fold_builtin_1): Don't fol

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

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 compiler we're in. As suggested by

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 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. Trunk is still using

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 runtime scheme (Thom

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

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

Fold acc_on_device

2015-09-29 Thread Nathan Sidwell
n the host-side libgomp piece. Ok for trunk? nathan 2015-09-29 Nathan Sidwell 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 optimization level. Inde

[gomp4] fold acc_on_device

2015-09-29 Thread Nathan Sidwell
than 2015-09-29 Nathan Sidwell gcc/ * omp-low.c (oacc_xform_on_device): Delete. (oacc_xform_dim): Return bool. (execute_oacc_transform): Don't handle acc_on_device here. Adjust rescan logic. * builtins.c (expand_builtin_acc_on_device): Delete. (expand_builtin): Do not call it. (f