[all-commits] [llvm/llvm-project] b0a4e9: [mlir][bufferization] Add support for non-unique `...

Matthias Springer via All-commits all-commits at lists.llvm.org
Tue Nov 12 15:52:01 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b0a4e958e85784cff46303c92b6a3a14b20fa1d8
      https://github.com/llvm/llvm-project/commit/b0a4e958e85784cff46303c92b6a3a14b20fa1d8
  Author: Matthias Springer <me at m-sp.org>
  Date:   2024-11-13 (Wed, 13 Nov 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.h
    M mlir/lib/Dialect/Bufferization/Transforms/FuncBufferizableOpInterfaceImpl.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
    M mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize-analysis.mlir
    M mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize-invalid.mlir
    M mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir

  Log Message:
  -----------
  [mlir][bufferization] Add support for non-unique `func.return` (#114017)

Multiple `func.return` ops inside of a `func.func` op are now supported
during bufferization. This PR extends the code base in 3 places:

- When inferring function return types, `memref.cast` ops are folded
away only if all `func.return` ops have matching buffer types. (E.g., we
don't fold if two `return` ops have operands with different layout
maps.)
- The alias sets of all `func.return` ops are merged. That's because
aliasing is a "may be" property.
- The equivalence sets of all `func.return` ops are taken only if they
match. If different `func.return` ops have different equivalence sets
for their operands, the equivalence information is dropped. That's
because equivalence is a "must be" property.

This commit is in preparation of removing the deprecated
`func-bufferize` pass. That pass can bufferize functions with multiple
`return` ops.



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