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: Include gomp-constant

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: Include gomp-constants.h. > (gimple_fold_builtin_acc_on_dev

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

Re: Fold acc_on_device

2015-10-01 Thread Nathan Sidwell
On 10/01/15 08:46, Richard Biener wrote: On Thu, Oct 1, 2015 at 2:33 PM, Nathan Sidwell wrote: use TREE_TYPE (arg0) for the integer cst. Otherwise looks good to me. thanks, fixed up and applied (also noticed a copy & paste malfunction setting the location) nathan 2015-10-01 Nathan Sidw

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
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 = gimple_build_assign (res, EQ_EXPR, arg0,

Re: Fold acc_on_device

2015-10-01 Thread Richard Biener
On Wed, Sep 30, 2015 at 9:22 PM, Jakub Jelinek wrote: > On Wed, Sep 30, 2015 at 03:01:22PM -0400, Nathan Sidwell wrote: >> 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

Re: Fold acc_on_device

2015-09-30 Thread Jakub Jelinek
On Wed, Sep 30, 2015 at 03:01:22PM -0400, Nathan Sidwell wrote: > 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 > >

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 fold acc_on_device

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