[PATCH] D131272: [Clang][OpenMP] Fix the issue that `llvm.lifetime.end` is emitted too early for variables captured in linear clause
Shilei Tian via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 5 21:35:39 PDT 2022
tianshilei1992 marked an inline comment as done.
tianshilei1992 added inline comments.
Comment at: clang/lib/CodeGen/CodeGenFunction.h:1070
void operator=(const OMPPrivateScope &) = delete;
+ bool MapRestored = false;
> ABataev wrote:
> > Better to make it a property of MappedVars. Also, are there any issues if just restore it several times without checking?
> > Better to make it a property of MappedVars.
> Will do.
> > Also, are there any issues if just restore it several times without checking?
> TBH, I don't know clearly, but I feel it should not be a problem. We will not have two scopes at the same time, will we? But I will add an assertion that if the mapped variables have been restored, `addPrivate` should not be called anymore.
We don't have to worry about restore for multiple times as every time it is called, the container is cleared.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits