Skip to content

Commit eaf29b3

Browse files
committed
[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
1 parent b46be15 commit eaf29b3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,10 @@ Value SerialOp::getDataOperand(unsigned i) {
580580
}
581581

582582
LogicalResult acc::SerialOp::verify() {
583-
583+
if (failed(checkSymOperandList<mlir::acc::PrivateRecipeOp>(
584+
*this, getPrivatizations(), getGangPrivateOperands(), "private",
585+
"privatizations")))
586+
return failure();
584587
return checkDataOperands<acc::SerialOp>(*this, getDataClauseOperands());
585588
}
586589

mlir/test/Dialect/OpenACC/invalid.mlir

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,3 +462,12 @@ acc.reduction.recipe @reduction_i64 : i64 reduction_operator<add> init {
462462
%2 = arith.constant 0 : i32
463463
acc.yield %2 : i32
464464
}
465+
466+
// -----
467+
468+
func.func @fct1(%0 : !llvm.ptr<i32>) -> () {
469+
// expected-error@+1 {{expected symbol reference @privatization_i32 to point to a private declaration}}
470+
acc.serial private(@privatization_i32 -> %0 : !llvm.ptr<i32>) {
471+
}
472+
return
473+
}

0 commit comments

Comments
 (0)