[Mlir-commits] [mlir] dda003a - [mlir] Add InferTensorType without supporting reifyReturnTypeShapes

Chia-hung Duan llvmlistbot at llvm.org
Fri Mar 25 12:08:02 PDT 2022


Author: Chia-hung Duan
Date: 2022-03-25T19:04:34Z
New Revision: dda003afa643011cc3d9c987fd4356410912c5a2

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

LOG: [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

Added: 
    

Modified: 
    mlir/include/mlir/Interfaces/InferTypeOpInterface.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
index eb1860656a366..ef41a08bdab33 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<list<string> overridenMethods = []> : TraitList<
+class InferTensorTypeBase<list<string> overridenMethods = []> : TraitList<
   [
     // Op implements infer type op interface.
     InferTypeOpInterface,
@@ -146,9 +146,10 @@ class InferTensorType<list<string> overridenMethods = []> : TraitList<
     // along with knowledge that it is producing Tensors to infer the type.
     NativeOpTrait<"InferTensorType">
   ]>;
-def InferTensorTypeWithReify: TraitList<InferTensorType<[
-    "inferReturnTypeComponents", "reifyReturnTypeShapes"]>.traits>;
 
+def InferTensorType : InferTensorTypeBase<["inferReturnTypeComponents"]>;
+def InferTensorTypeWithReify: InferTensorTypeBase<[
+    "inferReturnTypeComponents", "reifyReturnTypeShapes"]>;
 
 def ReifyRankedShapedTypeOpInterface :
     OpInterface<"ReifyRankedShapedTypeOpInterface"> {


        


More information about the Mlir-commits mailing list