Skip to content

Commit f557f05

Browse files
committed
[mlir] update InferTypeOpInterface after c1eab57
The change in c1eab57 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.
1 parent b07bf16 commit f557f05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mlir/lib/Interfaces/InferTypeOpInterface.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,9 @@ LogicalResult mlir::detail::verifyInferredResultTypes(Operation *op) {
240240
auto retTypeFn = cast<InferTypeOpInterface>(op);
241241
auto result = retTypeFn.refineReturnTypes(
242242
op->getContext(), op->getLoc(), op->getOperands(),
243-
op->getDiscardableAttrDictionary(), op->getPropertiesStorage(),
244-
op->getRegions(), inferredReturnTypes);
243+
op->getPropertiesStorage() ? op->getDiscardableAttrDictionary()
244+
: op->getAttrDictionary(),
245+
op->getPropertiesStorage(), op->getRegions(), inferredReturnTypes);
245246
if (failed(result))
246247
op->emitOpError() << "failed to infer returned types";
247248

0 commit comments

Comments
 (0)