[llvm] [FnSpecialization] Enable function specialization of call chains (PR #163891)

Alexandros Lamprineas via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 23 07:23:42 PDT 2025


labrinea wrote:

> when specializing for the 3 passed to bar(), the value isn't propagated into foo() to gauge benefit from specializing foo() as well

The function `InstCostVisitor::visitCallBase` tries to compute benefit from constant folding if possible. In this example it cannot constant fold `foo(3)` while propagating the constant inside bar's body. However given a small enough codesize threshold this example gets specialized: https://godbolt.org/z/dvfMov9WM

https://github.com/llvm/llvm-project/pull/163891


More information about the llvm-commits mailing list