Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -2197,9 +2197,9 @@ def OpenACC_LoopOp : OpenACC_Op<"loop",

let hasCustomAssemblyFormat = 1;
let assemblyFormat = [{
custom<CombinedConstructsLoop>($combined)
oilist(
`gang` `` custom<GangClause>($gangOperands, type($gangOperands),
`combined` `(` custom<CombinedConstructsLoop>($combined) `)`
| `gang` `` custom<GangClause>($gangOperands, type($gangOperands),
$gangOperandsArgType, $gangOperandsDeviceType,
$gangOperandsSegments, $gang)
| `worker` `` custom<DeviceTypeOperandsWithKeywordOnly>(
Expand Down
38 changes: 16 additions & 22 deletions mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,25 +1686,19 @@ static void printDeviceTypeOperandsWithKeywordOnly(
static ParseResult
parseCombinedConstructsLoop(mlir::OpAsmParser &parser,
mlir::acc::CombinedConstructsTypeAttr &attr) {
if (succeeded(parser.parseOptionalKeyword("combined"))) {
if (parser.parseLParen())
return failure();
if (succeeded(parser.parseOptionalKeyword("kernels"))) {
attr = mlir::acc::CombinedConstructsTypeAttr::get(
parser.getContext(), mlir::acc::CombinedConstructsType::KernelsLoop);
} else if (succeeded(parser.parseOptionalKeyword("parallel"))) {
attr = mlir::acc::CombinedConstructsTypeAttr::get(
parser.getContext(), mlir::acc::CombinedConstructsType::ParallelLoop);
} else if (succeeded(parser.parseOptionalKeyword("serial"))) {
attr = mlir::acc::CombinedConstructsTypeAttr::get(
parser.getContext(), mlir::acc::CombinedConstructsType::SerialLoop);
} else {
parser.emitError(parser.getCurrentLocation(),
"expected compute construct name");
return failure();
}
if (parser.parseRParen())
return failure();
if (succeeded(parser.parseOptionalKeyword("kernels"))) {
attr = mlir::acc::CombinedConstructsTypeAttr::get(
parser.getContext(), mlir::acc::CombinedConstructsType::KernelsLoop);
} else if (succeeded(parser.parseOptionalKeyword("parallel"))) {
attr = mlir::acc::CombinedConstructsTypeAttr::get(
parser.getContext(), mlir::acc::CombinedConstructsType::ParallelLoop);
} else if (succeeded(parser.parseOptionalKeyword("serial"))) {
attr = mlir::acc::CombinedConstructsTypeAttr::get(
parser.getContext(), mlir::acc::CombinedConstructsType::SerialLoop);
} else {
parser.emitError(parser.getCurrentLocation(),
"expected compute construct name");
return failure();
}
return success();
}
Expand All @@ -1715,13 +1709,13 @@ printCombinedConstructsLoop(mlir::OpAsmPrinter &p, mlir::Operation *op,
if (attr) {
switch (attr.getValue()) {
case mlir::acc::CombinedConstructsType::KernelsLoop:
p << "combined(kernels)";
p << "kernels";
break;
case mlir::acc::CombinedConstructsType::ParallelLoop:
p << "combined(parallel)";
p << "parallel";
break;
case mlir::acc::CombinedConstructsType::SerialLoop:
p << "combined(serial)";
p << "serial";
break;
};
}
Expand Down