@@ -178,7 +178,7 @@ def ParallelOp : OpenMP_Op<"parallel", traits = [
178178
179179 let assemblyFormat = clausesAssemblyFormat # [{
180180 custom<PrivateReductionRegion>($region, $private_vars, type($private_vars),
181- $private_syms, $reduction_vars, type($reduction_vars), $reduction_byref,
181+ $private_syms, $reduction_mod, $ reduction_vars, type($reduction_vars), $reduction_byref,
182182 $reduction_syms) attr-dict
183183 }];
184184
@@ -223,7 +223,7 @@ def TeamsOp : OpenMP_Op<"teams", traits = [
223223
224224 let assemblyFormat = clausesAssemblyFormat # [{
225225 custom<PrivateReductionRegion>($region, $private_vars, type($private_vars),
226- $private_syms, $reduction_vars, type($reduction_vars), $reduction_byref,
226+ $private_syms, $reduction_mod, $ reduction_vars, type($reduction_vars), $reduction_byref,
227227 $reduction_syms) attr-dict
228228 }];
229229
@@ -282,7 +282,7 @@ def SectionsOp : OpenMP_Op<"sections", traits = [
282282
283283 let assemblyFormat = clausesAssemblyFormat # [{
284284 custom<PrivateReductionRegion>($region, $private_vars, type($private_vars),
285- $private_syms, $reduction_vars, type($reduction_vars), $reduction_byref,
285+ $private_syms, $reduction_mod, $ reduction_vars, type($reduction_vars), $reduction_byref,
286286 $reduction_syms) attr-dict
287287 }];
288288
@@ -469,7 +469,7 @@ def LoopOp : OpenMP_Op<"loop", traits = [
469469
470470 let assemblyFormat = clausesAssemblyFormat # [{
471471 custom<PrivateReductionRegion>($region, $private_vars, type($private_vars),
472- $private_syms, $reduction_vars, type($reduction_vars), $reduction_byref,
472+ $private_syms, $reduction_mod, $ reduction_vars, type($reduction_vars), $reduction_byref,
473473 $reduction_syms) attr-dict
474474 }];
475475
@@ -521,7 +521,7 @@ def WsloopOp : OpenMP_Op<"wsloop", traits = [
521521
522522 let assemblyFormat = clausesAssemblyFormat # [{
523523 custom<PrivateReductionRegion>($region, $private_vars, type($private_vars),
524- $private_syms, $reduction_vars, type($reduction_vars), $reduction_byref,
524+ $private_syms, $reduction_mod, $ reduction_vars, type($reduction_vars), $reduction_byref,
525525 $reduction_syms) attr-dict
526526 }];
527527
@@ -575,7 +575,7 @@ def SimdOp : OpenMP_Op<"simd", traits = [
575575
576576 let assemblyFormat = clausesAssemblyFormat # [{
577577 custom<PrivateReductionRegion>($region, $private_vars, type($private_vars),
578- $private_syms, $reduction_vars, type($reduction_vars), $reduction_byref,
578+ $private_syms, $reduction_mod, $ reduction_vars, type($reduction_vars), $reduction_byref,
579579 $reduction_syms) attr-dict
580580 }];
581581
@@ -782,7 +782,7 @@ def TaskloopOp : OpenMP_Op<"taskloop", traits = [
782782 custom<InReductionPrivateReductionRegion>(
783783 $region, $in_reduction_vars, type($in_reduction_vars),
784784 $in_reduction_byref, $in_reduction_syms, $private_vars,
785- type($private_vars), $private_syms, $reduction_vars,
785+ type($private_vars), $private_syms, $reduction_mod, $ reduction_vars,
786786 type($reduction_vars), $reduction_byref, $reduction_syms) attr-dict
787787 }];
788788
@@ -1706,6 +1706,26 @@ def CancellationPointOp : OpenMP_Op<"cancellation_point", clauses = [
17061706 let hasVerifier = 1;
17071707}
17081708
1709+ def ScanOp : OpenMP_Op<"scan", [
1710+ AttrSizedOperandSegments, MemoryEffects<[MemWrite]>
1711+ ], clauses = [
1712+ OpenMP_InclusiveClause, OpenMP_ExclusiveClause]> {
1713+ let summary = "scan directive";
1714+ let description = [{
1715+ The scan directive allows to specify scan reductions. It should be
1716+ enclosed within a parent directive along with which a reduction clause
1717+ with `inscan` modifier must be specified. The scan directive allows to
1718+ split code blocks into input phase and scan phase in the region
1719+ enclosed by the parent.
1720+ }] # clausesDescription;
1721+
1722+ let builders = [
1723+ OpBuilder<(ins CArg<"const ScanOperands &">:$clauses)>
1724+ ];
1725+
1726+ let hasVerifier = 1;
1727+ }
1728+
17091729//===----------------------------------------------------------------------===//
17101730// 2.19.5.7 declare reduction Directive
17111731//===----------------------------------------------------------------------===//
0 commit comments