[Mlir-commits] [mlir] [MLIR][OpenMP][NFC] Document omp.section(s) block arguments (PR #98175)

Tom Eccles llvmlistbot at llvm.org
Tue Jul 9 08:40:05 PDT 2024


https://github.com/tblah created https://github.com/llvm/llvm-project/pull/98175

Following discussion here:
https://github.com/llvm/llvm-project/pull/97858#discussion_r1670173102

>From 415fa1ef74e54b1b4dbe4a5b8d4257641378ea09 Mon Sep 17 00:00:00 2001
From: Tom Eccles <tom.eccles at arm.com>
Date: Tue, 9 Jul 2024 15:32:19 +0000
Subject: [PATCH] [MLIR][OpenMP][NFC] Document omp.section(s) block arguments

Following discussion here:
https://github.com/llvm/llvm-project/pull/97858#discussion_r1670173102
---
 mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
index ab1fb649fcfde..aee2937ce5cb7 100644
--- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
+++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
@@ -223,7 +223,10 @@ def SectionOp : OpenMP_Op<"section", [HasParent<"SectionsOp">],
   let description = [{
     A section operation encloses a region which represents one section in a
     sections construct. A section op should always be surrounded by an
-    `omp.sections` operation.
+    `omp.sections` operation. The section operation may have block args
+    which corespond to the block arguments of the surrounding `omp.sections`
+    operation. This is done to reflect situations where these block arguments
+    represent variables private to each section.
   }];
   let assemblyFormat = "$region attr-dict";
 }
@@ -242,6 +245,8 @@ def SectionsOp : OpenMP_Op<"sections", traits = [
     distributed among and executed by the threads in a team. Each `omp.section`
     is executed once by one of the threads in the team in the context of its
     implicit task.
+    Block arguments for reduction variables should be mirrored in enclosed
+    `omp.section` operations.
   }] # clausesDescription;
 
   // Override region definition.



More information about the Mlir-commits mailing list