Skip to content

Commit

Permalink
merge-functions pass
Browse files Browse the repository at this point in the history
Merge similar functions that only differs constant values (like immediate
operand of const and call insts) by parameterization.
Performing this pass at post-link time can merge more functions across
objects. Inspired by Swift compiler's optimization which is derived from
LLVM's one:
https://github.com/apple/swift/blob/main/lib/LLVMPasses/LLVMMergeFunctions.cpp
https://github.com/llvm/llvm-project/blob/main/llvm/docs/MergeFunctions.rst
  • Loading branch information
kateinoigakukun committed Jan 8, 2022
1 parent 1ef8f1f commit d6647d0
Show file tree
Hide file tree
Showing 9 changed files with 1,412 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/passes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ set(passes_SOURCES
Memory64Lowering.cpp
MemoryPacking.cpp
MergeBlocks.cpp
MergeFunctions.cpp
MergeLocals.cpp
Metrics.cpp
MinifyImportsAndExports.cpp
Expand Down

0 comments on commit d6647d0

Please sign in to comment.