Skip to content

Commit 03d8f95

Browse files
authored
[MLIR][OpenMP] NFC: Address tablegen warnings (#98485)
After the addition of the `-verify-openmp-ops` tablegen pseudo-backend to report suspected issues with the definition of an operation, some warnings were triggered in the current implementation of OpenMPOps.td. These are related to known limitations for which TODO messages exist within these operation's definitions. This patch explicitly inhibits the inheritance of the `assemblyFormat` property of all clauses added to the `omp.parallel` and `omp.wsloop` operations to avoid these warnings. This should help identifying actual issues that may arise later as the dialect continues to be developed.
1 parent 967eba0 commit 03d8f95

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,12 @@ def ParallelOp : OpenMP_Op<"parallel", traits = [
133133
RecursiveMemoryEffects
134134
], clauses = [
135135
// TODO: Sort clauses alphabetically.
136-
OpenMP_IfClause, OpenMP_NumThreadsClause, OpenMP_AllocateClause,
137-
OpenMP_ReductionClause, OpenMP_ProcBindClause, OpenMP_PrivateClause
136+
OpenMP_IfClauseSkip<assemblyFormat = true>,
137+
OpenMP_NumThreadsClauseSkip<assemblyFormat = true>,
138+
OpenMP_AllocateClauseSkip<assemblyFormat = true>,
139+
OpenMP_ReductionClauseSkip<assemblyFormat = true>,
140+
OpenMP_ProcBindClauseSkip<assemblyFormat = true>,
141+
OpenMP_PrivateClauseSkip<assemblyFormat = true>
138142
], singleRegion = true> {
139143
let summary = "parallel construct";
140144
let description = [{
@@ -154,7 +158,8 @@ def ParallelOp : OpenMP_Op<"parallel", traits = [
154158

155159
// TODO: Use default assembly format inherited from OpenMP_Op once printing
156160
// and parsing of the parallel region is not intermingled with printing and
157-
// parsing of reduction and private clauses.
161+
// parsing of reduction and private clauses. `assemblyFormat` should also be
162+
// no longer skipped for clauses added to this operation at that time.
158163
let assemblyFormat = [{
159164
oilist(
160165
`if` `(` $if_expr `)`
@@ -363,8 +368,12 @@ def WsloopOp : OpenMP_Op<"wsloop", traits = [
363368
], clauses = [
364369
// TODO: Complete clause list (allocate, private).
365370
// TODO: Sort clauses alphabetically.
366-
OpenMP_LinearClause, OpenMP_ReductionClause, OpenMP_ScheduleClause,
367-
OpenMP_NowaitClause, OpenMP_OrderedClause, OpenMP_OrderClause
371+
OpenMP_LinearClauseSkip<assemblyFormat = true>,
372+
OpenMP_ReductionClauseSkip<assemblyFormat = true>,
373+
OpenMP_ScheduleClauseSkip<assemblyFormat = true>,
374+
OpenMP_NowaitClauseSkip<assemblyFormat = true>,
375+
OpenMP_OrderedClauseSkip<assemblyFormat = true>,
376+
OpenMP_OrderClauseSkip<assemblyFormat = true>
368377
], singleRegion = true> {
369378
let summary = "worksharing-loop construct";
370379
let description = [{
@@ -398,7 +407,8 @@ def WsloopOp : OpenMP_Op<"wsloop", traits = [
398407

399408
// TODO: Use default assembly format inherited from OpenMP_Op once printing
400409
// and parsing of the workshare loop region is not intermingled with printing
401-
// and parsing of reduction clauses.
410+
// and parsing of reduction clauses. `assemblyFormat` should also be no longer
411+
// skipped for clauses added to this operation at that time.
402412
let assemblyFormat = [{
403413
oilist(`linear` `(`
404414
custom<LinearClause>($linear_vars, type($linear_vars),

0 commit comments

Comments
 (0)