[Libomptarget] Add unroll flag to shared variables loop

Unrolling this loop provides better performance in practice because it is
executed on the device and is likely to be very small.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D106692
This commit is contained in:
Joseph Huber 2021-07-23 14:50:25 -04:00 committed by Huber, Joseph
parent d71fc323f9
commit e1dedecaa6
1 changed files with 1 additions and 0 deletions

View File

@ -314,6 +314,7 @@ EXTERN void __kmpc_parallel_51(kmp_Ident *ident, kmp_int32 global_tid,
void **GlobalArgs;
__kmpc_begin_sharing_variables(&GlobalArgs, nargs);
// TODO: faster memcpy?
#pragma unroll
for (int I = 0; I < nargs; I++)
GlobalArgs[I] = args[I];
}