[all-commits] [llvm/llvm-project] 0af448: [MLIR][Bufferization] BufferResultsToOutParams: Ad...

Menooker via All-commits all-commits at lists.llvm.org
Tue May 7 19:15:15 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0af448b71116ae93eae1cb9c3121cb94be076fc3
      https://github.com/llvm/llvm-project/commit/0af448b71116ae93eae1cb9c3121cb94be076fc3
  Author: Menooker <yijie.mei at intel.com>
  Date:   2024-05-08 (Wed, 08 May 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.h
    M mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td
    M mlir/lib/Dialect/Bufferization/Transforms/BufferResultsToOutParams.cpp
    A mlir/test/Transforms/buffer-results-to-out-params-elim.mlir

  Log Message:
  -----------
  [MLIR][Bufferization] BufferResultsToOutParams: Add an option to eliminate AllocOp and avoid Copy (#90011)

Add an option hoist-static-allocs to remove the unnecessary memref.alloc
and memref.copy after this pass, when the memref in ReturnOp is
allocated by memref.alloc and is statically shaped. Instead, it replaces
the uses of the allocated memref with the memref in the out argument.
By default, BufferResultsToOutParams will result in a memcpy operation
to copy the originally returned memref to the output argument memref.
This is inefficient when the source of memcpy (the returned memref in
the original ReturnOp) is from a local AllocOp. The pass can use the
output argument memref to replace the locally allocated memref for
better performance.hoist-static-allocs avoids dynamic allocation and
memory movement.
This option will be critical for performance-sensivtive applications,
which require BufferResultsToOutParams pass for a caller-owned output
buffer calling convension.



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