[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.
authorAlexey Bataev <a.bataev@hotmail.com>
Wed, 12 Aug 2020 14:54:36 +0000 (10:54 -0400)
committerAlexey Bataev <a.bataev@hotmail.com>
Wed, 12 Aug 2020 15:28:19 +0000 (11:28 -0400)
commitf4f3f678f1994d47f745cbfd6a1026f2408425c6
treec50a880c2e5b3841e91c0fe72c42a8ba8a1d55cb
parent3c8a4ee0764cafb2ba204c7cb7d8b37e6adf72a8
[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.

In untied tasks, need to allocate the space for local variales, declared
in task region, when the memory for task data is allocated. THe function
can be interrupted and we can exit from the function in untied task
switch. Need to keep the state of the local variables in this case.
Also, the compiler should not call cleanup when exiting in untied task
switch until the real exit out of the declaration scope is met during
 execution.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D84457
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/lib/CodeGen/CGOpenMPRuntime.h
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/test/OpenMP/task_codegen.cpp