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

            Bug ID: 90591
           Summary: Avoid unnecessary data transfer out of OMP construct
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: openacc, openmp
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

The reverse side of PR90573.  For (all too common!) code like:

    int i;
    #pragma acc kernels // implicit 'copy(i)', or 'copyout(i)' with PR90573
      {
        for (i = 0; i < N; ++i)
          [...]
      }
    #pragma acc kernels // implicit 'copy(i)', or 'copyout(i)' with PR90573
      {
        for (i = N - 1; i >= 0; --i)
          [...]
      }
    ['i' never read here]

In addition that we can avoid unnecessary data transfer into each OMP construct
(PR90573), we also don't need to copy 'i' out in such scenarios, so can
optimize 'copy' to 'copyin', or 'copyout' to 'create'.

Reply via email to