[MLIR] Add pass to deduplicate functions
authorFrederik Gossen <frgossen@google.com>
Mon, 27 Feb 2023 15:58:56 +0000 (10:58 -0500)
committerFrederik Gossen <frgossen@google.com>
Mon, 27 Feb 2023 15:59:53 +0000 (10:59 -0500)
commitb12bcf3fb7fa7f968e8bd77b466057509ab2e04b
tree23cccd5132e6dc4ef66c44a0ed19cf4e1f1df7ea
parent8877d8f5caacbbb87bb4236512c81d855f09539e
[MLIR] Add pass to deduplicate functions

Deduplicate functions that are equivalent in all aspects but their symbol name.
The pass chooses one representative per equivalence class, erases the remainder, and updates function calls accordingly.

Differential Revision: https://reviews.llvm.org/D144738
mlir/include/mlir/Dialect/Func/Transforms/Passes.h
mlir/include/mlir/Dialect/Func/Transforms/Passes.td
mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
mlir/lib/Dialect/Func/Transforms/DuplicateFunctionElimination.cpp [new file with mode: 0644]
mlir/test/Dialect/Func/duplicate-function-elimination.mlir [new file with mode: 0644]