Similar Function Merging

Hello! I heard “similar function merging” discussed at the Developers’ Meeting a couple of weeks ago, and I wanted to look into this more for potential code size reduction as it focused on merging functions with small differences rather than identical function merging.

Is https://reviews.llvm.org/D85616 the latest review for this pass? Any ideas on when it will be able to be upstreamed?

Can this pass be run even when –ffunction-sections is enabled? Also, I understand this pass is most useful during LTO, when there is better knowledge as to the functions that are kept in the final link.

Thanks!

-Alan Phipps

Hi Alan,
Here are the patches that port merge similar functions to the ThinLTO

-https://reviews.llvm.org/D52896
-https://reviews.llvm.org/D52898
-https://reviews.llvm.org/D52966
-https://reviews.llvm.org/D53253
-https://reviews.llvm.org/D53254

Before merging the patches we wanted to improve the comparison of IR Types. That project started in the GSoC this year and the patch to improve comparison or IR Types is posted by Vishal:

https://reviews.llvm.org/D82892

-Aditya