[flang-commits] [flang] [flang][OpenACC] Support COLLAPSE on DO CONCURRENT (PR #203085)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Thu Jun 11 22:02:05 PDT 2026


================
@@ -3689,11 +3689,15 @@ class FirConverter : public Fortran::lower::AbstractConverter {
 
       if (curEval->lowerAsStructured()) {
         curEval = &curEval->getFirstNestedEvaluation();
-        for (uint64_t i = 1; i < loopCount; i++) {
-          if (!curEval->hasNestedEvaluations())
-            break;
-          curEval = &*std::next(curEval->getNestedEvaluations().begin());
-        }
+        // A DO CONCURRENT holds all controls in one construct; the per-level
----------------
ergawy wrote:

Not specifically related to the PR, but I find walking down to `curEval` this way a bit fragile and I think it tightly couples the internals `genOpenACCConstruct` to this function.

Would it be possible to move the responsibility of determining `curEval` to `genOpenACCConstruct` since this is where we determine which evaluations are actually to be absorbed in a particular OpenACC construct?

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


More information about the flang-commits mailing list