- Mar 21, 2021
-
-
Chris Lattner authored
This updates the codebase to pass the context when creating an instance of OwningRewritePatternList, and starts removing extraneous MLIRContext parameters. There are many many more to be removed. Differential Revision: https://reviews.llvm.org/D99028
-
Chris Lattner authored
This reapplies b5d9a3c9 / https://reviews.llvm.org/D98609 with a one line fix in processExistingConstants to skip() when erasing a constant we've already seen. Original commit message: 1) Change the canonicalizer to walk the function in top-down order instead of bottom-up order. This composes well with the "top down" nature of constant folding and simplification, reducing iterations and re-evaluation of ops in simple cases. 2) Explicitly enter existing constants into the OperationFolder table before canonicalizing. Previously we would "constant fold" them and rematerialize them, wastefully recreating a bunch fo constants, which lead to pointless memory traffic. Both changes together provide a 33% speedup for canonicalize on some mid-size CIRCT examples. One artifact of this change is that the constants generated in normal pattern application get inserted at the top of the function as the patterns are applied. Because of this, we get "inverted" constants more often, which is an aethetic change to the IR but does permute some testcases. Differential Revision: https://reviews.llvm.org/D99006
-
- Mar 20, 2021
-
-
Butygin authored
* Fold SelectOp when both true and false args are same SSA value * Fold some cmp + select patterns Differential Revision: https://reviews.llvm.org/D98576
-
Butygin authored
* Do we need a threshold on maximum number of Yeild arguments processed (maximum number of SelectOp's to be generated)? * Had to modify some old IfOp tests to not get optimized by this pattern Differential Revision: https://reviews.llvm.org/D98592
-
Rob Suderman authored
Reverse lowers to a linalg.generic op by reversing the read order in the index map. Differential Revision: https://reviews.llvm.org/D98997
-
Mehdi Amini authored
This makes the annotation tied to the operand and the use of a keyword more explicit/readable on what it means. Differential Revision: https://reviews.llvm.org/D99001
-
Stella Laurenzo authored
* Broken by https://reviews.llvm.org/rG1a75be0023cd80fd8560d689999a63d4368c90e6
-
Stella Laurenzo authored
* Moves this out of a test case where it was being developed to good effect and generalizes it. * Having tried a number of things like this, I think this balances concerns reasonably well. Differential Revision: https://reviews.llvm.org/D98989
-
River Riddle authored
Now that all of the builtin dialect is generated from ODS, its documentation in LangRef can be split out and replaced with references to Dialects/Builtin.md. LangRef is quite crusty right now and should really have a full cleanup done in a followup. Differential Revision: https://reviews.llvm.org/D98562
-
Chris Lattner authored
Differential Revision: https://reviews.llvm.org/D98998
-
River Riddle authored
This removes the need to construct an APInt for each value, given that it is guaranteed to contain 32 bit elements. BEGIN_PUBLIC ...text exposed to open source public git repo... END_PUBLIC
-
River Riddle authored
This allows for notifying callers when operations/blocks get erased, which is especially useful for the greedy pattern driver. The current greedy pattern driver "throws away" all information on constants in the operation folder because it doesn't know if they get erased or not. By passing in RewriterBase, we can directly track this and prevent the need for the pattern driver to rediscover all of the existing constants. In some situations this cuts the compile time of the canonicalizer in half. Differential Revision: https://reviews.llvm.org/D98755
-
- Mar 19, 2021
-
-
River Riddle authored
This was missed when dynamic pass pipelines were added, and is necessary for maximizing the performance/parallelism potential of the pass pipeline.
-
Stella Laurenzo authored
* IRModules.cpp -> (IRCore.cpp, IRAffine.cpp, IRAttributes.cpp, IRTypes.cpp). * The individual pieces now compile in the 5-15s range whereas IRModules.cpp was starting to approach a minute (didn't capture a before time). * More fine grained splitting is possible, but this represents the most obvious. Differential Revision: https://reviews.llvm.org/D98978
-
Butygin authored
Previously low benefit op-specific patterns never had a chance to match even if high benefit op-agnostic pattern failed to match. This was already fixed upstream, this commit just adds testscase Differential Revision: https://reviews.llvm.org/D98513
-
Benjamin Kramer authored
Transforms.cpp:586:16: error: unused variable 'v' [-Werror,-Wunused-variable] for (Value v : operands) ^
-
Rob Suderman authored
Handles lowering from the tosa CastOp to the equivalent linalg lowering. It includes support for interchange between bool, int, and floating point. Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D98828
-
Rob Suderman authored
Adds lowerings for logical_* boolean operations. Each of these ops only operate on booleans allowing simple lowerings. Reviewed By: NatashaKnk Differential Revision: https://reviews.llvm.org/D98910
-
Stella Laurenzo authored
* Makes the wrapped functions of the `@linalg_structured_op` decorator callable such that they emit IR imperatively when invoked. * There are numerous TODOs that I will keep working through to achieve generality. * Will true up exception handling tests as the feature progresses (for things that are actually errors once everything is implemented). * Includes the addition of an `isinstance` method on concrete types in the Python API. Differential Revision: https://reviews.llvm.org/D98754
-
thomasraoux authored
-
Nicolas Vasilache authored
-
Christian Sigg authored
Also remove populate patterns function and binary annotation name option. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D98930
-
Alexander Belyaev authored
https://llvm.discourse.group/t/rfc-add-linalg-tileop/2833 Differential Revision: https://reviews.llvm.org/D98900
-
Christian Sigg authored
All users have been converted to gpu::SerializeToBlobPass. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D98928
-
Christian Sigg authored
This change combines for ROCm what was done for CUDA in D97463, D98203, D98360, and D98396. I did not try to compile SerializeToHsaco.cpp or test mlir/test/Integration/GPU/ROCM because I don't have an AMD card. I fixed the things that had obvious bit-rot though. Reviewed By: whchung Differential Revision: https://reviews.llvm.org/D98447
-
Andrew Young authored
When deleting operations in DCE, the algorithm uses a post-order walk of the IR to ensure that value uses were erased before value defs. Graph regions do not have the same structural invariants as SSA CFG, and this post order walk could delete value defs before uses. This problem is guaranteed to occur when there is a cycle in the use-def graph. This change stops DCE from visiting the operations and blocks in any meaningful order. Instead, we rely on explicitly dropping all uses of a value before deleting it. Reviewed By: mehdi_amini, rriddle Differential Revision: https://reviews.llvm.org/D98919
-
Vladislav Vinogradov authored
Add extra `type.isa<FloatType>()` check to `FloatAttr::get(Type, double)` method. Otherwise it tries to call `type.cast<FloatType>()`, which fails with assertion in Debug mode. The `!type.isa<FloatType>()` case just redirercts the call to `FloatAttr::get(Type, APFloat)`, which will perform the actual check and emit appropriate error. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D98764
-
Rob Suderman authored
This adds a tosa.apply_scale operation that handles the scaling operation common to quantized operatons. This scalar operation is lowered in TosaToStandard. We use a separate ApplyScale factorization as this is a replicable pattern within TOSA. ApplyScale can be reused within pool/convolution/mul/matmul for their quantized variants. Tests are added to both tosa-to-standard and tosa-to-linalg-on-tensors that verify each pass is correct. Reviewed By: silvas Differential Revision: https://reviews.llvm.org/D98753
-
- Mar 18, 2021
-
-
Rob Suderman authored
Includes lowering for tosa.concat with indice computation with subtensor insert operations. Includes tests along two different indices. Differential Revision: https://reviews.llvm.org/D98813
-
thomasraoux authored
-
Mehdi Amini authored
This reverts commit 32a744ab. CI is broken: test/Dialect/Linalg/bufferize.mlir:274:12: error: CHECK: expected string not found in input // CHECK: %[[MEMREF:.*]] = tensor_to_memref %[[IN]] : memref<?xf32> ^
-
Eugene Zhulenev authored
`BufferizeAnyLinalgOp` fails because `FillOp` is not a `LinalgGenericOp` and it fails while reading operand sizes attribute. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D98671
-
thomasraoux authored
Differential Revision: https://reviews.llvm.org/D97346
-
thomasraoux authored
This propagates the affine map to transfer_read op in case it is not a minor identity map. Differential Revision: https://reviews.llvm.org/D98523
-
lorenzo chelini authored
-
Alexander Belyaev authored
Also use `ArrayAttr` to pass iterator pass to the TiledLoopOp builder. Differential Revision: https://reviews.llvm.org/D98871
-
David Truby authored
Co-authored-by:
Kiran Chandramohan <kiran.chandramohan@arm.com> Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D92327
-
Vladislav Vinogradov authored
Do not limit the number of arguments in rewriter pattern. Introduce separate `FmtStrVecObject` class to handle format of variadic `std::string` array. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D97839
-
Frederik Gossen authored
This covers cases that are not folded away because the extent tensor type becomes more concrete in the process. Differential Revision: https://reviews.llvm.org/D98782
-