[Mlir-commits] [mlir] c030ba2 - [mlir] Add alias for input to shaped type op interface

Jacques Pienaar llvmlistbot at llvm.org
Wed Jul 21 10:34:40 PDT 2021


Author: Jacques Pienaar
Date: 2021-07-21T10:34:27-07:00
New Revision: c030ba2fc8f14e3646c776fe383494b8cec41ab5

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

LOG: [mlir] Add alias for input to shaped type op interface

Range type that allows for wrapping different value & shape ranges with
correspondence to Shape's ValueShape type - initially aliased to
ValueRange (which corresponds to the trivial mapping from a ShapedType's
Value's shape to shape). Just plain alias, before expanding.

Differential Revision: https://reviews.llvm.org/D99133

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.h b/mlir/include/mlir/Interfaces/InferTypeOpInterface.h
index 9f83c59c7738..954caa7749bf 100644
--- a/mlir/include/mlir/Interfaces/InferTypeOpInterface.h
+++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.h
@@ -76,6 +76,10 @@ class ShapedTypeComponents {
   Attribute attr;
 };
 
+/// Range of values and shapes (corresponding effectively to Shapes dialect's
+/// ValueShape type concept).
+using ValueShapeRange = ValueRange;
+
 namespace detail {
 // Helper function to infer return tensor returns types given element and shape
 // inference function.

diff  --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
index 63bbb9b25222..0d2c2b520a17 100644
--- a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
+++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
@@ -93,7 +93,7 @@ def InferShapedTypeOpInterface : OpInterface<"InferShapedTypeOpInterface"> {
       /*methodName=*/"inferReturnTypeComponents",
       /*args=*/(ins "::mlir::MLIRContext*":$context,
                     "::mlir::Optional<::mlir::Location>":$location,
-                    "::mlir::ValueRange":$operands,
+                    "::mlir::ValueShapeRange":$operands,
                     "::mlir::DictionaryAttr":$attributes,
                     "::mlir::RegionRange":$regions,
                     "::mlir::SmallVectorImpl<::mlir::ShapedTypeComponents>&":


        


More information about the Mlir-commits mailing list