Skip to content

Commit a838aa0

Browse files
committed
qR3: Addressing a few review comments
1 parent 3298ae1 commit a838aa0

File tree

6 files changed

+78
-93
lines changed

6 files changed

+78
-93
lines changed

mlir/include/mlir/Dialect/OpenMP/OpenMPClauses.td

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ class OpenMP_ExclusiveClauseSkip<
327327

328328
let extraClassDeclaration = [{
329329
bool hasExclusiveVars() {
330-
return getExclusiveVars().size()>0;
330+
return !getExclusiveVars().empty();
331331
}
332332
}];
333333

@@ -337,6 +337,9 @@ class OpenMP_ExclusiveClauseSkip<
337337
is specified, the input phase excludes the preceding structured block
338338
sequence and instead includes the following structured block sequence,
339339
while the scan phase includes the preceding structured block sequence.
340+
341+
The `exclusive_vars` is a variadic list of operands that specifies the
342+
scan-reduction accumulator symbols.
340343
}];
341344
}
342345

@@ -471,7 +474,7 @@ class OpenMP_InclusiveClauseSkip<
471474

472475
let extraClassDeclaration = [{
473476
bool hasInclusiveVars() {
474-
return getInclusiveVars().size()>0;
477+
return !getInclusiveVars().empty();
475478
}
476479
}];
477480

@@ -480,6 +483,9 @@ class OpenMP_InclusiveClauseSkip<
480483
structured block into two structured block sequences. If it is specified,
481484
the input phase includes the preceding structured block sequence and the
482485
scan phase includes the following structured block sequence.
486+
487+
The `inclusive_vars` is a variadic list of operands that specifies the
488+
scan-reduction accumulator symbols.
483489
}];
484490
}
485491

@@ -548,7 +554,6 @@ class OpenMP_InReductionClauseSkip<
548554
];
549555

550556
let arguments = (ins
551-
OptionalAttr<ReductionModifierAttr>:$in_reduction_mod,
552557
Variadic<OpenMP_PointerLikeType>:$in_reduction_vars,
553558
OptionalAttr<DenseBoolArrayAttr>:$in_reduction_byref,
554559
OptionalAttr<SymbolRefArrayAttr>:$in_reduction_syms
@@ -1208,7 +1213,6 @@ class OpenMP_TaskReductionClauseSkip<
12081213
];
12091214

12101215
let arguments = (ins
1211-
OptionalAttr<ReductionModifierAttr>:$task_reduction_mod,
12121216
Variadic<OpenMP_PointerLikeType>:$task_reduction_vars,
12131217
OptionalAttr<DenseBoolArrayAttr>:$task_reduction_byref,
12141218
OptionalAttr<SymbolRefArrayAttr>:$task_reduction_syms

mlir/include/mlir/Dialect/OpenMP/OpenMPEnums.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def ReductionModifier : OpenMP_I32EnumAttr<
195195
]>;
196196

197197
def ReductionModifierAttr : OpenMP_EnumAttr<ReductionModifier,
198-
"reduction_modifier"> {
198+
"reduction_modifier"> {
199199
let assemblyFormat = "`(` $value `)`";
200200
}
201201

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def LoopOp : OpenMP_Op<"loop", traits = [
461461

462462
let assemblyFormat = clausesAssemblyFormat # [{
463463
custom<PrivateReductionRegion>($region, $private_vars, type($private_vars),
464-
$private_syms, $reduction_vars, type($reduction_vars), $reduction_byref,
464+
$private_syms, $reduction_mod, $reduction_vars, type($reduction_vars), $reduction_byref,
465465
$reduction_syms) attr-dict
466466
}];
467467

@@ -691,7 +691,7 @@ def TaskOp : OpenMP_Op<"task", traits = [
691691

692692
let assemblyFormat = clausesAssemblyFormat # [{
693693
custom<InReductionPrivateRegion>(
694-
$region, $in_reduction_mod, $in_reduction_vars, type($in_reduction_vars),
694+
$region, $in_reduction_vars, type($in_reduction_vars),
695695
$in_reduction_byref, $in_reduction_syms, $private_vars,
696696
type($private_vars), $private_syms) attr-dict
697697
}];
@@ -769,7 +769,7 @@ def TaskloopOp : OpenMP_Op<"taskloop", traits = [
769769

770770
let assemblyFormat = clausesAssemblyFormat # [{
771771
custom<InReductionPrivateReductionRegion>(
772-
$region, $in_reduction_mod, $in_reduction_vars, type($in_reduction_vars),
772+
$region, $in_reduction_vars, type($in_reduction_vars),
773773
$in_reduction_byref, $in_reduction_syms, $private_vars,
774774
type($private_vars), $private_syms, $reduction_mod, $reduction_vars,
775775
type($reduction_vars), $reduction_byref, $reduction_syms) attr-dict
@@ -816,7 +816,7 @@ def TaskgroupOp : OpenMP_Op<"taskgroup", traits = [
816816

817817
let assemblyFormat = clausesAssemblyFormat # [{
818818
custom<TaskReductionRegion>(
819-
$region, $task_reduction_mod, $task_reduction_vars, type($task_reduction_vars),
819+
$region, $task_reduction_vars, type($task_reduction_vars),
820820
$task_reduction_byref, $task_reduction_syms) attr-dict
821821
}];
822822

@@ -1237,7 +1237,7 @@ def TargetOp : OpenMP_Op<"target", traits = [
12371237

12381238
let assemblyFormat = clausesAssemblyFormat # [{
12391239
custom<InReductionMapPrivateRegion>(
1240-
$region, $in_reduction_mod, $in_reduction_vars, type($in_reduction_vars),
1240+
$region, $in_reduction_vars, type($in_reduction_vars),
12411241
$in_reduction_byref, $in_reduction_syms, $map_vars, type($map_vars),
12421242
$private_vars, type($private_vars), $private_syms) attr-dict
12431243
}];
@@ -1653,15 +1653,15 @@ def CancellationPointOp : OpenMP_Op<"cancellation_point", clauses = [
16531653
}
16541654

16551655
def ScanOp : OpenMP_Op<"scan", [
1656-
AttrSizedOperandSegments, RecipeInterface, IsolatedFromAbove
1656+
AttrSizedOperandSegments
16571657
], clauses = [
1658-
OpenMP_InclusiveClause, OpenMP_ExclusiveClause]> {
1658+
OpenMP_InclusiveClause, OpenMP_ExclusiveClause]> {
16591659
let summary = "scan directive";
16601660
let description = [{
1661-
The scan directive allows to specify scan reduction. Scan directive
1662-
should be enclosed with in a parent directive along with which, a
1663-
reduction clause with `InScan` modifier must be specified. Scan directive
1664-
allows to separate code blocks to input phase and scan phase in the region
1661+
The scan directive allows to specify scan reductions. It should be
1662+
enclosed within a parent directive along with which a reduction clause
1663+
with `inscan` modifier must be specified. The scan directive allows to
1664+
split code blocks into input phase and scan phase in the region
16651665
enclosed by the parent.
16661666
}] # clausesDescription;
16671667

0 commit comments

Comments
 (0)