diff --git a/mlir/include/mlir/Dialect/GPU/GPUOps.td b/mlir/include/mlir/Dialect/GPU/GPUOps.td --- a/mlir/include/mlir/Dialect/GPU/GPUOps.td +++ b/mlir/include/mlir/Dialect/GPU/GPUOps.td @@ -901,7 +901,7 @@ `(` $dynamicSizes `)` (`` `[` $symbolOperands^ `]`)? attr-dict `:` type($memref) }]; - let verifier = [{ return ::verify(*this); }]; + let hasVerifier = 1; let hasCanonicalizer = 1; } diff --git a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp --- a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp +++ b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp @@ -1174,20 +1174,20 @@ // GPU_AllocOp //===----------------------------------------------------------------------===// -static LogicalResult verify(AllocOp op) { - auto memRefType = op.memref().getType().cast(); +LogicalResult AllocOp::verify() { + auto memRefType = memref().getType().cast(); - if (static_cast(op.dynamicSizes().size()) != + if (static_cast(dynamicSizes().size()) != memRefType.getNumDynamicDims()) - return op.emitOpError("dimension operand count does not equal memref " - "dynamic dimension count"); + return emitOpError("dimension operand count does not equal memref " + "dynamic dimension count"); unsigned numSymbols = 0; if (!memRefType.getLayout().isIdentity()) numSymbols = memRefType.getLayout().getAffineMap().getNumSymbols(); - if (op.symbolOperands().size() != numSymbols) - return op.emitOpError("symbol operand count does not equal memref symbol " - "count"); + if (symbolOperands().size() != numSymbols) + return emitOpError("symbol operand count does not equal memref symbol " + "count"); return success(); }