[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.
This commit is contained in:
Alex Zinenko 2024-01-03 16:46:54 +00:00
parent b07bf16a6f
commit f557f05b8d

View File

@ -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";