- Jul 20, 2020
-
-
Jakub Lichman authored
This commit adds functionality needed for implementation of convolutions with linalg.generic op. Since linalg.generic right now expects indexing maps to be just permutations, offset indexing needed in convolutions is not possible. Therefore in this commit we address the issue by adding support for symbols inside indexing maps which enables more advanced indexing. The upcoming commit will solve the problem of computing loop bounds from such maps. Differential Revision: https://reviews.llvm.org/D83158
-
Nicolas Vasilache authored
This revision improves and makes better use of OpInterfaces for the Vector dialect. Differential Revision: https://reviews.llvm.org/D84053
-
- Jul 16, 2020
-
-
Aden Grue authored
This also fixes the outdated use of `n_views` in the documentation. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D83795
-
- Jul 15, 2020
-
-
Stephan Herhut authored
Summary: A reshape aliases its input memref, so it acts like a view. Differential Revision: https://reviews.llvm.org/D83773
-
Nicolas Vasilache authored
Summary: linalg.copy + linalg.fill can be used to create a padded local buffer. The `masked` attribute is only valid on this padded buffer. When forwarding to vector.transfer ops, the attribute must be reset conservatively. Differential Revision: https://reviews.llvm.org/D83782
-
- Jul 10, 2020
-
-
Thomas Raoux authored
Improve the logic deciding if it is safe to hoist vector transfer read/write out of the loop. Change the logic to prevent hoisting operations if there are any unknown access to the memref in the loop no matter where the operation is. For other transfer read/write in the loop check if we can prove that they access disjoint memory and ignore them in this case. Differential Revision: https://reviews.llvm.org/D83538
-
Nicolas Vasilache authored
This revision adds support for vectorizing named and generic contraction ops to vector.contract. Cases in which the memref is 0-D are special cased to emit std.load/std.store instead of vector.transfer. Relevant tests are added. Differential revision: https://reviews.llvm.org/D83307
-
- Jul 09, 2020
-
-
Benjamin Kramer authored
-
- Jul 07, 2020
-
-
River Riddle authored
These were largely leftover from when MLIR was a google project, and don't really follow LLVM guidelines.
-
- Jul 04, 2020
-
-
Uday Bondhugula authored
While lowering min/max pooling ops to loops, generate the right kind of load/stores (std or affine) instead of always generating std load/stores. Differential Revision: https://reviews.llvm.org/D83080
-
- Jul 01, 2020
-
-
Nicolas Vasilache authored
Summary: A relevant test is also added. Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes Tags: #mlir Differential Revision: https://reviews.llvm.org/D82959
-
- Jun 30, 2020
-
-
Rahul Joshi authored
- Also adopt variadic llvm::isa<> in more places. - Fixes https://bugs.llvm.org/show_bug.cgi?id=46445 Differential Revision: https://reviews.llvm.org/D82769
-
- Jun 29, 2020
-
-
Adam D Straw authored
Current Affine comparison builders, which use operator overload, default to signed comparison. This creates the possibility of misuse of these builders and potential correctness issues when dealing with unsigned integers. This change makes the distinction between signed and unsigned comparison builders and forces the caller to make a choice between the two. Differential Revision: https://reviews.llvm.org/D82323
-
- Jun 25, 2020
-
-
Rahul Joshi authored
Differential Revision: https://reviews.llvm.org/D82489
-
- Jun 19, 2020
-
-
Alexander Belyaev authored
Differential Revision: https://reviews.llvm.org/D82045
-
Alex Zinenko authored
Callback-based loop construction, with loop bodies being constructed during the construction of the parent op using a function, is now fully supported by the core infrastructure. This provides almost the same level of brevity as EDSC LoopBuilder at less than 30% infrastructural code cost. Functional equivalents compatible with EDSC ScopedContext are implemented on top of the main builders. LoopBuilder and related functionality has been deprecated, remove it. Differential Revision: https://reviews.llvm.org/D81874
-
River Riddle authored
This revision removes the TypeConverter parameter passed to the apply* methods, and instead moves the responsibility of region type conversion to patterns. The types of a region can be converted using the 'convertRegionTypes' method, which acts similarly to the existing 'applySignatureConversion'. This method ensures that all blocks within, and including those moved into, a region will have the block argument types converted using the provided converter. This has the benefit of making more of the legalization logic controlled by patterns, instead of being handled explicitly by the driver. It also opens up the possibility to support multiple type conversions at some point in the future. This revision also adds a new utility class `FailureOr<T>` that provides a LogicalResult friendly facility for returning a failure or a valid result value. Differential Revision: https://reviews.llvm.org/D81681
-
- Jun 18, 2020
-
-
River Riddle authored
This class enables for abstracting more of the details for the rewrite process, and will allow for clients to apply specific cost models to the pattern list. This allows for DialectConversion and the GreedyPatternRewriter to share the same underlying matcher implementation. This also simplifies the plumbing necessary to support dynamic patterns. Differential Revision: https://reviews.llvm.org/D81985
-
Alex Zinenko authored
The ScopedBuilder class in EDSC is being gradually phased out in favor of core OpBuilder-based helpers with callbacks. Provide helper functions that are compatible with `edsc::ScopedContext` and can be used to create and populate blocks using callbacks that take block arguments as callback arguments. This removes the need for `edsc::BlockHandle`, forward-declaration of `Value`s used for block arguments and the tag `edsc::Append` class, leading to noticable reduction in the verbosity of the code using helper functions. Remove "eager mode" construction tests that are only relevant to the `BlockBuilder`-based approach. `edsc::BlockHandle` and `edsc::BlockBuilder` are now deprecated and will be removed soon. Differential Revision: https://reviews.llvm.org/D82008
-
lorenzo chelini authored
Replace C++ MatvecOp, now that DRR rules have been dropped. Differential Revision: https://reviews.llvm.org/D82007
-
- Jun 17, 2020
-
-
Rahul Joshi authored
- Also use functions in Region instead of Region::getBlocks() where possible. Differential Revision: https://reviews.llvm.org/D82032
-
- Jun 16, 2020
-
-
Alex Zinenko authored
Recent work has introduced support for constructing loops via `::build` with callbacks that construct loop bodies using only the core OpBuilder. This is now supported on all loop types that Linalg lowers to. Refactor LoopNestBuilder in Linalg to rely on this functionality instead of using a custom EDSC-based approach to creating loop nests. The specialization targeting parallel loops is also simplified by factoring out the recursive call into a separate static function and considering only two alternatives: top-level loop is parallel or sequential. This removes the last remaining in-tree use of edsc::LoopBuilder, which is now deprecated and will be removed soon. Differential Revision: https://reviews.llvm.org/D81873
-
Nicolas Vasilache authored
Summary: This revision replaces MatmulOp, now that DRR rules have been dropped. This revision also fixes minor parsing bugs and a plugs a few holes to get e2e paths working (e.g. library call emission). During the replacement the i32 version had to be dropped because only the EDSC operators +, *, etc support type inference. Deciding on a type-polymorphic behavior, and implementing it, is left for future work. Reviewers: aartbik Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, msifontes Tags: #mlir Differential Revision: https://reviews.llvm.org/D81935
-
Kirill Bobyrev authored
This reverts commit 8c6c49f2. As discussed offline, this patch breaks internal builds and tests so I'm reverting it for now.
-
River Riddle authored
It is quite common for the same type to be converted many types throughout the conversion process, and there isn't any good reason why we aren't caching that result. Especially given that we currently use identity conversion to signify legality. This revision also adds a few additional helpers to TypeConverter. Differential Revision: https://reviews.llvm.org/D81679
-
Nicolas Vasilache authored
This revision replaces MatmulOp, now that DRR rules have been dropped. This revision also fixes minor parsing bugs and a plugs a few holes to get e2e paths working (e.g. library call emission). During the replacement the i32 version had to be dropped because only the EDSC operators +, *, etc support type inference. Deciding on a type-polymorphic behavior, and implementing it, is left for future work. Differential Revision: https://reviews.llvm.org/D79762
-
- Jun 11, 2020
-
-
Alexander Belyaev authored
Summary: * extra ';' in the following files: mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp mlir/lib/Dialect/Shape/IR/Shape.cpp * base class ‘mlir::ConvertVectorToSCFBase<ConvertVectorToSCFPass>’ should be explicitly initialized in the copy constructor [-Wextra] in mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp * warning: ‘bool Expression::operator==(const Expression&) const’ defined but not used [-Wunused-function] in mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp Differential Revision: https://reviews.llvm.org/D81673
-
Alexander Belyaev authored
-
Alexander Belyaev authored
Differential Revision: https://reviews.llvm.org/D81640
-
- Jun 08, 2020
-
-
Ehsan Toosi authored
This parameter gives the developers the freedom to choose their desired function signature conversion for preparing their functions for buffer placement. It is introduced for BufferAssignmentFuncOpConverter, and also for BufferAssignmentReturnOpConverter, and BufferAssignmentCallOpConverter to adapt the return and call operations with the selected function signature conversion. If the parameter is set, buffer placement won't also deallocate the returned buffers. Differential Revision: https://reviews.llvm.org/D81137
-
- Jun 05, 2020
-
-
Nicolas Vasilache authored
-
Nicolas Vasilache authored
-
Nicolas Vasilache authored
This revision adds a helper function to hoist vector.transfer_read / vector.transfer_write pairs out of immediately enclosing scf::ForOp iteratively, if the following conditions are true: 1. The 2 ops access the same memref with the same indices. 2. All operands are invariant under the enclosing scf::ForOp. 3. No uses of the memref either dominate the transfer_read or are dominated by the transfer_write (i.e. no aliasing between the write and the read across the loop) To improve hoisting opportunities, call the `moveLoopInvariantCode` helper function on the candidate loop above which to hoist. Hoisting the transfers results in scf::ForOp yielding the value that originally transited through memory. This revision additionally exposes `moveLoopInvariantCode` as a helper in LoopUtils.h and updates SliceAnalysis to support return scf::For values and allow hoisting across multiple scf::ForOps. Differential Revision: https://reviews.llvm.org/D81199
-
Uday Bondhugula authored
Update linalg to affine lowering for convop to use affine load for input whenever there is no padding. It had always been using std.loads because max in index functions (needed for non-zero padding if not materializing zeros) couldn't be represented in the non-zero padding cases. In the future, the non-zero padding case could also be made to use affine - either by materializing or using affine.execute_region. The latter approach will not impact the scf/std output obtained after lowering out affine. Differential Revision: https://reviews.llvm.org/D81191
-
Nicolas Vasilache authored
This revision adds a helper function to hoist alloc/dealloc pairs and alloca op out of immediately enclosing scf::ForOp if both conditions are true: 1. all operands are defined outside the loop. 2. all uses are ViewLikeOp or DeallocOp. This is now considered Linalg-specific and will be generalized on a per-need basis. Differential Revision: https://reviews.llvm.org/D81152
-
- Jun 03, 2020
-
-
Hanhan Wang authored
Summary: The fusion for tensor_reshape is embedding the information to indexing maps, thus the exising pattenr also works for indexed_generic ops. Depends On D80347 Differential Revision: https://reviews.llvm.org/D80348
-
Hanhan Wang authored
Summary: Different from the fusion between generic ops, indices are involved. In this context, we need to re-map the indices for producer since the fused op is built on consumer's perspective. This patch supports all combination of the fusion between indexed_generic ops and generic ops, which includes tests case: 1) generic op as producer and indexed_generic op as consumer. 2) indexed_generic op as producer and generic op as consumer. 3) indexed_generic op as producer and indexed_generic op as consumer. Differential Revision: https://reviews.llvm.org/D80347
-
Nicolas Vasilache authored
Summary: This removes string ownership worries by putting everything into the context and allows more constructing identifiers programmatically. Reviewers: ftynse Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul Tags: #mlir Differential Revision: https://reviews.llvm.org/D81027
-
- May 30, 2020
-
-
Nicolas Vasilache authored
Address post-commit review of https://reviews.llvm.org/D79518
-
- May 29, 2020
-
-
Nicolas Vasilache authored
This revision replaces the load + vector.type_cast by appropriate vector transfer operations. These play more nicely with other vector abstractions and canonicalization patterns and lower to load/store with or without masks when appropriate. Differential Revision: https://reviews.llvm.org/D80809
-