r357717 - [OPENMP]Add codegen for task reduction vars with allocate clause, NFC.

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 4 11:58:17 PDT 2019


Author: abataev
Date: Thu Apr  4 11:58:17 2019
New Revision: 357717

URL: http://llvm.org/viewvc/llvm-project?rev=357717&view=rev
Log:
[OPENMP]Add codegen for task reduction vars with allocate clause, NFC.

Added test for the task reduction variables with the allocate clause.

Modified:
    cfe/trunk/test/OpenMP/task_in_reduction_codegen.cpp
    cfe/trunk/test/OpenMP/taskgroup_task_reduction_codegen.cpp

Modified: cfe/trunk/test/OpenMP/task_in_reduction_codegen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/task_in_reduction_codegen.cpp?rev=357717&r1=357716&r2=357717&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/task_in_reduction_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/task_in_reduction_codegen.cpp Thu Apr  4 11:58:17 2019
@@ -10,6 +10,16 @@
 #ifndef HEADER
 #define HEADER
 
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
 // CHECK: [[PRIVATES:%.+]] = type { i8*, i8* }
 
 struct S {
@@ -31,7 +41,7 @@ int main(int argc, char **argv) {
   {
 #pragma omp taskgroup task_reduction(-:c, d)
 #pragma omp parallel
-#pragma omp task in_reduction(+:a) in_reduction(-:d)
+#pragma omp task in_reduction(+:a) in_reduction(-:d) allocate(omp_high_bw_mem_alloc: d)
     a += d[a];
   }
   return 0;

Modified: cfe/trunk/test/OpenMP/taskgroup_task_reduction_codegen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskgroup_task_reduction_codegen.cpp?rev=357717&r1=357716&r2=357717&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskgroup_task_reduction_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/taskgroup_task_reduction_codegen.cpp Thu Apr  4 11:58:17 2019
@@ -12,6 +12,16 @@
 #ifndef HEADER
 #define HEADER
 
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
 // CHECK-DAG: @reduction_size.[[ID:.+]]_[[CID:[0-9]+]].artificial.
 // CHECK-DAG: @reduction_size.[[ID]]_[[CID]].artificial..cache.
 
@@ -29,7 +39,7 @@ int main(int argc, char **argv) {
   float b;
   S c[5];
   short d[argc];
-#pragma omp taskgroup task_reduction(+: a, b, argc)
+#pragma omp taskgroup allocate(omp_pteam_mem_alloc: a) task_reduction(+: a, b, argc)
   {
 #pragma omp taskgroup task_reduction(-:c, d)
     ;




More information about the cfe-commits mailing list