On 09/23/2015 02:14 PM, Nathan Sidwell wrote:
On 09/23/15 06:59, Bernd Schmidt wrote:
On 09/22/2015 05:16 PM, Nathan Sidwell wrote:
+ if (gimple_call_builtin_p (call, BUILT_IN_ACC_ON_DEVICE))
+ /* acc_on_device must be evaluated at compile time for
+ constant arguments. */
+ {
+ oacc_xform_on_device (call);
+ rescan = true;
+ }
Is there a reason this is not done as part of pass_fold_builtins? (It
looks like
maybe adding this to fold_call_stmt in builtins.c would be sufficient
too).
Perhaps it could be. I'll need to check where that pass happens.
Anyway, the main thrust of this patch is the new pass, which I thought
might be easier to review with minimal additional clutter.
There's no issue adding a new pass if there's a demonstrated need for
it, but I think builtin folding doesn't quite meet that criterion given
that we already have a pass that does that. Unless you really need it to
happen very early in the pipeline - fold_builtins runs pretty late, but
I checked and fold_call_stmt gets called from pass_forwprop and possibly
from elsewhere too.
Bernd