[PATCH] D70258: [OpenMP][IR-Builder] Introduce the finalization stack
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 14 11:02:03 PST 2019
jdoerfert created this revision.
jdoerfert added reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim.
Herald added subscribers: cfe-commits, guansong, bollu, hiraditya.
Herald added projects: clang, LLVM.
As a permanent and generic solution to the problem of variable
finalization (destructors, lastprivate, ...), this patch introduces the
finalization stack. The objects on the stack describe (1) the
(structured) regions the OpenMP-IR-Builder is currently constructing,
(2) if these are cancellable, and (3) the callback that will perform the
finalization (=cleanup) when necessary.
As the finalization can be necessary multiple times, at different source
locations, the callback takes the position at which code is currently
generated. This position will also encode the destination of the "region
exit" block *iff* the finalization call was issues for a region
generated by the OpenMPIRBuilder. For regions generated through the old
Clang OpenMP code geneneration, the "region exit" is determined by Clang
inside the finalization call instead (see getOMPCancelDestination).
As a first user, the parallel + cancel barrier interaction is changed.
In contrast to the temporary solution before, the barrier generation in
Clang does not need to be aware of the "CancelDestination" block.
Instead, the finalization callback is and, as described above, later
even that one does not need to be.
D70109 <https://reviews.llvm.org/D70109> will be updated to use this scheme.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D70258
Files:
clang/lib/CodeGen/CGOpenMPRuntime.cpp
llvm/include/llvm/Frontend/OpenMPIRBuilder.h
llvm/lib/Frontend/OpenMPIRBuilder.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70258.229359.patch
Type: text/x-patch
Size: 8601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191114/ca698532/attachment.bin>
More information about the llvm-commits
mailing list