[flang-commits] [flang] [flang][OpenMP][Lower] lower array subscripts for task depend (PR #132994)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Thu Mar 27 10:04:56 PDT 2025


================
@@ -2428,7 +2430,8 @@ genTaskOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
           ConstructQueue::const_iterator item) {
   lower::StatementContext stmtCtx;
----------------
tblah wrote:

While working on the next patch in this series I've noticed that this `stmtCtx` seems not to be scoped correctly. If any cleanup code is added to it, it will emit that cleanup code when it is destroyed. Unfortunately, when this goes out of scope at the end of `genTaskOp` the builder insertion point is inside of the task operation. It would make more sense to do the cleanup after the end of the task operation to avoid adding unnecessary shared variables (this might be only a theoretical bug because I haven't yet found an example where any cleanup code is still present by the time we reach FIR.)

https://github.com/llvm/llvm-project/pull/132994


More information about the flang-commits mailing list