From: Valentin Clement Date: Wed, 24 May 2023 17:39:00 +0000 (-0700) Subject: [mlir][openacc] Add check for the private list in acc.serial X-Git-Tag: upstream/17.0.6~7342 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eaf29b3261c122a1e212cd47ca6e9d7c377975a8;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp index 5e5a00e..73f3409 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( + *this, getPrivatizations(), getGangPrivateOperands(), "private", + "privatizations"))) + return failure(); return checkDataOperands(*this, getDataClauseOperands()); } diff --git a/mlir/test/Dialect/OpenACC/invalid.mlir b/mlir/test/Dialect/OpenACC/invalid.mlir index 899499b..3c1ac1d 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 init { %2 = arith.constant 0 : i32 acc.yield %2 : i32 } + +// ----- + +func.func @fct1(%0 : !llvm.ptr) -> () { + // expected-error@+1 {{expected symbol reference @privatization_i32 to point to a private declaration}} + acc.serial private(@privatization_i32 -> %0 : !llvm.ptr) { + } + return +}