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

Michele Scuttari via All-commits all-commits at lists.llvm.org
Fri May 23 00:21:56 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 61d5fdf50c78810972f5984473600fd917ccaff5
      https://github.com/llvm/llvm-project/commit/61d5fdf50c78810972f5984473600fd917ccaff5
  Author: Michele Scuttari <michele.scuttari at outlook.com>
  Date:   2025-05-23 (Fri, 23 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 (#141019)

Follow-up on #138143, which was reverted due to a missing update a method signature (more specifically, the bufferization interface for `tensor::ConcatOp`) that was not catched before merging. The old PR description is reported in the next lines.

This PR is a follow-up on https://github.com/llvm/llvm-project/pull/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 https://github.com/llvm/llvm-project/pull/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