[Mlir-commits] [mlir] eaf29b3 - [mlir][openacc] Add check for the private list in acc.serial

Valentin Clement llvmlistbot at llvm.org
Wed May 24 10:39:42 PDT 2023


Author: Valentin Clement
Date: 2023-05-24T10:39:34-07:00
New Revision: eaf29b3261c122a1e212cd47ca6e9d7c377975a8

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

LOG: [mlir][openacc] Add check for the private list in acc.serial

Add the missing check on private list information. The
check is the same than the one done for acc.parallel.

Depends on D151146

Reviewed By: razvanlupusoru, jeanPerier

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
index 5e5a00e141a4..73f34093fc22 100644
--- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
+++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
@@ -580,7 +580,10 @@ Value SerialOp::getDataOperand(unsigned i) {
 }
 
 LogicalResult acc::SerialOp::verify() {
-
+  if (failed(checkSymOperandList<mlir::acc::PrivateRecipeOp>(
+          *this, getPrivatizations(), getGangPrivateOperands(), "private",
+          "privatizations")))
+    return failure();
   return checkDataOperands<acc::SerialOp>(*this, getDataClauseOperands());
 }
 

diff  --git a/mlir/test/Dialect/OpenACC/invalid.mlir b/mlir/test/Dialect/OpenACC/invalid.mlir
index 899499b109dd..3c1ac1dfbfd2 100644
--- a/mlir/test/Dialect/OpenACC/invalid.mlir
+++ b/mlir/test/Dialect/OpenACC/invalid.mlir
@@ -462,3 +462,12 @@ acc.reduction.recipe @reduction_i64 : i64 reduction_operator<add> init {
   %2 = arith.constant 0 : i32
   acc.yield %2 : i32
 }
+
+// -----
+
+func.func @fct1(%0 : !llvm.ptr<i32>) -> () {
+  // expected-error at +1 {{expected symbol reference @privatization_i32 to point to a private declaration}}
+  acc.serial private(@privatization_i32 -> %0 : !llvm.ptr<i32>) {
+  }
+  return
+}


        


More information about the Mlir-commits mailing list