[Mlir-commits] [flang] [mlir] [flang][OpenMP] Support for "omp assumes no_openmp". (PR #233252)

Krzysztof Parzyszek llvmlistbot at llvm.org
Thu Oct 22 15:30:15 PDT 2026


================
@@ -6507,6 +6509,28 @@ class FirConverter : public Fortran::lower::AbstractConverter {
     builder->setFPMaxminBehavior(
         bridge.getLoweringOptions().getFPMaxminBehavior());
     builder->setInsertionPointToStart(&func.front());
+    const auto &langOptions = bridge.getSemanticsContext().langOptions();
+    const auto *assumptionScopeEnd =
+        langOptions.getOpenMPVersion() >= 60
+            ? &Fortran::semantics::omp::GetProgramUnit(scope).parent()
+            : nullptr;
+    for (const auto *assumptionScope = &scope;
+         !langOptions.OpenMPSimd && !assumptionScope->IsGlobal() &&
+         assumptionScope != assumptionScopeEnd;
+         assumptionScope = &assumptionScope->parent()) {
+      const auto *symbol = assumptionScope->symbol();
----------------
kparzysz wrote:

`symbol` is not used outside of the `if`, you can declare it inside the `if` statement.

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


More information about the Mlir-commits mailing list