HomePhabricator

[Libomptarget] Improve device runtime implementation for globalized variables.

Authored by jhuber6 on Jun 18 2021, 12:48 PM.

Description

[Libomptarget] Improve device runtime implementation for globalized variables.

Currently the runtime implementation of __kmpc_alloc_shared is extremely slow because it allocated memory for each thread individually. This patch adds a small buffer for the threads to share data and will greatly improve performance for builds where all globalization could not be optimized out. If the shared buffer is full, then memory will not only be allocated per-warp rather than per-thread.

Depends on D97680

Reviewed By: jdoerfert

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