[Mlir-commits] [mlir] 2d8f0c0 - [mlir][openacc] Add missing print of vector_length in parallel op

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Sep 15 06:48:54 PDT 2020


Author: Valentin Clement
Date: 2020-09-15T09:48:47-04:00
New Revision: 2d8f0c05dbe76a31060a729928b9b9d7ebbf0c40

URL: https://github.com/llvm/llvm-project/commit/2d8f0c05dbe76a31060a729928b9b9d7ebbf0c40
DIFF: https://github.com/llvm/llvm-project/commit/2d8f0c05dbe76a31060a729928b9b9d7ebbf0c40.diff

LOG: [mlir][openacc] Add missing print of vector_length in parallel op

This patch adds the missing print for the vector_length in the parallel operation.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D87630

Added: 
    

Modified: 
    mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
    mlir/test/Dialect/OpenACC/ops.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
index b5dfa2c13358..11a774828194 100644
--- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
+++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
@@ -269,22 +269,27 @@ static void print(OpAsmPrinter &printer, ParallelOp &op) {
   printer << ParallelOp::getOperationName();
 
   // async()?
-  if (auto async = op.async())
+  if (Value async = op.async())
     printer << " " << ParallelOp::getAsyncKeyword() << "(" << async << ")";
 
   // wait()?
   printOperandList(op.waitOperands(), ParallelOp::getWaitKeyword(), printer);
 
   // num_gangs()?
-  if (auto numGangs = op.numGangs())
+  if (Value numGangs = op.numGangs())
     printer << " " << ParallelOp::getNumGangsKeyword() << "(" << numGangs
             << ")";
 
   // num_workers()?
-  if (auto numWorkers = op.numWorkers())
+  if (Value numWorkers = op.numWorkers())
     printer << " " << ParallelOp::getNumWorkersKeyword() << "(" << numWorkers
             << ")";
 
+  // vector_length()?
+  if (Value 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
index 6cdba227d5da..b534f703e05e 100644
--- a/mlir/test/Dialect/OpenACC/ops.mlir
+++ b/mlir/test/Dialect/OpenACC/ops.mlir
@@ -232,3 +232,15 @@ func @testop() -> () {
 // 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: }


        


More information about the Mlir-commits mailing list