Skip to content
  1. May 05, 2020
  2. May 04, 2020
    • Stephen Neuendorffer's avatar
      Revert "[MLIR] Adjust libMLIR building to more closely follow libClang" · ab1ca6e6
      Stephen Neuendorffer authored
      This reverts commit 4f0f4367.
      
      This seems to show some compile dependence problems, and also breaks flang.
      ab1ca6e6
    • Valentin Churavy's avatar
      [MLIR] Adjust libMLIR building to more closely follow libClang · 4f0f4367
      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.
      4f0f4367
    • Nicolas Vasilache's avatar
      [mlir][Linalg] Mostly NFC - Refactor Linalg patterns and transformations. · 307cfdf5
      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.
      307cfdf5
    • Frederik Gossen's avatar
      [MLIR] Add complex numbers to standard dialect · 031265ad
      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
      031265ad
    • Wen-Heng (Jack) Chung's avatar
      [mlir][rocdl] add rocdl.barier op. · bc23c1d8
      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
      bc23c1d8
    • Wen-Heng (Jack) Chung's avatar
      [mlir][vector] add tests for type_cast taking non-zero addrspace · a581c6f8
      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
      a581c6f8
  3. May 02, 2020
    • River Riddle's avatar
      [mlir] Add a new context flag for disabling/enabling multi-threading · cb9ae002
      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
      cb9ae002
    • Stephen Neuendorffer's avatar
      [MLIR] Move Verifier and Dominance Analysis from /Analysis to /IR · 57818885
      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
      57818885
  4. May 01, 2020
  5. Apr 30, 2020
  6. Apr 29, 2020
  7. Apr 28, 2020
    • Sean Silva's avatar
      Make ops with StructAttr's actually verify `isa<TheStruct>`. · 9c9f479a
      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
      9c9f479a
    • Martin Erhart's avatar
      [mlir][assemblyFormat] Fix bug when using AttrSizedOperandSegments trait with... · edb77864
      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
      edb77864
    • Tres Popp's avatar
      [MLIR] Give AffineStoreOp and AffineLoadOp Memory SideEffects. · f66c8763
      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
      f66c8763
    • Dmitri Gribenko's avatar
      Revert "[MLIR] Introduce op trait PolyhedralScope" · ef06016d
      Dmitri Gribenko authored
      This reverts commit dd2c639c. It broke a
      few things -- the explanation will be posted to the review thread.
      ef06016d
    • Alex Zinenko's avatar
      [mlir][flang] use OpBuilder& instead of Builder* in <Op>::build methods · bb1d976f
      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
      bb1d976f
    • Ehsan Toosi's avatar
      Providing buffer assignment for MLIR · 5c352e69
      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
      5c352e69
    • Uday Bondhugula's avatar
      [MLIR] Introduce op trait PolyhedralScope · dd2c639c
      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
      dd2c639c
    • Phoenix Meadowlark's avatar
      Add a folder for division by one. · 622aac6a
      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
      622aac6a
    • Sean Silva's avatar
      Don't crash on duplicate keys in dictionary attrs. · 15fcdac4
      Sean Silva authored
      Differential Revision: https://reviews.llvm.org/D78966
      15fcdac4
Loading