- May 05, 2020
-
-
River Riddle authored
This revision adds support for merging identical blocks, or those with the same operations that branch to the same successors. Operands that mismatch between the different blocks are replaced with new block arguments added to the merged block. Differential Revision: https://reviews.llvm.org/D79134
-
Nicolas Vasilache authored
Summary: In the particular case of an insertion in a block without a terminator, the BlockBuilder insertion point should be block->end(). Adding a unit test to exercise this. Differential Revision: https://reviews.llvm.org/D79363
-
Hanhan Wang authored
Summary: As D78974, this patch implements the emulation for store op. The emulation is done with atomic operations. E.g., if the storing value is i8, rewrite the StoreOp to: 1) load a 32-bit integer 2) clear 8 bits in the loading value 3) store 32-bit value back 4) load a 32-bit integer 5) modify 8 bits in the loading value 6) store 32-bit value back The step 1 to step 3 are done by AtomicAnd as one atomic step, and the step 4 to step 6 are done by AtomicOr as another atomic step. Differential Revision: https://reviews.llvm.org/D79272
-
- May 04, 2020
-
-
Stephen Neuendorffer authored
This reverts commit 4f0f4367. This seems to show some compile dependence problems, and also breaks flang.
-
Valentin Churavy authored
- Exports MLIR targets to be used out-of-tree. - mimicks `add_clang_library` and `add_flang_library`. - Fixes libMLIR.so After https://reviews.llvm.org/D77515 libMLIR.so was no longer containing any object files. We originally had a cludge there that made it work with the static initalizers and when switchting away from that to the way the clang shlib does it, I noticed that MLIR doesn't create a `obj.{name}` target, and doesn't export it's targets to `lib/cmake/mlir`. This is due to MLIR using `add_llvm_library` under the hood, which adds the target to `llvmexports`. Differential Revision: https://reviews.llvm.org/D78773 [MLIR] Fix libMLIR.so and LLVM_LINK_LLVM_DYLIB Primarily, this patch moves all mlir references to LLVM libraries into either LLVM_LINK_COMPONENTS or LINK_COMPONENTS. This enables magic in the llvm cmake files to automatically replace reference to LLVM components with references to libLLVM.so when necessary. Among other things, this completes fixing libMLIR.so, which has been broken for some configurations since D77515. Unlike previously, the pattern is now that mlir libraries should almost always use add_mlir_library. Previously, some libraries still used add_llvm_library. However, this confuses the export of targets for use out of tree because libraries specified with add_llvm_library are exported by LLVM. Instead users which don't need/can't be linked into libMLIR.so can specify EXCLUDE_FROM_LIBMLIR A common error mode is linking with LLVM libraries outside of LINK_COMPONENTS. This almost always results in symbol confusion or multiply defined options in LLVM when the same object file is included as a static library and as part of libLLVM.so. To catch these errors more directly, there's now mlir_check_all_link_libraries. To simplify usage of add_mlir_library, we assume that all mlir libraries depend on LLVMSupport, so it's not necessary to separately specify it. tested with: BUILD_SHARED_LIBS=on, BUILD_SHARED_LIBS=off + LLVM_BUILD_LLVM_DYLIB, BUILD_SHARED_LIBS=off + LLVM_BUILD_LLVM_DYLIB + LLVM_LINK_LLVM_DYLIB. By: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> Differential Revision: https://reviews.llvm.org/D79067 [MLIR] Move from using target_link_libraries to LINK_LIBS This allows us to correctly generate dependencies for derived targets, such as targets which are created for object libraries. By: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> Differential Revision: https://reviews.llvm.org/D79243 Three commits have been squashed to avoid intermediate build breakage.
-
Nicolas Vasilache authored
Linalg transformations are currently exposed as DRRs. Unfortunately RewriterGen does not play well with the line of work on named linalg ops which require variadic operands and results. Additionally, DRR is arguably not the right abstraction to expose compositions of such patterns that don't rely on SSA use-def semantics. This revision abandons DRRs and exposes manually written C++ patterns. Refactorings and cleanups are performed to uniformize APIs. This refactoring will allow replacing the currently manually specified Linalg named ops. A collateral victim of this refactoring is the `tileAndFuse` DRR, and the one associated test, which will be revived at a later time. Lastly, the following 2 tests do not add value and are altered: - a dot_perm tile + interchange test does not test anything new and is removed - a dot tile + lower to loops does not need 2-D tiling and is trimmed.
-
Frederik Gossen authored
Add `CreateComplexOp`, `ReOp`, and `ImOp` to the standard dialect. This is the first step to support complex numbers. Differential Revision: https://reviews.llvm.org/D79159
-
Wen-Heng (Jack) Chung authored
- Add rocdl.barrier op. - Lower gpu.barier to rocdl.barrier in -convert-gpu-to-rocdl. Differential Revision: https://reviews.llvm.org/D79126
-
Wen-Heng (Jack) Chung authored
Add tests for vector.type_cast that takes memrefs on non-zero addrspaces. Differential Revision: https://reviews.llvm.org/D79099
-
- May 02, 2020
-
-
River Riddle authored
This is useful for several reasons: * In some situations the user can guarantee that thread-safety isn't necessary and don't want to pay the cost of synchronization, e.g., when parsing a very large module. * For things like logging threading is not desirable as the output is not guaranteed to be in stable order. This flag also subsumes the pass manager flag for multi-threading. Differential Revision: https://reviews.llvm.org/D79266
-
Stephen Neuendorffer authored
These libraries are distinct from other things in Analysis in that they operate only on core IR concepts. This also simplifies dependencies so that Dialect -> Analysis -> Parser -> IR. Previously, the parser depended on portions of the the Analysis directory as well, which sometimes caused issues with the way the cmake makefile generator discovers dependencies on generated files during compilation. Differential Revision: https://reviews.llvm.org/D79240
-
- May 01, 2020
-
-
Denis Khalikov authored
Summary: This is an initial version, currently supports OpString and OpLine for autogenerated operations during (de)serialization. Differential Revision: https://reviews.llvm.org/D79091
-
MaheshRavishankar authored
Also add lowering of sine operation to SPIR-V dialect. Differential Revision: https://reviews.llvm.org/D79102
-
Hanhan Wang authored
Summary: Maps ZeroExtendIOp and TruncateIOp to spirv::UConvertOp and spirv::SConvertOp. Depends On D78974 Differential Revision: https://reviews.llvm.org/D79143
-
Hanhan Wang authored
Summary: The current implementation in SPIRVTypeConverter just unconditionally turns everything into 32-bit if it doesn't meet the requirements of extensions or capabilities. In this case, we can load a 32-bit value and then do bit extraction to get the value. Differential Revision: https://reviews.llvm.org/D78974
-
Wen-Heng (Jack) Chung authored
- Extract common logic between -convert-gpu-to-nvvm and -convert-gpu-to-rocdl. - Cope with the fact that alloca operates on different addrspaces between NVVM and ROCDL. - Modernize unit tests for ROCDL dialect. Differential Revision: https://reviews.llvm.org/D79021
-
Nicolas Vasilache authored
Summary: This revision cleans up a layer of complexity in ScopedContext and uses InsertGuard instead of previously manual bookkeeping. The method `getBuilder` is renamed to `getBuilderRef` and spurious copies of OpBuilder are tracked. This results in some canonicalizations not happening anymore in the Linalg matmul to vector test. This test is retired because relying on DRRs for this has been shaky at best. The solution will be better support to write fused passes in C++ with more idiomatic pattern composition and application. Differential Revision: https://reviews.llvm.org/D79208
-
- Apr 30, 2020
-
-
aartbik authored
Summary: Added boolean support to vector.print. Useful for upcoming "mask" tests. Reviewers: ftynse, nicolasvasilache, andydavis1 Reviewed By: andydavis1 Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, Kayjukh, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79198
-
Nicolas Vasilache authored
This revision adds support to allow named ops to lower to loops. Linalg.batch_matmul successfully lowers to loops and to LLVM. In the process, this test also activates linalg to affine loops. However padded convolutions to not lower to affine.load atm so this revision overrides the type of underlying load / store operation. Differential Revision: https://reviews.llvm.org/D79135
-
Lucy Fox authored
There are three op conversion modes: Partial, Full, and Analysis. This change modifies the Partial mode to optionally take a set of non-legalizable ops. If this parameter is specified, all ops that are not legalizable (i.e. would cause full conversion to fail) are tracked throughout the partial legalization. Differential Revision: https://reviews.llvm.org/D78788
-
Lei Zhang authored
This commit marks AllocLikeOp as MemAlloc in StandardOps. Also in Linalg dependency analysis use memory effect to detect allocation. This allows the dependency analysis to be more general and recognize other allocation-like operations. Differential Revision: https://reviews.llvm.org/D78705
-
Nicolas Vasilache authored
This revision allows masked vector transfers with m-D buffers and n-D vectors to progressively lower to m-D buffer and 1-D vector transfers. For a vector.transfer_read, assuming a `memref<(leading_dims) x (major_dims) x (minor_dims) x type>` and a `vector<(minor_dims) x type>` are involved in the transfer, this generates pseudo-IR resembling: ``` if (any_of(%ivs_major + %offsets, <, major_dims)) { %v = vector_transfer_read( {%offsets_leading, %ivs_major + %offsets_major, %offsets_minor}, %ivs_minor): memref<(leading_dims) x (major_dims) x (minor_dims) x type>, vector<(minor_dims) x type>; } else { %v = splat(vector<(minor_dims) x type>, %fill) } ``` Differential Revision: https://reviews.llvm.org/D79062
-
River Riddle authored
This range allows for performing many different operations on successor operands, including erasing/adding/setting. This removes the need for the explicit canEraseSuccessorOperand and eraseSuccessorOperand methods. Differential Revision: https://reviews.llvm.org/D79077
-
River Riddle authored
[mlir][DeclareOpInterfaceMethods] Allow specifying a set of methods to force declaration generation for. Currently a declaration won't be generated if the method has a default implementation. Meaning that operations that wan't to override the default have to explicitly declare the method in the extraClassDeclarations. This revision adds an optional list parameter to DeclareOpInterfaceMethods to allow for specifying a set of methods that should always have the declarations generated, even if there is a default. Differential Revision: https://reviews.llvm.org/D79030
-
River Riddle authored
This class allows for mutating an operand range in-place, and provides vector like API for adding/erasing/setting. ODS now uses this class to generate mutable wrappers for named operands, with the name `MutableOperandRange <operand-name>Mutable()` Differential Revision: https://reviews.llvm.org/D78892
-
River Riddle authored
This revision adds a mode to the crash reproducer generator to attempt to generate a more local reproducer. This will attempt to generate a reproducer right before the offending pass that fails. This is useful for the majority of failures that are specific to a single pass, and situations where some passes in the pipeline are not registered with a specific tool. Differential Revision: https://reviews.llvm.org/D78314
-
- Apr 29, 2020
-
-
MaheshRavishankar authored
type operands. The instructions used to convert std.cmpi cannot have i1 types according to SPIR-V specification. A different set of operations are specified in the SPIR-V spec for comparing boolean types. Enhance the StandardToSPIRV lowering to target these instructions when operands to std.cmpi operation are of i1 type. Differential Revision: https://reviews.llvm.org/D79049
-
Wen-Heng (Jack) Chung authored
On certain targets std.subview should be able to take memrefs from non-zero addrspaces. Improve lowering logic to llvm dialect and amend the tests. Differential Revision: https://reviews.llvm.org/D79024
-
Wen-Heng (Jack) Chung authored
Enhance lowering logic and tests so vector.transfer_read and vector.transfer_write take memrefs on non-zero addrspaces. Differential Revision: https://reviews.llvm.org/D79023
-
Uday Bondhugula authored
(A previous version of this, dd2c639c, was reverted.) Introduce op trait PolyhedralScope for ops to define a new scope for polyhedral optimization / affine dialect purposes, thus generalizing such scopes beyond FuncOp. Ops to which this trait is attached will define a new scope for the consideration of SSA values as valid symbols for the purposes of polyhedral analysis and optimization. Update methods that check for dim/symbol validity to work based on this trait. Differential Revision: https://reviews.llvm.org/D79060
-
Nicolas Vasilache authored
OperationHandle mostly existed to mirror the behavior of ValueHandle. This has become unnecessary and can be retired. Differential Revision: https://reviews.llvm.org/D78692
-
- Apr 28, 2020
-
-
Sean Silva authored
Previously, they would only only verify `isa<DictionaryAttr>` on such attrs which resulted in crashes down the line from code assuming that the verifier was doing the more thorough check introduced in this patch. The key change here is for StructAttr to use `CPred<"$_self.isa<" # name # ">()">` instead of `isa<DictionaryAttr>`. To test this, introduce struct attrs to the test dialect. Previously, StructAttr was only being tested by unittests/, which didn't verify how StructAttr interacted with ODS. Differential Revision: https://reviews.llvm.org/D78975
-
Martin Erhart authored
[mlir][assemblyFormat] Fix bug when using AttrSizedOperandSegments trait with only non-buildable operand types Summary: When creating an operation with * `AttrSizedOperandSegments` trait * Variadic operands of only non-buildable types * assemblyFormat to automatically generate the parser the `builder` local variable is used, but never declared. This adds a fix as well as a test for this case as existing ones use buildable types only. Reviewers: rriddle, Kayjukh, grosser Reviewed By: Kayjukh Subscribers: mehdi_amini, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits Tags: #mlir, #llvm Differential Revision: https://reviews.llvm.org/D79004
-
Tres Popp authored
Summary: This change results in tests also being changed to prevent dead affine.load operations from being folded away during rewrites. Also move AffineStoreOp and AffineLoadOp to an ODS file. Differential Revision: https://reviews.llvm.org/D78930
-
Dmitri Gribenko authored
This reverts commit dd2c639c. It broke a few things -- the explanation will be posted to the review thread.
-
Alex Zinenko authored
As we start defining more complex Ops, we increasingly see the need for Ops-with-regions to be able to construct Ops within their regions in their ::build methods. However, these methods only have access to Builder, and not OpBuilder. Creating a local instance of OpBuilder inside ::build and using it fails to trigger the operation creation hooks in derived builders (e.g., ConversionPatternRewriter). In this case, we risk breaking the logic of the derived builder. At the same time, OpBuilder::create, which is by far the largest user of ::build already passes "this" as the first argument, so an OpBuilder instance is already available. Update all ::build methods in all Ops in MLIR and Flang to take "OpBuilder &" instead of "Builder *". Note the change from pointer and to reference to comply with the common style in MLIR, this also ensures all other users must change their ::build methods. Differential Revision: https://reviews.llvm.org/D78713
-
Ehsan Toosi authored
We have provided a generic buffer assignment transformation ported from TensorFlow. This generic transformation pass automatically analyzes the values and their aliases (also in other blocks) and returns the valid positions for Alloc and Dealloc operations. To find these positions, the algorithm uses the block Dominator and Post-Dominator analyses. In our proposed algorithm, we have considered aliasing, liveness, nested regions, branches, conditional branches, critical edges, and independency to custom block terminators. This implementation doesn't support block loops. However, we have considered this in our design. For this purpose, it is only required to have a loop analysis to insert Alloc and Dealloc operations outside of these loops in some special cases. Differential Revision: https://reviews.llvm.org/D78484
-
Uday Bondhugula authored
Introduce op trait `PolyhedralScope` for ops to define a new scope for polyhedral optimization / affine dialect purposes, thus generalizing such scopes beyond FuncOp. Ops to which this trait is attached will define a new scope for the consideration of SSA values as valid symbols for the purposes of polyhedral analysis and optimization. Update methods that check for dim/symbol validity to work based on this trait. Differential Revision: https://reviews.llvm.org/D78863
-
Phoenix Meadowlark authored
- Adds a folder for integer division by one with the `divi_signed` and `divi_unsigned` ops. - Creates tests for scalar and tensor versions of these ops. - Modifies the test in `parallel-loop-collapsing.mlir` so that it doesn't assume division by one will be in the output. Differential Revision: https://reviews.llvm.org/D78518
-
Sean Silva authored
Differential Revision: https://reviews.llvm.org/D78966
-