[Mlir-commits] [mlir] f557f05 - [mlir] update InferTypeOpInterface after c1eab57673ef3e

Alex Zinenko llvmlistbot at llvm.org
Wed Jan 3 08:49:51 PST 2024


Author: Alex Zinenko
Date: 2024-01-03T16:49:46Z
New Revision: f557f05b8dea6d915dba23f310c25655a403735e

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

LOG: [mlir] update InferTypeOpInterface after c1eab57673ef3e

The change in c1eab57673ef3eb2842c0fbe454d7878854cf54c fixed the
behavior of `getDiscardableAttrDictionary` for ops that are not using
properties to only return discardable attributes. `InferTypeOpInterface`
was relying on the wrong behavior when constructing an adaptor and would
assume that all attributes were discardable, which is not the case.

Added: 
    

Modified: 
    mlir/lib/Interfaces/InferTypeOpInterface.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Interfaces/InferTypeOpInterface.cpp b/mlir/lib/Interfaces/InferTypeOpInterface.cpp
index 3c50c4c37c6f59..ee4c0519b9f54f 100644
--- a/mlir/lib/Interfaces/InferTypeOpInterface.cpp
+++ b/mlir/lib/Interfaces/InferTypeOpInterface.cpp
@@ -240,8 +240,9 @@ LogicalResult mlir::detail::verifyInferredResultTypes(Operation *op) {
   auto retTypeFn = cast<InferTypeOpInterface>(op);
   auto result = retTypeFn.refineReturnTypes(
       op->getContext(), op->getLoc(), op->getOperands(),
-      op->getDiscardableAttrDictionary(), op->getPropertiesStorage(),
-      op->getRegions(), inferredReturnTypes);
+      op->getPropertiesStorage() ? op->getDiscardableAttrDictionary()
+                                 : op->getAttrDictionary(),
+      op->getPropertiesStorage(), op->getRegions(), inferredReturnTypes);
   if (failed(result))
     op->emitOpError() << "failed to infer returned types";
 


        


More information about the Mlir-commits mailing list