- Apr 12, 2021
-
-
Tobias Gysi authored
The `linalg.index` operation provides access to the iteration indexes of immediately enclosing linalg operations. It takes a dimension `dim` attribute and returns the iteration index in the given dimension. Having `linalg.index` allows us to unify `linalg.generic` and `linalg.indexed_generic` and also enables index access in named operations. Differential Revision: https://reviews.llvm.org/D100292
-
- Apr 09, 2021
-
-
Frederik Gossen authored
Differential Revision: https://reviews.llvm.org/D100198
-
Frederik Gossen authored
Differential Revision: https://reviews.llvm.org/D100105
-
Frederik Gossen authored
Differential Revision: https://reviews.llvm.org/D100104
-
Frederik Gossen authored
Differential Revision: https://reviews.llvm.org/D100042
-
MaheshRavishankar authored
Recent change enable dropping unit-trip loops of "reduction" iterator type as well. This is fine as long as there is one other "reduction" iterator in the operation. Without this the initialized value (value of `out`) is not read which leads to a correctness issue. Also fix a bug in the `fill` -> `tensor_reshape` folding. The `out` operand of the `fill` needs to be reshaped to get the `out` operand of the generated `fill` operation. Differential Revision: https://reviews.llvm.org/D100145
-
Weiwei Li authored
This patch doesn't support the optional operands of ImageDrefGather. The support of optional operands will be implemented later. co-authered-by:
Alan Liu <alanliu.yf@gmail.com> Differential Revision: https://reviews.llvm.org/D100128
-
- Apr 08, 2021
-
-
Hanhan Wang authored
This patch unconditionally converts i1 types to i8 types on memrefs. If the extensions or capabilities are not met, they will be converted to i32. Hence the logic in IntLoadPattern and IntStorePattern are also updated. Also added the implementation of SPIRVTypeConverter::getOptions(). Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D99724
-
Lei Zhang authored
Non-32-bit scalar types require special hardware support that may not exist on all GPUs. This is reflected in SPIR-V as that non-32-bit scalar types require special capabilities or extensions. Previously when there is a non-32-bit type and no native support, we unconditionally emulate it with 32-bit ones. This isn't good given that it can have implications over ABI and data layout consistency. This commit introduces an option to control whether to use 32-bit types to emulate. Differential Revision: https://reviews.llvm.org/D100059
-
Lei Zhang authored
Per the TypeConverter API contract, returning `llvm:None` means other conversion rules should be tried. But we only have one rule per input type. So there is no need to try others and we can just directly fail, which should return `nullptr`. This avoids unnecessary checks. Differential Revision: https://reviews.llvm.org/D100058
-
Tobias Gysi authored
The patch enables the use of index type in vectors. It is a prerequisite to support vectorization for indexed Linalg operations. This refactoring became possible due to the newly introduced data layout infrastructure. The data layout of a module defines the bitwidth of the index type needed to verify bitcasts and similar vector operations. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D99948
-
- Apr 07, 2021
-
-
Haruki Imai authored
When allocLikeOp is updated in alloc constant folding, alighnment attribute was ignored. This patch fixes it. Signed-off-by:
Haruki Imai <imaihal@jp.ibm.com> Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D99882
-
Aart Bik authored
Some sparse matrices operate on integral values (in contrast with the common f32 and f64 values). This CL expands the compiler and runtime support to deal with several common type combinations. Reviewed By: bixia Differential Revision: https://reviews.llvm.org/D99999
-
Matthias Springer authored
Also factors out out-of-bounds mask generation from vector.transfer_read/write into a new MaterializeTransferMask pattern. Differential Revision: https://reviews.llvm.org/D100001
-
Jacques Pienaar authored
When both arguments are the same for these ops, propagate this argument.
-
- Apr 06, 2021
-
-
Nicolas Vasilache authored
Linalg fusion on tensors has mismatching assumptions on the operand side than on the region bbArg side. Relax the behavior on the operand/indexing map side so that we better support output operands that may also be read from. Differential revision: https://reviews.llvm.org/D99499
-
MaheshRavishankar authored
Right now Elementwise operations fusion in Linalg fuses everything it can. This can run up against resource limits of the target hardware without some checks. This patch adds a callback function that clients can use to implement a cost function. When two elementwise operations are deemed structurally fusable, the callback can be used to control if the fusion applies. Differential Revision: https://reviews.llvm.org/D99820
-
- Apr 05, 2021
-
-
MaheshRavishankar authored
The moved `populate` methods are only relevant to Linalg operations. So they are better of in `linalg` namespace. Also rename `populateLinalgTensorOpsFusionPatterns` to `populateElementwiseOpsFusionPatterns`. This makes the scope of these patterns explicit and disambiguates it with fusion on tensors using tile + fuse. Differential Revision: https://reviews.llvm.org/D99819
-
- Apr 02, 2021
-
-
Lei Zhang authored
This commit add utility functions for creating push constant storage variable and loading values from it. Along the way, performs some clean up: * Deleted `setABIAttrs`, which is just a 4-liner function with one user. * Moved `SPIRVConverstionTarget` into `mlir` namespace, to be consistent with `SPIRVTypeConverter` and `LLVMConversionTarget`. Reviewed By: mravishankar Differential Revision: https://reviews.llvm.org/D99725
-
Aart Bik authored
Rationale: Small indices and values, when allowed by the required range of the input tensors, can reduce the memory footprint of sparse tensors even more. Note, however, that we must be careful zero extending the values (since sparse tensors never use negatives for indexing), but LLVM treats the index type as signed in most memory operations (like the scatter and gather). This CL dots all the i's in this regard. Reviewed By: bixia Differential Revision: https://reviews.llvm.org/D99777
-
- Apr 01, 2021
-
-
Aden Grue authored
Differential Revision: https://reviews.llvm.org/D99229
-
- Mar 31, 2021
-
-
Matthias Springer authored
This is in preparation for adding a new "mask" operand. The existing "masked" attribute was used to specify dimensions that may be out-of-bounds. Such transfers can be lowered to masked load/stores. The new "in_bounds" attribute is used to specify dimensions that are guaranteed to be within bounds. (Semantics is inverted.) Differential Revision: https://reviews.llvm.org/D99639
-
Nicolas Vasilache authored
This revision adds support to properly add the body of registered builtin named linalg ops. At this time, indexing_map and iterator_type support is still missing so the op is not executable yet. Differential Revision: https://reviews.llvm.org/D99578
-
Alexander Belyaev authored
This reverts commit 883912ab.
-
- Mar 30, 2021
-
-
Inho Seo authored
This verification is to check if the indices for static shaped operands on linalgOps access out of bound memory or not. For dynamic shaped operands, we would be able to check it on runtime stage. Found several invalid Linalg ops testcases, and fixed them. Reviewed By: hanchung Differential Revision: https://reviews.llvm.org/D98390
-
- Mar 29, 2021
-
-
MaheshRavishankar authored
Differential Revision: https://reviews.llvm.org/D99533
-
MaheshRavishankar authored
A new `InterfaceMethod` is added to `InferShapedTypeOpInterface` that allows an operation to return the `Value`s for each dim of its results. It is intended for the case where the `Value` returned for each dim is computed using the operands and operation attributes. This interface method is for cases where the result dim of an operation can be computed independently, and it avoids the need to aggregate all dims of a result into a single shape value. This also implies that this is not suitable for cases where the result type is unranked (for which the existing interface methods is to be used). Also added is a canonicalization pattern that uses this interface and resolves the shapes of the output in terms of the shapes of the inputs. Moving Linalg ops to use this interface, so that many canonicalization patterns implemented for individual linalg ops to achieve the same result can be removed in favor of the added canonicalization pattern. Differential Revision: https://reviews.llvm.org/D97887
-
MaheshRavishankar authored
Subtensor operations that are taking a slice out of a tensor that is unit-extent along a dimension can be rewritten to drop that dimension. Differential Revision: https://reviews.llvm.org/D99226
-
MaheshRavishankar authored
Drop usage of `emitRemark` and use `notifyMatchFailure` instead to avoid unnecessary spew during compilation. Differential Revision: https://reviews.llvm.org/D99485
-
thomasraoux authored
Convert transfer_read ops with permutation maps into simpler transfer_read with minority map + vector.braodcast and vector.transpose. And transfer_read with leading dimensions broacast into transfer_read of lower rank. Differential Revision: https://reviews.llvm.org/D99019
-
Frederik Gossen authored
Differential Revision: https://reviews.llvm.org/D99161
-
Alexander Belyaev authored
This reverts commit 06b03800. Until some kind of support for region args is added.
-
Julian Gross authored
Add a new clone operation to the memref dialect. This operation implicitly copies data from a source buffer to a new buffer. In contrast to the linalg.copy operation, this operation does not accept a target buffer as an argument. Instead, this operation performs a conceptual allocation which does not need to be performed manually. Furthermore, this operation resolves the dependency from the linalg-dialect in the BufferDeallocation pass. In addition, we also extended the canonicalization patterns to fold clone operations. The copy removal pass has been removed. Differential Revision: https://reviews.llvm.org/D99172
-
KareemErgawy-TomTom authored
This patch folds the following pattern: ``` %arg0 = ... %0 = sexti %arg0 : i1 to i8 %1 = trunci %0 : i8 to i1 ``` into just `%arg0`. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D99464
-
- Mar 27, 2021
-
-
KareemErgawy-TomTom authored
This patch folds the following pattern: ``` %arg0 = ... %0 = zexti %arg0 : i1 to i8 %1 = trunci %0 : i8 to i1 ``` into just `%arg0`. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D99453
-
Jacques Pienaar authored
Now that NoTerminator is possible this op can be removed/it was only needed structurally before. NFC.
-
- Mar 25, 2021
-
-
Alexander Belyaev authored
Folds away TiledLoopOp output tensors when the following conditions are met: * result of `linalg.tiled_loop` has no uses * output tensor is the argument of `linalg.yield` Example: ``` %0 = linalg.tiled_loop ... outs (%out, %out_buf:tensor<...>, memref<...>) { ... linalg.yield %out : tensor ... } ``` Becomes ``` linalg.tiled_loop ... outs (%out_buf:memref<...>) { ... linalg.yield } ``` Differential Revision: https://reviews.llvm.org/D99333
-
Mehdi Amini authored
Define a `NoTerminator` traits that allows operations with a single block region to not provide a terminator In particular for Graph Regions, the terminator needs is just a historical artifact of the generalization of MLIR from CFG region. Operations like Module don't need a terminator, and before Module migrated to be an operation with region there wasn't any needed. To validate the feature, the ModuleOp is migrated to use this trait and the ModuleTerminator operation is deleted. This patch is likely to break clients, if you're in this case: - you may iterate on a ModuleOp with `getBody()->without_terminator()`, the solution is simple: just remove the ->without_terminator! - you created a builder with `Builder::atBlockTerminator(module_body)`, just use `Builder::atBlockEnd(module_body)` instead. - you were handling ModuleTerminator: it isn't needed anymore. - for generic code, a `Block::mayNotHaveTerminator()` may be used. Differential Revision: https://reviews.llvm.org/D98468
-
- Mar 24, 2021
-
-
Lei Zhang authored
For such op chains, we can create new linalg.fill ops with the result type of the linalg.tensor_reshape op. Differential Revision: https://reviews.llvm.org/D99116
-
Lei Zhang authored
init tensor operands also has indexing map and generally follow the same constraints we expect for non-init-tensor operands. Differential Revision: https://reviews.llvm.org/D99115
-