[all-commits] [llvm/llvm-project] 0363ae: [OPENMP50]Codegen for uses_allocators clause.

Alexey Bataev via All-commits all-commits at lists.llvm.org
Thu May 14 15:09:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0363ae97abb841114e841a963c95eb6a2202716d
      https://github.com/llvm/llvm-project/commit/0363ae97abb841114e841a963c95eb6a2202716d
  Author: Alexey Bataev <a.bataev at hotmail.com>
  Date:   2020-05-14 (Thu, 14 May 2020)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntime.cpp
    M clang/lib/CodeGen/CGOpenMPRuntime.h
    M clang/lib/Sema/SemaOpenMP.cpp
    A clang/test/OpenMP/target_parallel_for_simd_uses_allocators_codegen.cpp
    A clang/test/OpenMP/target_parallel_for_uses_allocators_codegen.cpp
    A clang/test/OpenMP/target_parallel_uses_allocators_codegen.cpp
    A clang/test/OpenMP/target_simd_uses_allocators_codegen.cpp
    A clang/test/OpenMP/target_teams_distribute_parallel_for_simd_uses_allocators_codegen.cpp
    A clang/test/OpenMP/target_teams_distribute_parallel_for_uses_allocators_codegen.cpp
    A clang/test/OpenMP/target_teams_distribute_simd_uses_allocators_codegen.cpp
    A clang/test/OpenMP/target_teams_distribute_uses_allocators_codegen.cpp
    A clang/test/OpenMP/target_teams_uses_allocators_codegen.cpp
    A clang/test/OpenMP/target_uses_allocators_codegen.cpp

  Log Message:
  -----------
  [OPENMP50]Codegen for uses_allocators clause.

Summary:
Predefined allocators should not be mapped at all (they are just enumeric
constants). FOr user-defined allocators need to map the traits only as
firstprivates, the allocator itself is private.
At the beginning of the target region the user-defined allocatores must
be created and then destroyed at the end of the target region:
```
omp_allocator_handle_t my_allocator = __kmpc_init_allocator(<gtid>,
/*default memhandle*/ 0, <number_of_traits>, &<traits>);
...
call void @__kmpc_destroy_allocator(<gtid>, my_allocator);
```

Reviewers: jdoerfert, aaron.ballman

Subscribers: jholewinski, yaxunl, guansong, cfe-commits, caomhin

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79257




More information about the All-commits mailing list