[flang-commits] [flang] [flang][acc] Implement cache directive lowering (PR #174897)

Razvan Lupusoru via flang-commits flang-commits at lists.llvm.org
Fri Jan 9 09:55:21 PST 2026


================
@@ -3506,7 +3506,14 @@ class FirConverter : public Fortran::lower::AbstractConverter {
 
   void genFIR(const Fortran::parser::OpenACCConstruct &acc) {
     mlir::OpBuilder::InsertPoint insertPt = builder->saveInsertionPoint();
-    localSymbols.pushScope();
+
+    // Cache constructs should not push/pop a scope because they need to update
+    // the symbol map for subsequent statements in the same loop body.
----------------
razvanlupusoru wrote:

> I believe it's better to have a semantic check that raises an explicit error for now.

I assume you are referring to the "if" case - I support that. And thank you again Jean for your very nice examples! :)

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


More information about the flang-commits mailing list