[all-commits] [llvm/llvm-project] 8f7e74: [mlir][bufferization] Add restrict and writable at...

Matthias Springer via All-commits all-commits at lists.llvm.org
Wed Feb 15 01:16:13 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8f7e7400b74b362251dcf155e45f4097fd574196
      https://github.com/llvm/llvm-project/commit/8f7e7400b74b362251dcf155e45f4097fd574196
  Author: Matthias Springer <springerm at google.com>
  Date:   2023-02-15 (Wed, 15 Feb 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
    M mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.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/ops.mlir

  Log Message:
  -----------
  [mlir][bufferization] Add restrict and writable attrs to to_tensor

`restrict` is similar to the C++ restrict keyword. Results of `to_tensor` that have the `restrict` attribute are guaranteed to not alias any other `to_tensor` result (after bufferization).

Note: Since `to_memref` ops are not supported by One-Shot Bufferize and all bufferizable ops follow DPS rules (i.e., the buffer of the result is the buffer of an operand or an alias thereof), the buffer of a `to_tensor` op that has the `restrict` attribute is always an entirely "new" buffer that is not aliasing with the future buffer of any tensor value in the entire program. This makes such `to_tensor` ops "safe" from a bufferization perspective; they cannot cause RaW conflicts.

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




More information about the All-commits mailing list