[flang-commits] [flang] [flang][mlir] Add flang to mlir lowering for groupprivate (PR #180934)

via flang-commits flang-commits at lists.llvm.org
Tue Jun 9 00:11:51 PDT 2026


================
@@ -2181,6 +2181,34 @@ bool OmpAttributeVisitor::Pre(const parser::OmpGroupprivateDirective &x) {
       ResolveOmpObject(*object, Symbol::Flag::OmpGroupPrivate);
     }
   }
+
+  // OpenMP 6.0 allows an optional device_type clause on groupprivate. Record it
+  // on each listed object's ultimate symbol so lowering and .mod emission can
+  // read it. An absent clause means the spec default (any).
+  std::optional<common::OmpDeviceType> device;
+  if (auto *devClause{
+          parser::omp::FindClause(x.v, llvm::omp::Clause::OMPC_device_type)}) {
+    device = parser::UnwrapRef<common::OmpDeviceType>(*devClause);
+  }
+
+  if (device) {
----------------
skc7 wrote:

Done, applied the same.

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


More information about the flang-commits mailing list