[all-commits] [llvm/llvm-project] ab4741: [mlir][bufferize] Merge tensor-constant-bufferize ...

Matthias Springer via All-commits all-commits at lists.llvm.org
Sun Jan 30 04:38:29 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ab47418df67010c6cf97b5f9797bf65e855cef3f
      https://github.com/llvm/llvm-project/commit/ab47418df67010c6cf97b5f9797bf65e855cef3f
  Author: Matthias Springer <springerm at google.com>
  Date:   2022-01-30 (Sun, 30 Jan 2022)

  Changed paths:
    M mlir/docs/Bufferization.md
    M mlir/include/mlir/Dialect/Arithmetic/Transforms/Passes.h
    M mlir/include/mlir/Dialect/Arithmetic/Transforms/Passes.td
    M mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h
    M mlir/include/mlir/Dialect/Bufferization/Transforms/BufferUtils.h
    M mlir/include/mlir/Dialect/StandardOps/Transforms/Passes.h
    M mlir/include/mlir/Dialect/StandardOps/Transforms/Passes.td
    M mlir/lib/Dialect/Arithmetic/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/Arithmetic/Transforms/Bufferize.cpp
    M mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/BufferUtils.cpp
    M mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp
    M mlir/lib/Dialect/SparseTensor/Pipelines/CMakeLists.txt
    M mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp
    M mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt
    R mlir/lib/Dialect/StandardOps/Transforms/TensorConstantBufferize.cpp
    M mlir/test/Dialect/Arithmetic/bufferize.mlir
    M mlir/test/Dialect/SparseTensor/sparse_lower.mlir
    M mlir/test/Dialect/SparseTensor/sparse_lower_col.mlir
    M mlir/test/Dialect/SparseTensor/sparse_lower_inplace.mlir
    R mlir/test/Dialect/Standard/tensor-constant-bufferize.mlir
    M mlir/test/Integration/Dialect/Linalg/CPU/test-collapse-tensor.mlir
    M mlir/test/Integration/Dialect/Linalg/CPU/test-elementwise.mlir
    M mlir/test/Integration/Dialect/Linalg/CPU/test-expand-tensor.mlir
    M mlir/test/Integration/Dialect/Linalg/CPU/test-padtensor.mlir
    M mlir/test/Integration/Dialect/Linalg/CPU/test-subtensor-insert-multiple-uses.mlir
    M mlir/test/Integration/Dialect/Linalg/CPU/test-subtensor-insert.mlir
    M mlir/test/Integration/Dialect/Linalg/CPU/test-tensor-e2e.mlir
    M mlir/test/Integration/Dialect/Linalg/CPU/test-tensor-matmul.mlir
    M mlir/test/Integration/Dialect/SparseTensor/python/test_SDDMM.py
    M mlir/test/Integration/Dialect/SparseTensor/python/test_SpMM.py
    M mlir/test/Integration/Dialect/SparseTensor/python/test_elementwise_add_sparse_output.py
    M mlir/test/Integration/Dialect/SparseTensor/python/test_output.py
    M mlir/test/Integration/Dialect/SparseTensor/python/test_stress.py
    M mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco.py
    M mlir/test/lib/Dialect/Linalg/TestComprehensiveBufferize.cpp

  Log Message:
  -----------
  [mlir][bufferize] Merge tensor-constant-bufferize into arith-bufferize

The bufferization of arith.constant ops is also switched over to BufferizableOpInterface-based bufferization. The old implementation is deleted. Both implementations utilize GlobalCreator, now renamed to just `getGlobalFor`.

GlobalCreator no longer maintains a set of all created allocations to avoid duplicate allocations of the same constant. Instead, `getGlobalFor` scans the module to see if there is already a global allocation with the same constant value.

For compatibility reasons, it is still possible to create a pass that bufferizes only `arith.constant`. This pass (createConstantBufferizePass) could be deleted once all users were switched over to One-Shot bufferization.

Differential Revision: https://reviews.llvm.org/D118483




More information about the All-commits mailing list