This patch adds Function specialization pass to LLVM. The constant parameters (like function pointers, numerical constants) are propagated to the callee by specializing the function. It also handles specialization of the recursive functions. This change is just to give the full context for patch D93762. The pass is still missing the profitability.
The pass is based on the Function specialization proposed here.
Performance: There are significant gains in two SPEC CPU 2017 intrate benchmarks. I am yet to do the complete SPEC run and measure the speed /size change.