diff --git a/mlir/include/mlir/IR/FunctionSupport.h b/mlir/include/mlir/IR/FunctionSupport.h index c2eec8727240..a3be1a76143a 100644 --- a/mlir/include/mlir/IR/FunctionSupport.h +++ b/mlir/include/mlir/IR/FunctionSupport.h @@ -566,9 +566,9 @@ void FunctionLike::setArgAttrs( SmallString<8> nameOut; getArgAttrName(index, nameOut); - if (attributes.empty()) - return (void)static_cast(this)->removeAttr(nameOut); Operation *op = this->getOperation(); + if (attributes.empty()) + return (void)op->removeAttr(nameOut); op->setAttr(nameOut, DictionaryAttr::get(op->getContext(), attributes)); } diff --git a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp index 8e985465cb8b..1e0a7663435b 100644 --- a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp +++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp @@ -270,8 +270,8 @@ LogicalResult GPUFuncOpConversion::matchAndRewrite( funcOp, *getTypeConverter(), rewriter, entryPointAttr, argABI); if (!newFuncOp) return failure(); - newFuncOp.removeAttr(Identifier::get(gpu::GPUDialect::getKernelFuncAttrName(), - rewriter.getContext())); + newFuncOp->removeAttr(Identifier::get( + gpu::GPUDialect::getKernelFuncAttrName(), rewriter.getContext())); return success(); } diff --git a/mlir/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp index 270db729ec55..f474bbfb4f20 100644 --- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp +++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp @@ -1514,7 +1514,7 @@ const char *enumAttrBeginPrinterCode = R"( static void genAttrDictPrinter(OperationFormat &fmt, Operator &op, OpMethodBody &body, bool withKeyword) { body << " p.printOptionalAttrDict" << (withKeyword ? "WithKeyword" : "") - << "(getAttrs(), /*elidedAttrs=*/{"; + << "((*this)->getAttrs(), /*elidedAttrs=*/{"; // Elide the variadic segment size attributes if necessary. if (!fmt.allOperands && op.getTrait("::mlir::OpTrait::AttrSizedOperandSegments"))