[Mlir-commits] [mlir] [OpenMP][MLIR] Add omp.distribute op to the OMP dialect (PR #67720)

Jan Leyonberg llvmlistbot at llvm.org
Thu Jan 11 06:34:49 PST 2024


================
@@ -636,6 +636,57 @@ def YieldOp : OpenMP_Op<"yield",
   let assemblyFormat = [{ ( `(` $results^ `:` type($results) `)` )? attr-dict}];
 }
 
+//===----------------------------------------------------------------------===//
+// Distribute construct [2.9.4.1]
+//===----------------------------------------------------------------------===//
+def DistributeOp : OpenMP_Op<"distribute", [AttrSizedOperandSegments,
+                              MemoryEffects<[MemWrite]>]> {
----------------
jsjodin wrote:

I'm not sure if @shraiysh is working on OpenMP anymore. There is a bit of a nuance with respect to the memory effects. The memory effects apply to operations inside the distribute region, and to containing ops, but not ops on the same level. If CSE or some other pass decides to hoist things outside the inner region that would be illegal (so in some sense it does apply moved operations at the same level). Similarly it would be illegal to hoist the omp.distribute outside a omp.teams, It is safest to mark the op with MemoryEffects<[MemWrite]>.

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


More information about the Mlir-commits mailing list