https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94684

            Bug ID: 94684
           Summary: OpenACC 'async' clause optimizations
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: openacc
          Severity: enhancement
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
  Target Milestone: ---

In 'gcc/omp-expand.c:expand_omp_target', we have an optimization that for an
OpenACC 'async' clause, we try to "pack the async arg in to the tag's operand"
('i_async' handling).

(... which doesn't seem to have any dedicated testsuite coverage.)

That currently only works for 'INTEGER_CST' literals, but not for 'const int
async = 1', for example.  Could it, or is 'expand_omp_target' too early for
such things?

Due to only accepting positive values, this doesn't work for the very common
case of 'async' clause without argument, that is: 'async(acc_async_noval)',
that is: 'async(-1)'.

And, couldn't we also optimize the (unusual) case of 'async(acc_async_sync)',
that is: 'async(-2)' by removing the 'async' clause altogether?

Reply via email to