Skip to content

[MLIR][OpenMP][NFC] Document omp.section(s) block arguments #98175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

tblah
Copy link
Contributor

@tblah tblah commented Jul 9, 2024

Following discussion here:
#97858 (comment)

@llvmbot
Copy link
Member

llvmbot commented Jul 9, 2024

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-flang-openmp

Author: Tom Eccles (tblah)

Changes

Following discussion here:
#97858 (comment)


Full diff: https://github.com/llvm/llvm-project/pull/98175.diff

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td (+6-1)
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.

@llvmbot
Copy link
Member

llvmbot commented Jul 9, 2024

@llvm/pr-subscribers-mlir-openmp

Author: Tom Eccles (tblah)

Changes

Following discussion here:
#97858 (comment)


Full diff: https://github.com/llvm/llvm-project/pull/98175.diff

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td (+6-1)
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.

Copy link
Member

@skatrak skatrak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM!

@tblah tblah merged commit 85d6e3c into llvm:main Jul 10, 2024
11 checks passed
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants