This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP50]Codegen for uses_allocators clause.
ClosedPublic

Authored by ABataev on May 1 2020, 12:34 PM.

Details

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);

Diff Detail

Event Timeline

ABataev created this revision.May 1 2020, 12:34 PM
jdoerfert accepted this revision.May 14 2020, 10:25 AM

LGTM. FWIW, we should directly add new runtime functions we emit into OMPKinds.def. That saves us the trouble of searching for the ones we missed later.

This revision is now accepted and ready to land.May 14 2020, 10:25 AM
This revision was automatically updated to reflect the committed changes.