From dda003afa643011cc3d9c987fd4356410912c5a2 Mon Sep 17 00:00:00 2001 From: Chia-hung Duan Date: Fri, 25 Mar 2022 18:09:53 +0000 Subject: [PATCH] [mlir] Add InferTensorType without supporting reifyReturnTypeShapes This is useful for the case that we don't need to implement reifyReturnTypeShapes. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D121403 --- mlir/include/mlir/Interfaces/InferTypeOpInterface.td | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td index eb1860656a36..ef41a08bdab3 100644 --- a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td +++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td @@ -135,7 +135,7 @@ def InferShapedTypeOpInterface : OpInterface<"InferShapedTypeOpInterface"> { // Convenience class grouping together type and shaped type op interfaces for // ops that have tensor return types. -class InferTensorType overridenMethods = []> : TraitList< +class InferTensorTypeBase overridenMethods = []> : TraitList< [ // Op implements infer type op interface. InferTypeOpInterface, @@ -146,9 +146,10 @@ class InferTensorType overridenMethods = []> : TraitList< // along with knowledge that it is producing Tensors to infer the type. NativeOpTrait<"InferTensorType"> ]>; -def InferTensorTypeWithReify: TraitList.traits>; +def InferTensorType : InferTensorTypeBase<["inferReturnTypeComponents"]>; +def InferTensorTypeWithReify: InferTensorTypeBase<[ + "inferReturnTypeComponents", "reifyReturnTypeShapes"]>; def ReifyRankedShapedTypeOpInterface : OpInterface<"ReifyRankedShapedTypeOpInterface"> {