[mlir][llvm] Add memcpy support for mem2reg/sroa.
authorThéo Degioanni <theo.degioanni@nextsilicon.com>
Fri, 16 Jun 2023 08:34:59 +0000 (08:34 +0000)
committerThéo Degioanni <theo.degioanni@nextsilicon.com>
Fri, 16 Jun 2023 08:35:20 +0000 (08:35 +0000)
commit3bd85cf7c208810c3370f2ea2a34ff7f32649577
treeefc9d127b60e4a8cbb369926ab63aad11157bc57
parent40241935e92377dab4ae966c9e4fc9f5d458b956
[mlir][llvm] Add memcpy support for mem2reg/sroa.

This revision introduces SROA and mem2reg support for the family of
memcpy-like intrinsics (memcpy, memcpy.inline and memmove).

The mem2reg implementation transforms memcpys of full types into loads
and store. Memcpy between two promotable slots always disappear.

The SROA implementation transforms memcpys of *entire* aggregate types
into memcpys of all of their fields.

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D152898
mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
mlir/test/Dialect/LLVMIR/mem2reg-intrinsics.mlir
mlir/test/Dialect/LLVMIR/sroa-intrinsics.mlir