[flang-commits] [flang] [flang] Implement !DIR$ IVDEP directive (PR #133728)

Jean-Didier PAILLEUX via flang-commits flang-commits at lists.llvm.org
Wed Apr 2 06:21:14 PDT 2025


================
@@ -148,13 +148,17 @@ class AssignOpConversion : public mlir::OpRewritePattern<hlfir::AssignOp> {
           !assignOp.isTemporaryLHS() &&
           mlir::isa<fir::RecordType>(fir::getElementTypeOf(lhsExv));
 
+      std::optional<mlir::ArrayAttr> accessGroups = nullptr;
+      if (auto attrs = assignOp.getOperation()->getAttrOfType<mlir::ArrayAttr>(
+              "access_groups"))
+        accessGroups = attrs;
       // genScalarAssignment() must take care of potential overlap
       // between LHS and RHS. Note that the overlap is possible
       // also for components of LHS/RHS, and the Assign() runtime
       // must take care of it.
-      fir::factory::genScalarAssignment(builder, loc, lhsExv, rhsExv,
-                                        needFinalization,
-                                        assignOp.isTemporaryLHS());
+      fir::factory::genScalarAssignment(
+          builder, loc, lhsExv, rhsExv, needFinalization,
+          assignOp.isTemporaryLHS(), accessGroups);
     }
----------------
JDPailleux wrote:

I don't think so. The `access group` applies on `loads` and `stores` from assignments in a loop. But I'll make a new pass on it and add tests in that case if needed.

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


More information about the flang-commits mailing list