[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 11:28:13 PDT 2022


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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131272/new/

https://reviews.llvm.org/D131272



More information about the cfe-commits mailing list