Skip to content
  1. May 05, 2020
  2. Apr 30, 2020
  3. Apr 28, 2020
    • 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
    • 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
    • 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
  4. Apr 27, 2020
    • River Riddle's avatar
      [mlir][SCCP] Add support for propagating across symbol based calls · a90151d6
      River Riddle authored
      This revision adds support for propagating constants across symbol-based callgraph edges. It uses the existing Call/CallableOpInterfaces to detect the dataflow edges, and propagates constants through arguments and out of returns.
      
      Differential Revision: https://reviews.llvm.org/D78592
      a90151d6
    • Tres Popp's avatar
      [MLIR] Propagate input side effect information · 2d2d6961
      Tres Popp authored
      Summary:
      Previously operations like std.load created methods for obtaining their
      effects but did not inherit from the SideEffect interfaces when their
      parameters were decorated with the information. The resulting situation
      was that passes had no information on the SideEffects of std.load/store
      and had to treat them more cautiously. This adds the inheritance
      information when creating the methods.
      
      As a side effect, many tests are modified, as they were using std.load
      for testing and this oepration would be folded away as part of pattern
      rewriting. Tests are modified to use store or to reutn the result of the
      std.load.
      
      Reviewers: mravishankar, antiagainst, nicolasvasilache, herhut, aartbik, ftynse!
      
      Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, bader, grosul1, frgossen, Kayjukh, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D78802
      2d2d6961
  5. Apr 24, 2020
  6. Apr 23, 2020
  7. Apr 21, 2020
    • River Riddle's avatar
      [mlir][SCCP] Add support for propagating constants across inter-region control flow. · 2eda87df
      River Riddle authored
      This is possible by adding two new ControlFlowInterface additions:
      
      - A new interface, RegionBranchOpInterface
      This interface allows for region holding operations to describe how control flows between regions. This interface initially contains two methods:
      
      * getSuccessorEntryOperands
      Returns the operands of this operation used as the entry arguments when entering the region at `index`, which was specified as a successor by `getSuccessorRegions`. when entering. These operands should correspond 1-1 with the successor inputs specified in `getSuccessorRegions`, and may be a subset of the entry arguments for that region.
      
      *  getSuccessorRegions
      Returns the viable successors of a region, or the possible successor when branching from the parent op. This allows for describing which regions may be executed when entering an operation, and which regions are executed after having executed another region of the parent op. For example, a structured loop operation may always enter into the loop body region. The loop body region may branch back to itself, or exit to the operation.
      
      - A trait, ReturnLike
      This trait signals that a terminator exits a region and forwards all of its operands as "exiting" values.
      
      These additions allow for performing more general dataflow analysis in the presence of region holding operations.
      
      Differential Revision: https://reviews.llvm.org/D78447
      2eda87df
    • River Riddle's avatar
      [mlir][Transforms] Add pass to perform sparse conditional constant propagation · 152d29cc
      River Riddle authored
      This revision adds the initial pass for performing SCCP generically in MLIR. SCCP is an algorithm for propagating constants across control flow, and optimistically assumes all values to be constant unless proven otherwise. It currently supports branching control, with support for regions and inter-procedural propagation being added in followups.
      
      Differential Revision: https://reviews.llvm.org/D78397
      152d29cc
    • Sean Silva's avatar
      Fix inlining multi-block callees with type conversion. · 22219cfc
      Sean Silva authored
      The previous code result a mismatch between block argument types and
      predecessor successor args when a type conversion was needed in a
      multiblock case. It was assuming the replaced result types matched the
      region result types.
      
      Also, slighly improve the debug output from the inliner.
      
      Differential Revision: https://reviews.llvm.org/D78415
      22219cfc
  8. Apr 13, 2020
  9. Apr 09, 2020
    • River Riddle's avatar
      [mlir] Add a new RewritePattern::hasBoundedRewriteRecursion hook. · bd1ccfe6
      River Riddle authored
      Summary: Some pattern rewriters, like dialect conversion, prohibit the unbounded recursion(or reapplication) of patterns on generated IR. Most patterns are not written with recursive application in mind, so will generally explode the stack if uncaught. This revision adds a hook to RewritePattern, `hasBoundedRewriteRecursion`, to signal that the pattern can safely be applied to the generated IR of a previous application of the same pattern. This allows for establishing a contract between the pattern and rewriter that the pattern knows and can handle the potential recursive application.
      
      Differential Revision: https://reviews.llvm.org/D77782
      bd1ccfe6
  10. Apr 08, 2020
  11. Apr 07, 2020
    • Uday Bondhugula's avatar
      [MLIR] Introduce std.alloca op · 7023f4b4
      Uday Bondhugula authored
      Introduce the alloca op for stack memory allocation. When converting to the
      LLVM dialect, this is lowered to an llvm.alloca. Refactor the std to
      llvm conversion for alloc op to reuse with alloca. Drop useAlloca option
      with alloc op lowering.
      
      Differential Revision: https://reviews.llvm.org/D76602
      7023f4b4
  12. Apr 05, 2020
  13. Apr 03, 2020
    • Alex Zinenko's avatar
      [mlir] DialectConversion: support block creation in ConversionPatternRewriter · f27f1e8c
      Alex Zinenko authored
      PatternRewriter and derived classes provide a set of virtual methods to
      manipulate blocks, which ConversionPatternRewriter overrides to keep track of
      the manipulations and undo them in case the conversion fails. However, one can
      currently create a block only by splitting another block into two. This not
      only makes the API inconsistent (`splitBlock` is allowed in conversion
      patterns, but `createBlock` is not), but it also make it impossible for one to
      create blocks with argument lists different from those of already existing
      blocks since in-place block updates are not supported either. Such
      functionality precludes dialect conversion infrastructure from being used more
      extensively on region-containing ops, for example, for value-returning "if"
      operations. At the same time, ConversionPatternRewriter already allows one to
      undo block creation as block creation is one of the primitive operations in
      already supported region inlining.
      
      Support block creation in conversion patterns by hooking `createBlock` on the
      block action undo mechanism. This requires to make `Builder::createBlock`
      virtual, similarly to Op insertion. This is a minimal change to the Builder
      infrastructure that will later help support additional use cases such as block
      signature changes. `createBlock` now additionally takes the types of the block
      arguments that are added immediately so as to avoid in-place argument list
      manipulation that would be illegal in conversion patterns.
      f27f1e8c
  14. Apr 01, 2020
  15. Mar 31, 2020
  16. Mar 30, 2020
  17. Mar 26, 2020
    • Tres Popp's avatar
      [MLIR] Add parallel loop collapsing. · 27c201aa
      Tres Popp authored
      This allows conversion of a ParallelLoop from N induction variables to
      some nuber of induction variables less than N.
      
      The first intended use of this is for the GPUDialect to convert
      ParallelLoops to iterate over 3 dimensions so they can be launched as
      GPU Kernels.
      
      To implement this:
      - Normalize each iteration space of the ParallelLoop
      - Use the same induction variable in a new ParallelLoop for multiple
        original iterations.
      - Split the new induction variable back into the original set of values
        inside the body of the ParallelLoop.
      
      Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D76363
      27c201aa
  18. Mar 23, 2020
  19. Mar 22, 2020
  20. Mar 19, 2020
  21. Mar 18, 2020
  22. Mar 17, 2020
  23. Mar 12, 2020
    • River Riddle's avatar
      [mlir][SideEffects] Replace HasNoSideEffect with the memory effect interfaces. · 0ddba0bd
      River Riddle authored
      HasNoSideEffect can now be implemented using the MemoryEffectInterface, removing the need to check multiple things for the same information. This also removes an easy foot-gun for users as 'Operation::hasNoSideEffect' would ignore operations that dynamically, or recursively, have no side effects. This also leads to an immediate improvement in some of the existing users, such as DCE, now that they have access to more information.
      
      Differential Revision: https://reviews.llvm.org/D76036
      0ddba0bd
    • Tim Shen's avatar
      [mlir] Add a simplifying wrapper for generateCopy and expose it. · d00f5632
      Tim Shen authored
      Summary:
      affineDataCopyGenerate is a monolithinc function that
      combines several steps for good reasons, but it makes customizing
      the behaivor even harder. The major two steps by affineDataCopyGenerate are:
      a) Identify interesting memrefs and collect their uses.
      b) Create new buffers to forward these uses.
      
      Step (a) actually has requires tremendous customization options. One could see
      that from the recently added filterMemRef parameter.
      
      This patch adds a function that only does (b), in the hope that (a)
      can be directly implemented by the callers. In fact, (a) is quite
      simple if the caller has only one buffer to consider, or even one use.
      
      Differential Revision: https://reviews.llvm.org/D75965
      d00f5632
  24. Mar 10, 2020
  25. Mar 09, 2020
  26. Mar 05, 2020
  27. Feb 14, 2020
  28. Feb 11, 2020
    • Andy Davis's avatar
      [mlir][AffineOps] Adds affine loop fusion transformation function to LoopFusionUtils. · 40b2eb35
      Andy Davis authored
      Summary:
      Adds affine loop fusion transformation function to LoopFusionUtils.
      Updates TestLoopFusion utility to run loop fusion transformation until a fixed point is reached.
      Adds unit tests to test the transformation.
      Includes ASAN bug fix for D73190.
      
      Reviewers: bondhugula, dcaballe
      
      Reviewed By: bondhugula, dcaballe
      
      Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74330
      40b2eb35
  29. Feb 10, 2020
Loading