[llvm] [FuncSpec] Improve accounting of specialization codesize growth (PR #113448)
Alexandros Lamprineas via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 24 03:05:47 PDT 2024
================
@@ -964,7 +970,7 @@ bool FunctionSpecializer::findSpecializations(Function *F, unsigned FuncSize,
if (LatencySavings < MinLatencySavings * FuncSize / 100)
return false;
// Maximum codesize growth.
- if (FunctionGrowth[F] / FuncSize > MaxCodeSizeGrowth)
+ if ((FunctionGrowth[F] + CodeSizeCost) / FuncSize > MaxCodeSizeGrowth)
return false;
----------------
labrinea wrote:
Here we successfully got past the FuncGrowth check. We know for sure the specialization will be created. We can safely do `FunctionGrowth[F] += SpecSize;` at this point, before returning `true`.
https://github.com/llvm/llvm-project/pull/113448
More information about the llvm-commits
mailing list