[Mlir-commits] [mlir] 4941fef - [mlir] Silence some deprecation warnings after dffc487b07d9a50f8c65eccb9241f72af3486c79

Benjamin Kramer llvmlistbot at llvm.org
Fri Feb 26 06:16:42 PST 2021


Author: Benjamin Kramer
Date: 2021-02-26T15:15:56+01:00
New Revision: 4941fef9c41c42ac11cbe6fcc3e6a43511a5dfed

URL: https://github.com/llvm/llvm-project/commit/4941fef9c41c42ac11cbe6fcc3e6a43511a5dfed
DIFF: https://github.com/llvm/llvm-project/commit/4941fef9c41c42ac11cbe6fcc3e6a43511a5dfed.diff

LOG: [mlir] Silence some deprecation warnings after dffc487b07d9a50f8c65eccb9241f72af3486c79

Added: 
    

Modified: 
    mlir/include/mlir/IR/FunctionSupport.h
    mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
    mlir/tools/mlir-tblgen/OpFormatGen.cpp

Removed: 
    


################################################################################
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<ConcreteType>::setArgAttrs(
   SmallString<8> nameOut;
   getArgAttrName(index, nameOut);
 
-  if (attributes.empty())
-    return (void)static_cast<ConcreteType *>(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"))


        


More information about the Mlir-commits mailing list