[all-commits] [llvm/llvm-project] 67fc16: [MLIR] Add bufferization state class to OneShotBuf...

Michele Scuttari via All-commits all-commits at lists.llvm.org
Wed May 21 23:53:59 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 67fc1660d987d145a68a3c3dfbccfbe4b91fba59
      https://github.com/llvm/llvm-project/commit/67fc1660d987d145a68a3c3dfbccfbe4b91fba59
  Author: Michele Scuttari <michele.scuttari at outlook.com>
  Date:   2025-05-22 (Thu, 22 May 2025)

  Changed paths:
    M mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h
    M mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td
    M mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
    M mlir/include/mlir/Dialect/Bufferization/Transforms/BufferUtils.h
    M mlir/include/mlir/Dialect/Bufferization/Transforms/Bufferize.h
    M mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h
    M mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotModuleBufferize.h
    M mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
    M mlir/lib/Dialect/Arith/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
    M mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
    M mlir/lib/Dialect/Bufferization/TransformOps/BufferizationTransformOps.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/BufferUtils.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
    M mlir/lib/Dialect/ControlFlow/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/Linalg/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/Linalg/Transforms/ConvertToDestinationStyle.cpp
    M mlir/lib/Dialect/MLProgram/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/Shape/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/SparsificationAndBufferizationPass.cpp
    M mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.cpp

  Log Message:
  -----------
  [MLIR] Add bufferization state class to OneShotBufferization pass (#138143)

This PR is a follow-up on #138125, and adds a bufferization state class providing information about the IR. The information currently consists of a cached list of symbol tables, which aims to solve the quadratic scaling of the bufferization task with respect to the number of symbols. The PR breaks API compatibility: the `bufferize` method of the `BufferizableOpInterface` has been enriched with a reference to a `BufferizationState` object.

The bufferization state must be kept in a valid state by the interface implementations. For example, if an operation with the `Symbol` trait is inserted or replaced, its parent `SymbolTable` must be updated accordingly (see, for example, the bufferization of `arith::ConstantOp`, where the symbol table of the module gets the new global symbol inserted). Similarly, the invalidation of a symbol table must be performed if an operation with the `SymbolTable` trait is removed (this can be performed using the `invalidateSymbolTable` method, introduced in #138014).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list