Skip to content
  1. Mar 23, 2021
  2. Mar 22, 2021
    • Chris Lattner's avatar
      [PatternMatching] Add convenience insert method to OwningRewritePatternList. NFC. · 68747266
      Chris Lattner authored
      This allows adding a C function pointer as a matchAndRewrite style pattern, which
      is a very common case.  This adopts it in ExpandTanh to show how it reduces a level
      of nesting.
      
      We could allow C++ lambdas here, but that doesn't work as well with type inference
      in the common case.  Instead of:
      
        patterns.insert(convertTanhOp);
      
      you need to specify:
      
        patterns.insert<math::TanhOp>(convertTanhOp);
      
      which is boilerplate'y.  Capturing state like this is very uncommon, so we choose
      to require clients to define their own structs and use the non-convenience method
      when they need to do so.
      
      Differential Revision: https://reviews.llvm.org/D99039
      68747266
    • Nicolas Vasilache's avatar
      [mlir][Linalg] Fix linalg on tensor fusion · bcd6424f
      Nicolas Vasilache authored
      - Drop unnecessary occurrences of rewriter.eraseOp: dead linalg ops on tensors should be cleaned up by DCE.
      - reimplement the part of Linalg on fusion that constructs the body and block arguments: the previous implementation had too much magic. Instead this spells out all cases explicitly and asserts / introduces TODOs for incorrect cases.
      
      As a consequence, we can use the default traversal order for this pattern.
      
      Differential Revision: https://reviews.llvm.org/D99070
      bcd6424f
    • Adrian Kuegel's avatar
      [mlir] Add an option to still use bottom-up traversal · c691b968
      Adrian Kuegel authored
      GreedyPatternRewriteDriver was changed from bottom-up traversal to top-down traversal. Not all passes work yet with that change for traversal order. To give some time for fixing, add an option to allow to switch back to bottom-up traversal. Use this option in FusionOfTensorOpsPass which fails otherwise.
      
      Differential Revision: https://reviews.llvm.org/D99059
      c691b968
  3. Mar 21, 2021
  4. Mar 20, 2021
  5. Mar 19, 2021
  6. Mar 18, 2021
  7. Mar 17, 2021
  8. Mar 16, 2021
    • River Riddle's avatar
      [mlir][PDL] Add support for variadic operands and results in the PDL Interpreter · 3a833a0e
      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
      3a833a0e
    • River Riddle's avatar
      [mlir][PDL] Add support for variadic operands and results in PDL · 1eb6994d
      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
      1eb6994d
    • River Riddle's avatar
      [mlir][pdl] Remove CreateNativeOp in favor of a more general ApplyNativeRewriteOp. · 02c4c0d5
      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
      02c4c0d5
    • River Riddle's avatar
      [mlir][pdl] Restructure how results are represented. · 242762c9
      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
      242762c9
    • Nicolas Vasilache's avatar
    • Adrian Kuegel's avatar
    • Lorenzo Chelini's avatar
      scf::ForOp: Fold away iterator arguments with no use and for which the... · fd7eee64
      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
      fd7eee64
    • Aart Bik's avatar
      [mlir][amx] Add Intel AMX dialect (architectural-specific vector dialect) · 6ad7b97e
      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
      6ad7b97e
  9. Mar 15, 2021
    • Alex Zinenko's avatar
      [mlir] fix shared-lib build fallout of e2310704 · 0fb4a201
      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.
      0fb4a201
    • Julian Gross's avatar
      [MLIR] Create memref dialect and move dialect-specific ops from std. · e2310704
      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
      e2310704
    • Frederik Gossen's avatar
      [MLIR] Add canonicalization for `shape.broadcast` · b55f424f
      Frederik Gossen authored
      Remove redundant operands and fold if only one left.
      
      Differential Revision: https://reviews.llvm.org/D98402
      b55f424f
  10. Mar 13, 2021
  11. Mar 12, 2021
Loading