case OMP_LIST_IS_DEVICE_PTR: type = "IS_DEVICE_PTR"; break;
case OMP_LIST_USE_DEVICE_PTR: type = "USE_DEVICE_PTR"; break;
case OMP_LIST_USE_DEVICE_ADDR: type = "USE_DEVICE_ADDR"; break;
+ case OMP_LIST_NONTEMPORAL: type = "NONTEMPORAL"; break;
default:
gcc_unreachable ();
}
OMP_LIST_IS_DEVICE_PTR,
OMP_LIST_USE_DEVICE_PTR,
OMP_LIST_USE_DEVICE_ADDR,
+ OMP_LIST_NONTEMPORAL,
OMP_LIST_NUM
};
OMP_CLAUSE_IS_DEVICE_PTR,
OMP_CLAUSE_LINK,
OMP_CLAUSE_NOGROUP,
+ OMP_CLAUSE_NOTEMPORAL,
OMP_CLAUSE_NUM_TASKS,
OMP_CLAUSE_PRIORITY,
OMP_CLAUSE_SIMD,
c->nogroup = needs_space = true;
continue;
}
+ if ((mask & OMP_CLAUSE_NOTEMPORAL)
+ && gfc_match_omp_variable_list ("nontemporal (",
+ &c->lists[OMP_LIST_NONTEMPORAL],
+ true) == MATCH_YES)
+ continue;
if ((mask & OMP_CLAUSE_NOTINBRANCH)
&& !c->notinbranch
&& !c->inbranch
(omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_LASTPRIVATE \
| OMP_CLAUSE_REDUCTION | OMP_CLAUSE_COLLAPSE | OMP_CLAUSE_SAFELEN \
| OMP_CLAUSE_LINEAR | OMP_CLAUSE_ALIGNED | OMP_CLAUSE_SIMDLEN \
- | OMP_CLAUSE_IF | OMP_CLAUSE_ORDER)
+ | OMP_CLAUSE_IF | OMP_CLAUSE_ORDER | OMP_CLAUSE_NOTEMPORAL)
#define OMP_TASK_CLAUSES \
(omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_FIRSTPRIVATE \
| OMP_CLAUSE_SHARED | OMP_CLAUSE_IF | OMP_CLAUSE_DEFAULT \
case OMP_LIST_IS_DEVICE_PTR:
clause_code = OMP_CLAUSE_IS_DEVICE_PTR;
goto add_clause;
+ case OMP_LIST_NONTEMPORAL:
+ clause_code = OMP_CLAUSE_NONTEMPORAL;
+ goto add_clause;
add_clause:
omp_clauses
--- /dev/null
+! { dg-do compile }
+! { dg-additional-options "-O2 -fdump-tree-original" }
+
+module m
+ integer :: a(:), b(1024), c(1024), d(1024)
+ allocatable :: a
+end module m
+
+subroutine foo
+ use m
+ implicit none
+ integer :: i
+ !$omp simd nontemporal (a, b)
+ do i = 1, 1024
+ a(i) = b(i) + c(i)
+ end do
+
+ !$omp simd nontemporal (d)
+ do i = 1, 1024
+ d(i) = 2 * c(i)
+ end do
+end subroutine foo
+
+! { dg-final { scan-tree-dump-times "#pragma omp simd linear\\(i:1\\) nontemporal\\(a\\) nontemporal\\(b\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp simd linear\\(i:1\\) nontemporal\\(d\\)" 1 "original" } }
--- /dev/null
+! { dg-do compile }
+
+module m
+ integer, allocatable :: a(:), b(:), c(:), d(:)
+end module m
+
+subroutine foo
+ use m
+ implicit none
+ integer :: i
+
+ !$omp simd nontemporal (a, b) aligned (a, b, c)
+ do i = 1, ubound(a, dim=1)
+ a(i) = b(i) + c(i)
+ end do
+
+ !$omp simd nontemporal (d) nontemporal (d) ! { dg-error "'d' present on multiple clauses" }
+ do i = 1, ubound(d, dim=1)
+ d(i) = 2 * c(i)
+ end do
+
+ !$omp simd nontemporal (a, b, b) ! { dg-error "'b' present on multiple clauses" }
+ do i = 1, ubound(a, dim=1)
+ a(i) = a(i) + b(i) + c(i)
+ end do
+end subroutine foo