- 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
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
-
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
-
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
-
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
-
Rob Suderman authored
Lowering to subtensor is added for tosa.slice operator. Differential Revision: https://reviews.llvm.org/D98825
-
- Mar 17, 2021
-
-
River Riddle authored
This has been a TODO for a while, and prevents breakages for attributes/types that contain floats that can't roundtrip outside of the hex format. Differential Revision: https://reviews.llvm.org/D98808
-
Vladislav Vinogradov authored
Add a feature to `EnumAttr` definition to generate specialized Attribute class for the particular enumeration. This class will inherit `StringAttr` or `IntegerAttr` and will override `classof` and `getValue` methods. With this class the enumeration predicate can be checked with simple RTTI calls (`isa`, `dyn_cast`) and it will return the typed enumeration directly instead of raw string/integer. Based on the following discussion: https://llvm.discourse.group/t/rfc-add-enum-attribute-decorator-class/2252 Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D97836
-
lorenzo chelini authored
'ForOpIterArgsFolder' can now remove iterator arguments (and corresponding results) with no use. Example: ``` %cst = constant 32 : i32 %0:2 = scf.for %arg1 = %lb to %ub step %step iter_args(%arg2 = %arg0, %arg3 = %cst) -> (i32, i32) { %1 = addu %arg2, %cst : i32 scf.yield %1, %1 : i32, i32 } use(%0#0) ``` %arg3 is not used in the block, and its corresponding result `%0#1` has no use, thus remove the iter argument. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D98711
-
Stephan Herhut authored
Returning structs directly in LLVM does not necessarily align with the C ABI of the platform. This might happen to work on Linux but for small structs this breaks on Windows. With this change, the wrappers work platform independently. Differential Revision: https://reviews.llvm.org/D98725
-
Gaurav Shukla authored
This commit fixes the lowering of `Affine.IfOp` to `SCF.IfOp` in the presence of yield values. These changes have been made as a part of `-lower-affine` pass. Differential Revision: https://reviews.llvm.org/D98760
-