Skip to content

Commit 97574d9

Browse files
committed
[MLIR][OpenMP]Replaced colon with a comma separator between strict modifier and operand
1 parent 80c5460 commit 97574d9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ parseGranularityClause(OpAsmParser &parser, ClauseTypeAttr &prescriptiveness,
483483
if (succeeded(parser.parseOptionalKeyword(&enumStr))) {
484484
if (std::optional<ClauseType> enumValue = symbolizeClause(enumStr)) {
485485
prescriptiveness = ClauseTypeAttr::get(parser.getContext(), *enumValue);
486-
if (parser.parseColon())
486+
if (parser.parseComma())
487487
return failure();
488488
} else {
489489
return parser.emitError(parser.getCurrentLocation())
@@ -516,7 +516,7 @@ printGranularityClause(OpAsmPrinter &p, Operation *op,
516516
StringRef (*stringifyClauseType)(ClauseType)) {
517517

518518
if (prescriptiveness)
519-
p << stringifyClauseType(prescriptiveness.getValue()) << ": ";
519+
p << stringifyClauseType(prescriptiveness.getValue()) << ", ";
520520

521521
if (operand)
522522
p << operand << ": " << operandType;

mlir/test/Dialect/OpenMP/invalid.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,7 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
20672067
func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
20682068
%testi64 = "test.i64"() : () -> (i64)
20692069
// expected-error @below {{invalid grainsize modifier : 'strict1'}}
2070-
omp.taskloop grainsize(strict1: %testi64: i64) {
2070+
omp.taskloop grainsize(strict1, %testi64: i64) {
20712071
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
20722072
omp.yield
20732073
}
@@ -2079,7 +2079,7 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
20792079
func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
20802080
%testi64 = "test.i64"() : () -> (i64)
20812081
// expected-error @below {{invalid num_tasks modifier : 'default'}}
2082-
omp.taskloop num_tasks(default: %testi64: i64) {
2082+
omp.taskloop num_tasks(default, %testi64: i64) {
20832083
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
20842084
omp.yield
20852085
}

mlir/test/Dialect/OpenMP/ops.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,16 +2417,16 @@ func.func @omp_taskloop(%lb: i32, %ub: i32, %step: i32) -> () {
24172417
}
24182418
}
24192419

2420-
// CHECK: omp.taskloop grainsize(strict: %{{[^:]+}}: i64) {
2421-
omp.taskloop grainsize(strict: %testi64: i64) {
2420+
// CHECK: omp.taskloop grainsize(strict, %{{[^:]+}}: i64) {
2421+
omp.taskloop grainsize(strict, %testi64: i64) {
24222422
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
24232423
// CHECK: omp.yield
24242424
omp.yield
24252425
}
24262426
}
24272427

2428-
// CHECK: omp.taskloop num_tasks(strict: %{{[^:]+}}: i64) {
2429-
omp.taskloop num_tasks(strict: %testi64: i64) {
2428+
// CHECK: omp.taskloop num_tasks(strict, %{{[^:]+}}: i64) {
2429+
omp.taskloop num_tasks(strict, %testi64: i64) {
24302430
omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
24312431
// CHECK: omp.yield
24322432
omp.yield

0 commit comments

Comments
 (0)