Skip to content
Commit d38788b3 authored by Shilei Tian's avatar Shilei Tian
Browse files

[Clang][OpenMP] Avoid unnecessary privatization of mapper array when there is...

[Clang][OpenMP] Avoid unnecessary privatization of mapper array when there is no user defined mapper

In current implementation, if it requires an outer task, the mapper array will be privatized no matter whether it has mapper. In fact, when there is no mapper, the mapper array only contains number of nullptr. In the libomptarget, the use of mapper array is `if (mappers_array && mappers_array[i])`, which means we can directly set mapper array to nullptr if there is no mapper. This can avoid unnecessary data copy.

In this patch, the data privatization will not be emitted if the mapper array is nullptr. When it comes to the emit of task body, the nullptr will be used directly.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D90101
parent c4ef3115
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment