Skip to content
  1. Nov 21, 2019
  2. Nov 20, 2019
    • Sean Silva's avatar
      Add multi-level DCE pass. · e4f83c6c
      Sean Silva authored
      This is a simple multi-level DCE pass that operates pretty generically on
      the IR. Its key feature compared to the existing peephole dead op folding
      that happens during canonicalization is being able to delete recursively
      dead cycles of the use-def graph, including block arguments.
      
      PiperOrigin-RevId: 281568202
      e4f83c6c
    • Alexander Belyaev's avatar
      Fix 'the the' typo. · e5026165
      Alexander Belyaev authored
      PiperOrigin-RevId: 281501234
      e5026165
  3. Nov 19, 2019
  4. Nov 18, 2019
  5. Nov 15, 2019
  6. Nov 14, 2019
    • Andy Davis's avatar
      Adds canonicalizer to SubViewOp which folds constants from base memref and... · a4669cd3
      Andy Davis authored
      Adds canonicalizer to SubViewOp which folds constants from base memref and operands into the subview result memref type.
      Changes SubViewOp to support zero operands case, when offset, strides and sizes are all constant.
      
      PiperOrigin-RevId: 280485075
      a4669cd3
    • Nicolas Vasilache's avatar
      Move VectorOps to Tablegen - (almost) NFC · f2b6ae99
      Nicolas Vasilache authored
      This CL moves VectorOps to Tablegen and cleans up the implementation.
      
      This is almost NFC but 2 changes occur:
        1. an interface change occurs in the padding value specification in vector_transfer_read:
           the value becomes non-optional. As a shortcut we currently use %f0 for all paddings.
           This should become an OpInterface for vectorization in the future.
        2. the return type of vector.type_cast is trivial and simplified to `memref<vector<...>>`
      
      Relevant roundtrip and invalid tests that used to sit in core are moved to the vector dialect.
      
      The op documentation is moved to the .td file.
      
      PiperOrigin-RevId: 280430869
      f2b6ae99
  7. Nov 13, 2019
    • River Riddle's avatar
      NFC: Refactor block signature conversion to not erase the original arguments. · d985c748
      River Riddle authored
      This refactors the implementation of block signature(type) conversion to not insert fake cast operations to perform the type conversion, but to instead create a new block containing the proper signature. This has the benefit of enabling the use of pre-computed analyses that rely on mapping values. It also leads to a much cleaner implementation overall. The major user facing change is that applySignatureConversion will now replace the entry block of the region, meaning that blocks generally shouldn't be cached over calls to applySignatureConversion.
      
      PiperOrigin-RevId: 280226936
      d985c748
  8. Nov 11, 2019
  9. Nov 07, 2019
  10. Nov 05, 2019
    • River Riddle's avatar
      Add a PatternRewriter hook to merge blocks, and use it to support for folding branches. · 2366561a
      River Riddle authored
      A pattern rewriter hook, mergeBlock, is added that allows for merging the operations of one block into the end of another. This is used to support a canonicalization pattern for branch operations that folds the branch when the successor has a single predecessor(the branch block).
      
      Example:
        ^bb0:
          %c0_i32 = constant 0 : i32
          br ^bb1(%c0_i32 : i32)
        ^bb1(%x : i32):
          return %x : i32
      
      becomes:
        ^bb0:
          %c0_i32 = constant 0 : i32
          return %c0_i32 : i32
      PiperOrigin-RevId: 278677825
      2366561a
  11. Nov 01, 2019
    • Mahesh Ravishankar's avatar
      Support lowering of imperfectly nested loops into GPU dialect. · 9cbbd8f4
      Mahesh Ravishankar authored
      The current lowering of loops to GPU only supports lowering of loop
      nests where the loops mapped to workgroups and workitems are perfectly
      nested. Here a new lowering is added to handle lowering of imperfectly
      nested loop body with the following properties
      1) The loops partitioned to workgroups are perfectly nested.
      2) The loop body of the inner most loop partitioned to workgroups can
      contain one or more loop nests that are to be partitioned across
      workitems. Each individual loops nests partitioned to workitems should
      also be perfectly nested.
      3) The number of workgroups and workitems are not deduced from the
      loop bounds but are passed in by the caller of the lowering as values.
      4) For statements within the perfectly nested loop nest partitioned
      across workgroups that are not loops, it is valid to have all threads
      execute that statement. This is NOT verified.
      
      PiperOrigin-RevId: 277958868
      9cbbd8f4
  12. Oct 30, 2019
  13. Oct 28, 2019
    • River Riddle's avatar
      Add support for marking an operation as recursively legal. · 2f4d0c08
      River Riddle authored
      In some cases, it may be desirable to mark entire regions of operations as legal. This provides an additional granularity of context to the concept of "legal". The `ConversionTarget` supports marking operations, that were previously added as `Legal` or `Dynamic`, as `recursively` legal. Recursive legality means that if an operation instance is legal, either statically or dynamically, all of the operations nested within are also considered legal. An operation can be marked via `markOpRecursivelyLegal<>`:
      
      ```c++
      ConversionTarget &target = ...;
      
      /// The operation must first be marked as `Legal` or `Dynamic`.
      target.addLegalOp<MyOp>(...);
      target.addDynamicallyLegalOp<MySecondOp>(...);
      
      /// Mark the operation as always recursively legal.
      target.markOpRecursivelyLegal<MyOp>();
      /// Mark optionally with a callback to allow selective marking.
      target.markOpRecursivelyLegal<MyOp, MySecondOp>([](Operation *op) { ... });
      /// Mark optionally with a callback to allow selective marking.
      target.markOpRecursivelyLegal<MyOp>([](MyOp op) { ... });
      ```
      
      PiperOrigin-RevId: 277086382
      2f4d0c08
  14. Oct 25, 2019
    • River Riddle's avatar
      Convert the Canonicalize and CSE passes to generic Operation Passes. · 2b61b797
      River Riddle authored
      This allows for them to be used on other non-function, or even other function-like, operations. The algorithms are already generic, so this is simply changing the derived pass type. The majority of this change is just ensuring that the nesting of these passes remains the same, as the pass manager won't auto-nest them anymore.
      
      PiperOrigin-RevId: 276573038
      2b61b797
  15. Oct 24, 2019
    • River Riddle's avatar
      Add @below and @above directives to verify-diagnostics. · 21ee4e98
      River Riddle authored
      This simplifies defining expected-* directives when there are multiple that apply to the next or previous line. @below applies the directive to the next non-designator line, i.e. the next line that does not contain an expected-* designator. @above applies to the previous non designator line.
      
      Examples:
      
      // Expect an error on the next line that does not contain a designator.
      // expected-remark@below {{remark on function below}}
      // expected-remark@below {{another remark on function below}}
      func @bar(%a : f32)
      
      // Expect an error on the previous line that does not contain a designator.
      func @baz(%a : f32)
      // expected-remark@above {{remark on function above}}
      // expected-remark@above {{another remark on function above}}
      
      PiperOrigin-RevId: 276369085
      21ee4e98
  16. Oct 20, 2019
  17. Oct 18, 2019
  18. Oct 16, 2019
  19. Oct 14, 2019
    • River Riddle's avatar
      Allowing replacing non-root operations in DialectConversion. · 96de7091
      River Riddle authored
      When dealing with regions, or other patterns that need to generate temporary operations, it is useful to be able to replace other operations than the root op being matched. Before this PR, these operations would still be considered for legalization meaning that the conversion would either fail, erroneously need to mark these ops as legal, or add unnecessary patterns.
      
      PiperOrigin-RevId: 274598513
      96de7091
  20. Oct 11, 2019
    • River Riddle's avatar
      Add support for canonicalizing callable regions during inlining. · 6b1cc3c6
      River Riddle authored
      This will allow for inlining newly devirtualized calls, as well as give a more accurate cost model(when we have one). Currently canonicalization will only run for nodes that have no child edges, as the child nodes may be erased during canonicalization. We can support this in the future, but it requires more intricate deletion tracking.
      
      PiperOrigin-RevId: 274011386
      6b1cc3c6
    • River Riddle's avatar
      Remove the need to convert operations in regions of operations that have been replaced. · 438dc176
      River Riddle authored
      When an operation with regions gets replaced, we currently require that all of the remaining nested operations are still converted even though they are going to be replaced when the rewrite is finished. This cl adds a tracking for a minimal set of operations that are known to be "dead". This allows for ignoring the legalization of operations that are won't survive after conversion.
      
      PiperOrigin-RevId: 274009003
      438dc176
  21. Oct 10, 2019
  22. Oct 09, 2019
    • Diego Caballero's avatar
      Add support for some multi-store cases in affine fusion · 34510556
      Diego Caballero authored
      This PR is a stepping stone towards supporting generic multi-store
      source loop nests in affine loop fusion. It extends the algorithm to
      support fusion of multi-store loop nests that:
       1. have only one store that writes to a function-local live out, and
       2. the remaining stores are involved in loop nest self dependences
          or no dependences within the function.
      
      Closes tensorflow/mlir#162
      
      COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/162 from dcaballe:dcaballe/multi-output-fusion 7fb7dec6fe8b45f5ce176f018bfe37b256420c45
      PiperOrigin-RevId: 273773907
      34510556
    • MLIR Team's avatar
      Add Instance Specific Pass Options. · 74461512
      MLIR Team authored
      This allows individual passes to define options structs and for these options to be parsed per instance of the pass while building the pass pipeline from the command line provided textual specification.
      
      The user can specify these per-instance pipeline options like so:
      ```
      struct MyPassOptions : public PassOptions<MyPassOptions> {
        Option<int> exampleOption{*this, "flag-name", llvm::cl::desc("...")};
        List<int> exampleListOption{*this, "list-flag-name", llvm::cl::desc("...")};
      };
      
      static PassRegistration<MyPass, MyPassOptions> pass("my-pass", "description");
      ```
      
      PiperOrigin-RevId: 273650140
      74461512
    • River Riddle's avatar
      Add a PatternRewriter hook for cloning a region into another. · 49b29dd1
      River Riddle authored
      This is similar to the `inlineRegionBefore` hook, except the original blocks are unchanged. The region to be cloned *must* not have been modified during the conversion process at the point of cloning, i.e. it must belong an operation that has yet to be converted, or the operation that is currently being converted.
      
      PiperOrigin-RevId: 273622533
      49b29dd1
    • Uday Bondhugula's avatar
      unroll and jam: fix order of jammed bodies · 6136f33d
      Uday Bondhugula authored
      
      
      - bodies would earlier appear in the order (i, i+3, i+2, i+1) instead of
        (i, i+1, i+2, i+3) for example for factor 4.
      
      - clean up hardcoded test cases
      
      Signed-off-by: default avatarUday Bondhugula <uday@polymagelabs.com>
      
      Closes tensorflow/mlir#170
      
      COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/170 from bondhugula:ujam b66b405b2b1894a03b376952e32a9d0292042665
      PiperOrigin-RevId: 273613131
      6136f33d
  23. Oct 07, 2019
  24. Oct 04, 2019
    • River Riddle's avatar
      Add support for inlining calls with different arg/result types from the callable. · 5830f71a
      River Riddle authored
      Some dialects have implicit conversions inherent in their modeling, meaning that a call may have a different type that the type that the callable expects. To support this, a hook is added to the dialect interface that allows for materializing conversion operations during inlining when there is a mismatch. A hook is also added to the callable interface to allow for introspecting the expected result types.
      
      PiperOrigin-RevId: 272814379
      5830f71a
    • River Riddle's avatar
      Update the Inliner pass to work on SCCs of the CallGraph. · a20d96e4
      River Riddle authored
      This allows for the inliner to work on arbitrary call operations. The updated inliner will also work bottom-up through the callgraph enabling support for multiple levels of inlining.
      
      PiperOrigin-RevId: 272813876
      a20d96e4
  25. Sep 24, 2019
  26. Sep 21, 2019
    • Uday Bondhugula's avatar
      Upgrade/fix/simplify store to load forwarding · f559c38c
      Uday Bondhugula authored
      - fix store to load forwarding for a certain set of cases (where
        forwarding shouldn't have happened); use AffineValueMap difference
        based MemRefAccess equality checking; utility logic is also greatly
        simplified
      
      - add missing equality/inequality operators for AffineExpr ==/!= ints
      
      - add == != operators on MemRefAccess
      
      Closes tensorflow/mlir#136
      
      COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/136 from bondhugula:store-load-forwarding d79fd1add8bcfbd9fa71d841a6a9905340dcd792
      PiperOrigin-RevId: 270457011
      f559c38c
  27. Sep 18, 2019
  28. Sep 17, 2019
    • Uday Bondhugula's avatar
      Add rewrite pattern to compose maps into affine load/stores · bd7de6d4
      Uday Bondhugula authored
      
      
      - add canonicalization pattern to compose maps into affine loads/stores;
        templatize the pattern and reuse it for affine.apply as well
      
      - rename getIndices -> getMapOperands() (getIndices is confusing since
        these are no longer the indices themselves but operands to the map
        whose results are the indices). This also makes the accessor uniform
        across affine.apply/load/store. Change arg names on the affine
        load/store builder to avoid confusion. Drop an unused confusing build
        method on AffineStoreOp.
      
      - update incomplete doc comment for canonicalizeMapAndOperands (this was
        missed from a previous update).
      
      Addresses issue tensorflow/mlir#121
      
      Signed-off-by: default avatarUday Bondhugula <uday@polymagelabs.com>
      
      Closes tensorflow/mlir#122
      
      COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/122 from bondhugula:compose-load-store e71de1771e56a85c4282c10cb43f30cef0701c4f
      PiperOrigin-RevId: 269619540
      bd7de6d4
Loading