Reland "[mlir][mem2reg] Expose algorithm internals."
authorThéo Degioanni <theo.degioanni@nextsilicon.com>
Tue, 9 May 2023 09:01:33 +0000 (09:01 +0000)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Tue, 9 May 2023 09:24:49 +0000 (09:24 +0000)
commit92cc30aca78703174e89880aca85e5a5ff41cc98
tree921688210fea6da26afe27cca896b3c72172c818
parentfeb69dad8a131d718d7c44e983e1cf6ef202127c
Reland "[mlir][mem2reg] Expose algorithm internals."

This patch refactors the Mem2Reg infrastructure. It decouples
analysis from promotion, allowing for more control over the execution of
the logic. It also adjusts the interfaces to be less coupled to mem2reg
and more general. This will be useful for an upcoming revision
introducing generic SROA.

This commit reverts f333977eb20a and relands 91cff8a71872.

The original commit was reverted accidentally due to a misinterpretation
of a bazel build bot failure.

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D149825
15 files changed:
mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/include/mlir/Dialect/MemRef/IR/MemRef.h
mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
mlir/include/mlir/Interfaces/CMakeLists.txt
mlir/include/mlir/Interfaces/MemorySlotInterfaces.h [moved from mlir/include/mlir/Interfaces/Mem2RegInterfaces.h with 83% similarity]
mlir/include/mlir/Interfaces/MemorySlotInterfaces.td [moved from mlir/include/mlir/Interfaces/Mem2RegInterfaces.td with 91% similarity]
mlir/include/mlir/Transforms/Mem2Reg.h
mlir/lib/Dialect/LLVMIR/CMakeLists.txt
mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp [moved from mlir/lib/Dialect/LLVMIR/IR/LLVMMem2Reg.cpp with 81% similarity]
mlir/lib/Dialect/MemRef/IR/MemRefMem2Reg.cpp
mlir/lib/Interfaces/CMakeLists.txt
mlir/lib/Interfaces/MemorySlotInterfaces.cpp [moved from mlir/lib/Interfaces/Mem2RegInterfaces.cpp with 64% similarity]
mlir/lib/Transforms/CMakeLists.txt
mlir/lib/Transforms/Mem2Reg.cpp