- Mar 19, 2021
-
-
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
-
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
-
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
-
Aart Bik authored
Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D98742
-
Ahmed Taei authored
Differential Revision: https://reviews.llvm.org/D98198
-
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
-
River Riddle authored
-
River Riddle authored
With this revision, all builtin attributes and types will have been moved to the ODS generator. Differential Revision: https://reviews.llvm.org/D98474
-
River Riddle authored
Some parameters to attributes and types rely on special comparison routines other than operator== to ensure equality. This revision adds support for those parameters by allowing them to specify a `comparator` code block that determines if `$_lhs` and `$_rhs` are equal. An example of one of these paramters is APFloat, which requires `bitwiseIsEqual` for bitwise comparison (which we want for attribute equality). Differential Revision: https://reviews.llvm.org/D98473
-
- Mar 16, 2021
-
-
Eugene Zhulenev authored
[mlir] Add lowering from math::Log1p to LLVM Reviewed By: cota Differential Revision: https://reviews.llvm.org/D98662
-
River Riddle authored
Supporting ranges in the byte code requires additional complexity, given that a range can't be easily representable as an opaque void *, as is possible with the existing bytecode value types (Attribute, Type, Value, etc.). To enable representing a range with void *, an auxillary storage is used for the actual range itself, with the pointer being passed around in the normal byte code memory. For type ranges, a TypeRange is stored. For value ranges, a ValueRange is stored. The above problem represents a majority of the complexity involved in this revision, the rest is adapting/adding byte code operations to support the changes made to the PDL interpreter in the parent revision. After this revision, PDL will have initial end-to-end support for variadic operands/results. Differential Revision: https://reviews.llvm.org/D95723
-
River Riddle authored
This revision extends the PDL Interpreter dialect to add support for variadic operands and results, with ranges of these values represented via the recently added !pdl.range type. To support this extension, three new operations have been added that closely match the single variant: * pdl_interp.check_types : Compare a range of types with a known range. * pdl_interp.create_types : Create a constant range of types. * pdl_interp.get_operands : Get a range of operands from an operation. * pdl_interp.get_results : Get a range of results from an operation. * pdl_interp.switch_types : Switch on a range of types. This revision handles adding support in the interpreter dialect and the conversion from PDL to PDLInterp. Support for variadic operands and results in the bytecode will be added in a followup revision. Differential Revision: https://reviews.llvm.org/D95722
-
River Riddle authored
This revision extends the PDL dialect to add support for variadic operands and results, with ranges of these values represented via the recently added !pdl.range type. To support this extension, three new operations have been added that closely match the single variant: * pdl.operands : Define a range of input operands. * pdl.results : Extract a result group from an operation. * pdl.types : Define a handle to a range of types. Support for these in the pdl interpreter dialect and byte code will be added in followup revisions. Differential Revision: https://reviews.llvm.org/D95721
-
River Riddle authored
This has a numerous amount of benefits, given the overly clunky nature of CreateNativeOp: * Users can now call into arbitrary rewrite functions from inside of PDL, allowing for more natural interleaving of PDL/C++ and enabling for more of the pattern to be in PDL. * Removes the need for an additional set of C++ functions/registry/etc. The new ApplyNativeRewriteOp will use the same PDLRewriteFunction as the existing RewriteOp. This reduces the API surface area exposed to users. This revision also introduces a new PDLResultList class. This class is used to provide results of native rewrite functions back to PDL. We introduce a new class instead of using a SmallVector to simplify the work necessary for variadics, given that ranges will require some changes to the structure of PDLValue. Differential Revision: https://reviews.llvm.org/D95720
-
River Riddle authored
Up until now, results have been represented as additional results to a pdl.operation. This is fairly clunky, as it mismatches the representation of the rest of the IR constructs(e.g. pdl.operand) and also isn't a viable representation for operations returned by pdl.create_native. This representation also creates much more difficult problems when factoring in support for variadic result groups, optional results, etc. To resolve some of these problems, and simplify adding support for variable length results, this revision extracts the representation for results out of pdl.operation in the form of a new `pdl.result` operation. This operation returns the result of an operation at a given index, e.g.: ``` %root = pdl.operation ... %result = pdl.result 0 of %root ``` Differential Revision: https://reviews.llvm.org/D95719
-
Aart Bik authored
This adds a new integration test. However, it also adapts to a recent memref.XXX change for existing tests Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D98680
-
Adrian Kuegel authored
Differential Revision: https://reviews.llvm.org/D97542
-
David Zarzycki authored
Lit as it exists today has three hacks that allow users to run tests earlier: 1) An entire test suite can set the `is_early` boolean. 2) A very recently introduced "early_tests" feature. 3) The `--incremental` flag forces failing tests to run first. All of these approaches have problems. 1) The `is_early` feature was until very recently undocumented. Nevertheless it still lacks testing and is a imprecise way of optimizing test starting times. 2) The `early_tests` feature requires manual updates and doesn't scale. 3) `--incremental` is undocumented, untested, and it requires modifying the *source* file system by "touching" the file. This "touch" based approach is arguably a hack because it confuses editors (because it looks like the test was modified behind the back of the editor) and "touching" the test source file doesn't work if the test suite is read only from the perspective of `lit` (via advanced filesystem/build tricks). This patch attempts to simplify and address all of the above problems. This patch formalizes, documents, tests, and defaults lit to recording the execution time of tests and then reordering all tests during the next execution. By reordering the tests, high core count machines run faster, sometimes significantly so. This patch also always runs failing tests first, which is a positive user experience win for those that didn't know about the hidden `--incremental` flag. Finally, if users want, they can _optionally_ commit the test timing data (or a subset thereof) back to the repository to accelerate bots and first-time runs of the test suite. Reviewed By: jhenderson, yln Differential Revision: https://reviews.llvm.org/D98179
-
Lorenzo Chelini authored
scf::ForOp: Fold away iterator arguments with no use and for which the corresponding input is yielded Enhance 'ForOpIterArgsFolder' to remove unused iteration arguments in a scf::ForOp. If the block argument corresponding to the given iterator has no use and the yielded value equals the input, we fold it away. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D98503
-
Aart Bik authored
The Intel Advanced Matrix Extensions (AMX) provides a tile matrix multiply unit (TMUL), a tile control register (TILECFG), and eight tile registers TMM0 through TMM7 (TILEDATA). This new MLIR dialect provides a bridge between MLIR concepts like vectors and memrefs and the lower level LLVM IR details of AMX. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D98470
-
- Mar 15, 2021
-
-
Alex Zinenko authored
The commit in question changed the syntax but did not update the runner tests. This also required registering the MemRef dialect for custom parser to work correctly.
-
Alex Zinenko authored
The commit in question moved some ops across dialects but did not update some of the target-specific integration tests that use these ops, presumably because the corresponding target hardware was not available. Fix these tests.
-
Alex Zinenko authored
A previous commit moved multiple ops from Standard to MemRef dialect. Some of these ops are exercised in Python bindings. Enable bindings for the newly created MemRef dialect and update a test accordingly.
-
Alex Zinenko authored
The patch in question broke the build with shared libraries due to missing dependencies, one of which would have been circular between MLIRStandard and MLIRMemRef if added. Fix this by moving more code around and swapping the dependency direction. MLIRMemRef now depends on MLIRStandard, but MLIRStandard does _not_ depend on MLIRMemRef. Arguably, this is the right direction anyway since numerous libraries depend on MLIRStandard and don't necessarily need to depend on MLIRMemref. Other otable changes include: - some EDSC code is moved inline to MemRef/EDSC/Intrinsics.h because it creates MemRef dialect operations; - a utility function related to shape moved to BuiltinTypes.h/cpp because it only realtes to shaped types and not any particular dialect (standard dialect is erroneously believed to contain MemRefType); - a Python test for the standard dialect is disabled completely because the ops it tests moved to the new MemRef dialect, but it is not exposed to Python bindings, and the change for that is non-trivial.
-
Julian Gross authored
Create the memref dialect and move dialect-specific ops from std dialect to this dialect. Moved ops: AllocOp -> MemRef_AllocOp AllocaOp -> MemRef_AllocaOp AssumeAlignmentOp -> MemRef_AssumeAlignmentOp DeallocOp -> MemRef_DeallocOp DimOp -> MemRef_DimOp MemRefCastOp -> MemRef_CastOp MemRefReinterpretCastOp -> MemRef_ReinterpretCastOp GetGlobalMemRefOp -> MemRef_GetGlobalOp GlobalMemRefOp -> MemRef_GlobalOp LoadOp -> MemRef_LoadOp PrefetchOp -> MemRef_PrefetchOp ReshapeOp -> MemRef_ReshapeOp StoreOp -> MemRef_StoreOp SubViewOp -> MemRef_SubViewOp TransposeOp -> MemRef_TransposeOp TensorLoadOp -> MemRef_TensorLoadOp TensorStoreOp -> MemRef_TensorStoreOp TensorToMemRefOp -> MemRef_BufferCastOp ViewOp -> MemRef_ViewOp The roadmap to split the memref dialect from std is discussed here: https://llvm.discourse.group/t/rfc-split-the-memref-dialect-from-std/2667 Differential Revision: https://reviews.llvm.org/D98041
-
Alex Zinenko authored
This reverts commit b5d9a3c9. The commit introduced a memory error in canonicalization/operation walking that is exposed when compiled with ASAN. It leads to crashes in some "release" configurations.
-
Frederik Gossen authored
Remove redundant operands and fold if only one left. Differential Revision: https://reviews.llvm.org/D98402
-