- 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
-
Geoffrey Martin-Noble authored
This change removes tabs from the comments printed by the asmprinter after basic block declarations in favor of two spaces. This is currently the only place in the printed IR that uses tabs. Differential Revision: https://reviews.llvm.org/D79377
-
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
-
River Riddle authored
This allows for walking the operations nested directly within a region, without traversing nested regions. Differential Revision: https://reviews.llvm.org/D79056
-
River Riddle authored
This removes the unnecessary/costly context synchronization when parsing, as the context is guaranteed to not be used by any other threads.
-
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
-
Haruki Imai authored
This std::copy_n copies 8 byte data (APInt raw data) by 1 byte from the beginning of char array. This is no problem in little endian, but the data is not copied correctly in big endian because the data should be copied from the end of the char array. - Example of 4 byte data (such as float32) Little endian (First 4 bytes): Address | 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 Data | 0xcd 0xcc 0x8c 0x3f 0x00 0x00 0x00 0x00 Big endian (Last 4 bytes): Address | 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 Data | 0x00 0x00 0x00 0x00 0x3f 0x8c 0xcc 0xcd In general, when it copies N(N<8) byte data in big endian, the start address should be incremented by (8 - N) bytes. The original code has no problem when it includes 8 byte data(such as double) even in big endian. Differential Revision: https://reviews.llvm.org/D78076
-
- 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
-
Marcel Koester authored
The current BufferPlacement implementation tries to find Alloc and Dealloc operations in order to move them. However, this is a tight coupling to standard-dialect ops which has been removed in this CL. Differential Revision: https://reviews.llvm.org/D78993
-
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
Prior change introduces this target, but we need it for out-of-tree users too
-
Stephen Neuendorffer authored
In cmake, dependencies on generated files require some sophistication in the build system. At build time, files are parsed to determine which headers they depend on and these dependencies are injected into the build system. This works well with ninja, but has some constraints with the makefile generator. According to the cmake documentation, this only works reliably within the same directory. This patch expands the usage of mlir-headers to include all generated headers and adds an mlir-generic-headers target which triggers generation of dialect-independent headers. These targets are used to express dependencies on generated headers. This is mostly handled in AddMLIR.cmake and only a few CMakeLists.txt files need to change. Differential Revision: https://reviews.llvm.org/D79242
-
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
-
River Riddle authored
-
River Riddle authored
This was missed in the original revision. This allows for using the opaque Attribute accessors when the elements are strings.
-
River Riddle authored
-
- May 01, 2020
-
-
Stephen Neuendorffer authored
Differential Revision: https://reviews.llvm.org/D79146
-
Wen-Heng (Jack) Chung authored
Summary: - Add missing dependency to MLIRVectorToLLVM to get shared libs built. Differential Revision: https://reviews.llvm.org/D79225
-
Benjamin Kramer authored
-
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
-
River Riddle authored
The current OpBuilder has a set of virtual functions required by the fact that the PatternRewriter inherits from it for convenience. The PatternRewriter is required to know about IR mutations for correctness. This revision changes the relationship to be explicit by having users register a listener with the builder instead of using inheritance/vtables. This still requires that users properly transfer the listener when creating new builders, but has several benefits: * More than one builder can be created during pattern rewrites(assuming that the listener is properly forwarded) * OpBuilder no longer requires a vtable, and thus does not incur the cost when a listener isn't present. Differential Revision: https://reviews.llvm.org/D79206
-
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
-
River Riddle authored
-
River Riddle authored
This fixes the build on MSVC where it is unable to handle template-template using directives properly.
-
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
-
Tres Popp authored
Summary: The purpose of this is to aid in having code behave differently on Operations based on their Dialect without caring about the specific Op. Additionally this is consistent with most other types supporting isa<> and dyn_cast<>. A Dialect matches isa<> based only on its namespace and relies on each namespace being unique. Differential Revision: https://reviews.llvm.org/D79088
-
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
-