diff --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td index 8ec3a1256df23..63bbb9b252229 100644 --- a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td +++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td @@ -131,8 +131,8 @@ def InferShapedTypeOpInterface : OpInterface<"InferShapedTypeOpInterface"> { // Convenience class grouping together type and shaped type op interfaces for // ops that have tensor return types. -class InferTensorType overridenMethods = []> { - list traits = [ +class InferTensorType overridenMethods = []> : OpTraitList< + [ // Op implements infer type op interface. InferTypeOpInterface, // The op will have methods implementing the ShapedType type inference @@ -141,10 +141,9 @@ class InferTensorType overridenMethods = []> { // The op produces tensors and will use the ShapedType type infer interface // along with knowledge that it is producing Tensors to infer the type. NativeOpTrait<"InferTensorType"> - ]; -} -defvar InferTensorTypeWithReify = InferTensorType<[ - "inferReturnTypeComponents", "reifyReturnTypeShapes"]>; + ]>; +def InferTensorTypeWithReify: OpTraitList.traits>; def ReifyRankedShapedTypeOpInterface : diff --git a/mlir/test/lib/Dialect/Test/TestOps.td b/mlir/test/lib/Dialect/Test/TestOps.td index c94ca64ba6958..1e163a9c2fad8 100644 --- a/mlir/test/lib/Dialect/Test/TestOps.td +++ b/mlir/test/lib/Dialect/Test/TestOps.td @@ -565,7 +565,7 @@ def OpWithInferTypeInterfaceOp : TEST_Op<"op_with_infer_type_if", [ } def OpWithShapedTypeInferTypeInterfaceOp : TEST_Op<"op_with_shaped_type_infer_type_if", - InferTensorTypeWithReify.traits> { + [InferTensorTypeWithReify]> { let arguments = (ins AnyTensor, AnyTensor); let results = (outs AnyTensor); }