MLIR  16.0.0git
Shape.h
Go to the documentation of this file.
1 //===- Shape.h - MLIR Shape dialect -----------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the shape dialect that is used to describe and solve shape
10 // relations of MLIR operations using ShapedType.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MLIR_DIALECT_SHAPE_IR_SHAPE_H
15 #define MLIR_DIALECT_SHAPE_IR_SHAPE_H
16 
17 #include "mlir/IR/BuiltinOps.h"
18 #include "mlir/IR/Dialect.h"
20 #include "mlir/IR/OpDefinition.h"
22 #include "mlir/IR/SymbolTable.h"
27 
28 #define GET_TYPEDEF_CLASSES
29 #include "mlir/Dialect/Shape/IR/ShapeOpsTypes.h.inc"
30 
31 namespace mlir {
32 class PatternRewriter;
33 
34 namespace shape {
35 
36 /// Alias type for extent tensors.
37 RankedTensorType getExtentTensorType(MLIRContext *ctx,
38  int64_t rank = ShapedType::kDynamicSize);
39 
40 // Check if a type is an extent tensor, e.g., tensor<?xindex>.
42 
43 // Given an input shape Value, try to obtain the shape's values.
45 
46 } // namespace shape
47 } // namespace mlir
48 
49 #define GET_OP_CLASSES
50 #include "mlir/Dialect/Shape/IR/ShapeOps.h.inc"
51 
52 #include "mlir/Dialect/Shape/IR/ShapeOpsDialect.h.inc"
53 
54 #endif // MLIR_DIALECT_SHAPE_IR_SHAPE_H
Include the generated interface declarations.
This class represents an efficient way to signal success or failure.
Definition: LogicalResult.h:26
bool isExtentTensorType(Type)
Definition: Shape.cpp:43
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Definition: Types.h:72
LogicalResult getShapeVec(Value input, SmallVectorImpl< int64_t > &shapeValues)
Definition: Shape.cpp:48
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition: Value.h:85
RankedTensorType getExtentTensorType(MLIRContext *ctx, int64_t rank=ShapedType::kDynamicSize)
Alias type for extent tensors.
Definition: Shape.cpp:39
MLIRContext is the top-level object for a collection of MLIR operations.
Definition: MLIRContext.h:55