diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h --- a/mlir/include/mlir/IR/OpDefinition.h +++ b/mlir/include/mlir/IR/OpDefinition.h @@ -132,8 +132,14 @@ /// Remove the attribute with the specified name if it exists. Return the /// attribute that was erased, or nullptr if there was no attribute with such /// name. - Attribute removeAttr(Identifier name) { return state->removeAttr(name); } - Attribute removeAttr(StringRef name) { + LLVM_ATTRIBUTE_DEPRECATED( + Attribute removeAttr(Identifier name), + "Use Operation::removeAttr() instead (replace '.' with '->').") { + return state->removeAttr(name); + } + LLVM_ATTRIBUTE_DEPRECATED( + Attribute removeAttr(StringRef name), + "Use Operation::removeAttr() instead (replace '.' with '->').") { return state->removeAttr(Identifier::get(name, getContext())); } diff --git a/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp b/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp --- a/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp +++ b/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp @@ -1547,8 +1547,8 @@ if (failed(SymbolTable::replaceAllSymbolUses(op, name, spvModule))) op.emitError("unable to replace all symbol uses for ") << name; SymbolTable::setSymbolName(op, name); - op.removeAttr(kDescriptorSet); - op.removeAttr(kBinding); + op->removeAttr(kDescriptorSet); + op->removeAttr(kBinding); } }); } 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 @@ -701,7 +701,7 @@ SmallVector nameBuf; for (int i = newType.getNumInputs(), e = oldType.getNumInputs(); i < e; i++) - removeAttr(getArgAttrName(i, nameBuf)); + (*this)->removeAttr(getArgAttrName(i, nameBuf)); (*this)->setAttr(getTypeAttrName(), TypeAttr::get(newType)); } diff --git a/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp b/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp @@ -103,6 +103,6 @@ // Ensure we drop the marker in the end. func.walk([](LinalgOp op) { - op.removeAttr(LinalgTransforms::kLinalgTransformMarker); + op->removeAttr(LinalgTransforms::kLinalgTransformMarker); }); } diff --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp @@ -596,7 +596,7 @@ funcOp, getLinalgTilingCanonicalizationPatterns(ctx)); // Drop the marker. funcOp.walk([](LinalgOp op) { - op.removeAttr(LinalgTransforms::kLinalgTransformMarker); + op->removeAttr(LinalgTransforms::kLinalgTransformMarker); }); } diff --git a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp --- a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp +++ b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp @@ -139,7 +139,7 @@ SmallVector localSize(localSizeAttr.getValues()); builder.create( funcOp.getLoc(), funcOp, spirv::ExecutionMode::LocalSize, localSize); - funcOp.removeAttr(entryPointAttrName); + funcOp->removeAttr(entryPointAttrName); return success(); } diff --git a/mlir/test/lib/Transforms/TestConvVectorization.cpp b/mlir/test/lib/Transforms/TestConvVectorization.cpp --- a/mlir/test/lib/Transforms/TestConvVectorization.cpp +++ b/mlir/test/lib/Transforms/TestConvVectorization.cpp @@ -119,7 +119,7 @@ // Ensure we drop the marker in the end. module.walk([](linalg::LinalgOp op) { - op.removeAttr(linalg::LinalgTransforms::kLinalgTransformMarker); + op->removeAttr(linalg::LinalgTransforms::kLinalgTransformMarker); }); } diff --git a/mlir/test/lib/Transforms/TestLinalgTransforms.cpp b/mlir/test/lib/Transforms/TestLinalgTransforms.cpp --- a/mlir/test/lib/Transforms/TestLinalgTransforms.cpp +++ b/mlir/test/lib/Transforms/TestLinalgTransforms.cpp @@ -228,7 +228,7 @@ // Drop the marker. funcOp.walk([](LinalgOp op) { - op.removeAttr(LinalgTransforms::kLinalgTransformMarker); + op->removeAttr(LinalgTransforms::kLinalgTransformMarker); }); } @@ -532,7 +532,7 @@ void TestLinalgTransforms::runOnFunction() { auto lambda = [&](void *) { getFunction().walk([](LinalgOp op) { - op.removeAttr(LinalgTransforms::kLinalgTransformMarker); + op->removeAttr(LinalgTransforms::kLinalgTransformMarker); }); }; std::unique_ptr cleanupGuard{(void *)1, lambda};