Home
last modified time | relevance | path

Searched refs:shape (Results 1 – 25 of 422) sorted by relevance

12345678910>>...17

/llvm-project-15.0.7/mlir/test/Dialect/Shape/
H A Dops.mlir52 %2 = shape.broadcast %0, %1 : !shape.shape, !shape.shape -> !shape.shape
67 %2 = "shape.meet"(%0, %1) : (!shape.shape, !shape.shape) -> !shape.shape
75 %2 = "shape.meet"(%0, %1) : (!shape.shape, !shape.shape) -> !shape.shape
83 %2 = "shape.meet"(%0, %1) : (!shape.shape, !shape.shape) -> !shape.shape
111 %2 = "shape.any"(%0, %1) : (!shape.shape, !shape.shape) -> !shape.shape
228 %2 = "shape.any"(%0, %1) : (!shape.shape, !shape.shape) -> !shape.shape
263 : !shape.shape, !shape.shape, !shape.shape -> !shape.shape
299 %1 = shape.max %a, %0 : !shape.shape, !shape.shape -> !shape.shape
301 !shape.shape, !shape.shape -> !shape.shape
307 %1 = shape.min %a, %0 : !shape.shape, !shape.shape -> !shape.shape
[all …]
H A Dcanonicalize.mlir14 func.func @f() -> (!shape.shape, !shape.shape) {
19 %head, %tail = "shape.split_at"(%0, %c2) : (!shape.shape, index) -> (!shape.shape, !shape.shape)
57 %2 = shape.broadcast %0, %1 : !shape.shape, !shape.shape -> !shape.shape
93 %1 = shape.broadcast %arg0, %0 : !shape.shape, !shape.shape -> !shape.shape
104 %1 = shape.broadcast %0, %arg0 : !shape.shape, !shape.shape -> !shape.shape
117 %2 = shape.broadcast %0, %1 : !shape.shape, !shape.shape -> !shape.shape
159 %2 = shape.broadcast %0, %1 : !shape.shape, !shape.shape -> !shape.shape
170 : !shape.shape, !shape.shape -> !shape.shape
1286 !shape.shape, !shape.shape, !shape.shape, !shape.shape, !shape.shape
1299 !shape.shape, !shape.shape, !shape.shape, !shape.shape, !shape.shape
[all …]
H A Dinvalid.mlir3 func.func @reduce_op_args_num_mismatch(%shape : !shape.shape, %init : !shape.size) {
5 %num_elements = shape.reduce(%shape, %init) : !shape.shape -> !shape.size {
14 func.func @reduce_op_arg0_wrong_type(%shape : !shape.shape, %init : !shape.size) {
16 %num_elements = shape.reduce(%shape, %init) : !shape.shape -> !shape.size {
29 %num_elements = shape.reduce(%shape, %init) : !shape.shape -> !shape.size {
51 %num_elements = shape.reduce(%shape, %init) : !shape.shape -> f32 {
62 %num_elements = shape.reduce(%shape, %init) : !shape.shape -> !shape.size {
73 %num_elements = shape.reduce(%shape, %init) : !shape.shape -> !shape.size {
152 : !shape.shape, !shape.shape -> tensor<?xindex>
235 %0 = shape.shape_of %arg : !shape.value_shape -> !shape.shape
[all …]
H A Dremove-shape-constraints.mlir8 func.func @f(%arg0 : !shape.shape, %arg1 : !shape.shape) -> index {
10 // REPLACE-NOT: shape.cstr_eq
14 %0 = shape.cstr_broadcastable %arg0, %arg1 : !shape.shape, !shape.shape
15 %1 = shape.assuming %0 -> index {
26 func.func @f(%arg0 : !shape.shape, %arg1 : !shape.shape) -> index {
28 // REPLACE-NOT: shape.cstr_eq
32 %0 = shape.cstr_eq %arg0, %arg1 : !shape.shape, !shape.shape
45 func.func @f(%arg0 : !shape.shape, %arg1 : !shape.shape) -> index {
48 %0 = shape.cstr_broadcastable %arg0, %arg1 : !shape.shape, !shape.shape
49 %1 = shape.cstr_eq %arg0, %arg1 : !shape.shape, !shape.shape
[all …]
H A Dshape-to-shape.mlir1 // RUN: mlir-opt -shape-to-shape-lowering -split-input-file %s | FileCheck %s
4 // CHECK-SAME: ([[ARG:%.*]]: !shape.shape) -> !shape.size
5 func.func @num_elements_to_reduce(%shape : !shape.shape) -> !shape.size {
6 %num_elements = shape.num_elements %shape : !shape.shape -> !shape.size
7 return %num_elements : !shape.size
9 // CHECK: [[C1:%.*]] = shape.const_size 1
10 // CHECK: [[NUM_ELEMENTS:%.*]] = shape.reduce([[ARG]], [[C1]]) : !shape.shape -> !shape.size
11 // CHECK: ^bb0({{.*}}: index, [[DIM:%.*]]: !shape.size, [[ACC:%.*]]: !shape.size
13 // CHECK: shape.yield [[NEW_ACC]] : !shape.size
22 %num_elements = shape.num_elements %shape : tensor<?xindex> -> index
[all …]
/llvm-project-15.0.7/mlir/docs/Dialects/
H A DShapeDialect.md43 %lhs_shape = shape.shape_of %lhs : !shape.value_shape -> !shape.shape
44 %rhs_shape = shape.shape_of %rhs : !shape.value_shape -> !shape.shape
45 %lhs_rank = shape.rank %lhs_shape : !shape.shape -> !shape.size
46 %rhs_rank = shape.rank %rhs_shape : !shape.shape -> !shape.size
51 !shape.size, !shape.size -> !shape.size
53 (!shape.shape, !shape.size) -> (!shape.shape, !shape.shape)
55 (!shape.shape, !shape.size) -> (!shape.shape, !shape.shape)
57 !shape.shape, !shape.shape -> !shape.shape
108 %lhs_rank = shape.rank %lhs_shape : !shape.shape -> !shape.size
121 (!shape.shape, !shape.size) -> !shape.shape
[all …]
/llvm-project-15.0.7/mlir/test/Analysis/
H A Dtest-shape-fn-report.mlir1 // RUN: mlir-opt %s --test-shape-function-report -verify-diagnostics
3 module attributes {shape.lib = [@shape_lib]} {
5 // expected-remark@+1 {{associated shape function: same_result_shape}}
7 attributes {shape.function = @shape_lib::@same_result_shape} {
15 // The shape function library with some local functions.
16 shape.function_library @shape_lib {
17 // Test shape function that returns the shape of input arg as result shape.
18 func @same_result_shape(%arg: !shape.value_shape) -> !shape.shape {
19 %0 = shape_of %arg : !shape.value_shape -> !shape.shape
20 return %0 : !shape.shape
/llvm-project-15.0.7/mlir/include/mlir/Dialect/Shape/IR/
H A DShapeOps.td119 %0 = shape.const_shape [] : !shape.shape
120 %1 = shape.const_shape [1, 2, 3] : !shape.shape
432 %c = shape.meet %a, %b, error="<reason>" : !shape.shape, !shape.shape -> !shape.shape
557 func.func @reduce(%shape : !shape.shape, %init : !shape.size) -> !shape.size {
561 (!shape.size, !shape.size) -> !shape.size
636 %shape = shape.value_as_shape %0 : tensor<2xi32> -> !shape.shape
638 %shape' = shape.const_shape [1, 2] : !shape.shape
671 (!shape.value_shape, !shape.value_shape) -> !shape.shape
672 %1 = shape.with_shape %b, %0 : !shape.value_shape, !shape.shape
674 (!shape.value_shape, !shape.value_shape) -> !shape.shape
[all …]
H A DShapeBase.td24 let name = "shape";
38 let cppNamespace = "::mlir::shape";
53 `shape.shape` represents either an unranked shape, a ranked shape with
56 `shape.size`.
83 tuple of a value (potentially unknown) and `shape.shape`. The value and
84 shape can either or both be unknown. If both the `value` and `shape` are
85 known, then the shape of `value` is conformant with `shape`. That is, the
86 shape of the value conforms to the shape of the ValueShape, so that if we
87 have ValueShape `(value, shape)` then `join(shape_of(value), shape)` would
99 elements (tensor<?xindex>). Like `!shape.shape`, it is used to represent
[all …]
/llvm-project-15.0.7/mlir/test/Conversion/ShapeToStandard/
H A Dconvert-shape-constraints.mlir1 // RUN: mlir-opt -pass-pipeline="func.func(convert-shape-constraints)" <%s | FileCheck %s
7 // CHECK: %[[RET:.*]] = shape.const_witness true
10 // CHECK: return %[[RET]] : !shape.witness
14 return %witness : !shape.witness
20 // CHECK: %[[RET:.*]] = shape.const_witness true
23 // CHECK: return %[[RET]] : !shape.witness
27 return %witness : !shape.witness
31 func.func @cstr_require(%arg0: i1) -> !shape.witness {
32 // CHECK: %[[RET:.*]] = shape.const_witness true
35 %witness = shape.cstr_require %arg0, "msg"
[all …]
H A Dshape-to-standard.mlir20 // CHECK: shape.add %[[LHS]], %[[RHS]] : !shape.size, !shape.size -> !shape.size
21 // CHECK: shape.mul %[[LHS]], %[[RHS]] : !shape.size, !shape.size -> !shape.size
22 %sum = shape.add %lhs, %rhs : !shape.size, !shape.size -> !shape.size
23 %prod = shape.mul %lhs, %rhs : !shape.size, !shape.size -> !shape.size
55 func.func @rank(%shape : !shape.shape) {
57 %rank = shape.rank %shape : !shape.shape -> !shape.size
195 // CHECK: shape.shape
196 %shape = shape.shape_of %arg : tensor<*xf32> -> !shape.shape
223 %shape = shape.shape_of %arg : tensor<1x2x3xf32> -> !shape.shape
347 func.func @broadcast(%a : tensor<?xindex>, %b : !shape.shape) -> !shape.shape {
[all …]
/llvm-project-15.0.7/mlir/include/mlir/IR/
H A DBuiltinTypes.h174 : shape(shape), elementType(elementType) {} in Builder()
177 shape = newShape; in setShape()
204 ArrayRef<int64_t> shape;
225 : shape(shape), elementType(elementType), encoding(encoding) {} in Builder()
228 shape = newShape; in setShape()
246 storage.append(shape.begin(), shape.end()); in dropDim()
256 storage.append(shape.begin(), shape.end()); in insertDim()
290 : shape(shape), elementType(elementType), in shape() argument
296 shape = newShape;
311 storage.append(shape.begin(), shape.end()); in dropDim()
[all …]
H A DBuiltinTypeInterfaces.td55 If the number of dimensions in the shape is unknown, the shape is "unranked".
63 type. If a shape is not provided, the current shape of the type is used.
66 "::llvm::Optional<::llvm::ArrayRef<int64_t>>":$shape,
103 static int64_t getNumElements(ArrayRef<int64_t> shape);
118 return $_type.cloneWith(shape, elementType);
120 /// Return a clone of this type with the given new shape.
121 auto clone(::llvm::ArrayRef<int64_t> shape) {
161 /// Returns if this type has a static shape and the shape is equal to
162 /// `shape` return true.
164 return hasStaticShape() && $_type.getShape() == shape;
[all …]
/llvm-project-15.0.7/llvm/unittests/Analysis/Inputs/ir2native_x86_64_model/
H A Dsaved_model.pbtxt34 name: "shape"
37 shape {
150 shape {
164 shape {
228 shape {
286 shape {
350 shape {
408 shape {
460 shape {
512 shape {
[all …]
/llvm-project-15.0.7/mlir/docs/
H A DShapeInference.md11 shape.
37 NOTE: The C++ shape functions are an intermediate step until the shape dialect
56 This section details the shape type inference dialect (`shape`). The initial
57 focus will be on shape functions that describe shape functions could be used in
63 of the output shape). As shown in the shaped container type, shape will be one
77 part of shape. But `shape function` is IMHO descriptive and metadata can span
179 shape inference.
200 1. Describe the shape inference approach that will use the shape functions;
216 * To enable scalable/cheap shape inference, the shape functions do not
219 the shape functions/constraints due to the shape functions.
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Shape/Transforms/
H A DBufferizableOpInterfaceImpl.cpp20 using namespace mlir::shape;
23 namespace shape { namespace
37 auto assumingOp = cast<shape::AssumingOp>(op); in getAliasingOpOperand()
43 auto yieldOp = dyn_cast<shape::AssumingYieldOp>( in getAliasingOpOperand()
63 auto assumingOp = cast<shape::AssumingOp>(op); in bufferize()
66 auto yieldOp = cast<shape::AssumingYieldOp>( in bufferize()
71 auto newOp = rewriter.create<shape::AssumingOp>( in bufferize()
116 assert(isa<shape::AssumingOp>(op->getParentOp()) && in getAliasingOpResult()
131 auto yieldOp = cast<shape::AssumingYieldOp>(op); in bufferize()
153 void mlir::shape::registerBufferizableOpInterfaceExternalModels( in registerBufferizableOpInterfaceExternalModels()
[all …]
/llvm-project-15.0.7/flang/lib/Evaluate/
H A Dshape.cpp36 const auto &shape{details->shape()}; in IsExplicitShape() local
80 Shape shape; in CreateShape() local
84 return shape; in CreateShape()
145 if (shape) { in AsShape()
161 if (shape) { in Fold()
730 Shape shape; in operator ()() local
739 if (shape.empty()) { in operator ()()
744 return shape; in operator ()()
752 Shape shape; in operator ()() local
760 return shape; in operator ()()
[all …]
/llvm-project-15.0.7/mlir/test/mlir-cpu-runner/
H A Dmemref-reshape.mlir30 // Initialize shape.
31 %shape = memref.alloc() : memref<2xindex>
34 memref.store %c3, %shape[%c0] : memref<2xindex>
35 memref.store %c2, %shape[%c1] : memref<2xindex>
38 call @reshape_ranked_memref_to_ranked(%input, %shape)
40 call @reshape_unranked_memref_to_ranked(%input, %shape)
42 call @reshape_ranked_memref_to_unranked(%input, %shape)
44 call @reshape_unranked_memref_to_unranked(%input, %shape)
47 memref.dealloc %shape : memref<2xindex>
53 %output = memref.reshape %input(%shape)
[all …]
/llvm-project-15.0.7/mlir/test/Integration/Dialect/SparseTensor/python/tools/
H A Dnp_to_sparse_tensor.py64 shape = ctypes.POINTER(ctypes.c_ulonglong)()
68 ctypes.byref(nse), ctypes.byref(shape),
72 shape = np.ctypeslib.as_array(shape, shape=[rank.value])
73 values = np.ctypeslib.as_array(values, shape=[nse.value])
74 indices = np.ctypeslib.as_array(indices, shape=[nse.value, rank.value])
75 return rank, nse, shape, values, indices
/llvm-project-15.0.7/mlir/include/mlir/ExecutionEngine/
H A DMemRefUtils.h45 inline std::array<int64_t, N> makeStrides(ArrayRef<int64_t> shape) { in makeStrides() argument
46 assert(shape.size() == N && "expect shape specification to match rank"); in makeStrides()
52 running *= shape[idx]; in makeStrides()
64 makeStridedMemRefDescriptor(T *ptr, T *alignedPtr, ArrayRef<int64_t> shape, in makeStridedMemRefDescriptor() argument
66 assert(shape.size() == N); in makeStridedMemRefDescriptor()
72 std::copy(shape.begin(), shape.end(), descriptor.sizes); in makeStridedMemRefDescriptor()
87 assert(shape.size() == N);
146 ArrayRef<int64_t> shape, ArrayRef<int64_t> shapeAlloc = {},
156 shapeAlloc = shape; in freeFunc()
157 assert(shape.size() == Rank); in freeFunc()
[all …]
/llvm-project-15.0.7/mlir/test/python/dialects/linalg/opdsl/
H A Demit_pooling.py53 def test_f32i32_max_pooling(input, shape, init_result): argument
55 input, shape, outs=[init_result], strides=[2, 4], dilations=[1, 2])
64 def test_f32i32_max_unsigned_pooling(input, shape, init_result): argument
67 shape,
86 def test_f32f32_max_pooling(input, shape, init_result): argument
97 def test_f32i32_min_pooling(input, shape, init_result): argument
100 shape,
113 def test_f32i32_min_unsigned_pooling(input, shape, init_result): argument
116 shape,
129 def test_f32f32_min_pooling(input, shape, init_result): argument
[all …]
/llvm-project-15.0.7/llvm/test/Analysis/Dominators/
H A Dprint-dot-dom.ll12 ; TEST1-NEXT: Node0x[[A_ID]] [shape=record,label="{a:
13 ; TEST1-NEXT: Node0x[[C_ID]] [shape=record,label="{c:
16 ; TEST1-NEXT: Node0x[[D_ID]] [shape=record,label="{d:
17 ; TEST1-NEXT: Node0x[[E_ID]] [shape=record,label="{e:
18 ; TEST1-NEXT: Node0x[[B_ID]] [shape=record,label="{b:
42 ; TEST2: Node0x[[EntryID:.*]] [shape=record,label="{entry:
44 ; TEST2-NEXT: Node0x[[A_ID]] [shape=record,label="{a:
46 ; TEST2-NEXT: Node0x[[B_ID]] [shape=record,label="{b:
48 ; TEST2-NEXT: Node0x[[C_ID]] [shape=record,label="{c:
51 ; TEST2-NEXT: Node0x[[D_ID]] [shape=record,label="{d:
[all …]
/llvm-project-15.0.7/flang/test/Fir/
H A Dinvalid.fir22 %0 = fir.shape %c10 : (index) -> !fir.shape<1>
149 %shape = fir.shape %c100, %c50 : (index, index) -> !fir.shape<2>
161 %shape = fir.shape %c100, %c50 : (index, index) -> !fir.shape<2>
173 %shape = fir.shape %c100, %c50 : (index, index) -> !fir.shape<2>
188 %shape = fir.shape %c100 : (index) -> !fir.shape<1>
211 %shape = fir.shape %c100, %c50 : (index, index) -> !fir.shape<2>
508 %shape = fir.shape %n : (index) -> !fir.shape<1>
536 %shape = fir.shape %n : (index) -> !fir.shape<1>
546 %shape = fir.shape %n, %n : (index, index) -> !fir.shape<2>
556 %shape = fir.shape %n : (index) -> !fir.shape<1>
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Shape/IR/
H A DShape.cpp31 using namespace mlir::shape;
43 bool shape::isExtentTensorType(Type type) { in isExtentTensorType()
541 for (auto &shape : shapes) in matchAndRewrite() local
920 if (!shape) in inferReturnTypes()
1343 if (!shape) in fold()
1422 Attribute shape = operands[0]; in fold() local
1423 if (!shape) in fold()
1719 int64_t rank = shape.size(); in fold()
1723 splitPoint += shape.size(); in fold()
1738 auto shape = llvm::to_vector<6>( in fold() local
[all …]
/llvm-project-15.0.7/polly/docs/experiments/matmul/
H A Dscopsonly.main.dot4 Node0x7fffdb5cbd10 [shape=record,label="{entry}"];
6 Node0x7fffdb5c7140 [shape=record,label="{entry.split}"];
8 Node0x7fffdb5c7200 [shape=record,label="{for.cond1.preheader}"];
10 Node0x7fffdb5ccd60 [shape=record,label="{for.body3}"];
12 Node0x7fffdb5ccd80 [shape=record,label="{for.body8}"];
15 Node0x7fffdb5cce20 [shape=record,label="{for.inc25}"];
18 Node0x7fffdb5cce80 [shape=record,label="{for.inc28}"];
21 Node0x7fffdb5ccee0 [shape=record,label="{for.end30}"];

12345678910>>...17