diff --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp --- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp +++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp @@ -285,6 +285,11 @@ printer << " " << ParallelOp::getNumWorkersKeyword() << "(" << numWorkers << ")"; + // vector_length()? + if (auto vectorLength = op.vectorLength()) + printer << " " << ParallelOp::getVectorLengthKeyword() << "(" + << vectorLength << ")"; + // if()? if (Value ifCond = op.ifCond()) printer << " " << ParallelOp::getIfKeyword() << "(" << ifCond << ")"; diff --git a/mlir/test/Dialect/OpenACC/ops.mlir b/mlir/test/Dialect/OpenACC/ops.mlir --- a/mlir/test/Dialect/OpenACC/ops.mlir +++ b/mlir/test/Dialect/OpenACC/ops.mlir @@ -232,3 +232,15 @@ // CHECK-NEXT: } // CHECK-NEXT: acc.loop tile([[TILESIZE]]: i64, [[TILESIZE]]: i64) { // CHECK-NEXT: } + + +func @testparallelop() -> () { + %vectorLength = constant 128 : index + acc.parallel vector_length(%vectorLength) { + } + return +} + +// CHECK: [[VECTORLENGTH:%.*]] = constant 128 : index +// CHECK-NEXT: acc.parallel vector_length([[VECTORLENGTH]]) { +// CHECK-NEXT: }