[all-commits] [llvm/llvm-project] 73bea9: [mlir][Linalg] Add support for CallOp bufferizatio...

Nicolas Vasilache via All-commits all-commits at lists.llvm.org
Thu Jul 1 03:41:40 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73bea97a336ba2da276ef34fd21b2c5c676b0a97
      https://github.com/llvm/llvm-project/commit/73bea97a336ba2da276ef34fd21b2c5c676b0a97
  Author: Nicolas Vasilache <nicolas.vasilache at gmail.com>
  Date:   2021-07-01 (Thu, 01 Jul 2021)

  Changed paths:
    M mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
    M mlir/test/Dialect/Linalg/comprehensive-module-bufferize-invalid.mlir
    A mlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir

  Log Message:
  -----------
  [mlir][Linalg] Add support for CallOp bufferization (10/n)

Cross function boundary bufferization support is added.
This is enabled by cross-function boundary alias analysis, for which the bufferization process is extended: it can now modify the BufferizationAliasInfo as new ops are introduced.

A number of simplifying assumptions are made:

1. by default we bufferize to the most dynamic strided memref type, further memref::CastOp canonicalizations are expected to clean up the IR.
2. in the current implementation, the stride information is always erased at function boundaries. A subsequent pass will be required to analyze the meet of all call ops to a function and decide whether more static buffer types can be used. This will potentially clone functions when it is deemed profitable to do so (e.g. when the stride-1 dimension may vary).
3. external function always bufferize to the most dynamic strided memref version. This may require special annotations for specifying that particular operands of top-level functions have contiguous buffer layout.

An alternative to point 3. would be to support tensor layout annotations, which is currently not supported in MLIR.

Differential revision: https://reviews.llvm.org/D104873




More information about the All-commits mailing list