[llvm] [TRE] Adjust function entry count (PR #143987)

Alexey Lapshin via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 17 12:07:14 PDT 2025


================
@@ -628,7 +628,10 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
       !Level.isOptimizingForSize())
     FPM.addPass(PGOMemOPSizeOpt());
 
-  FPM.addPass(TailCallElimPass());
+  FPM.addPass(
+      TailCallElimPass(/*UpdateFunctionEntryCount=*/(
+                           PGOOpt && PGOOpt->Action == PGOOptions::IRUse) ||
+                       !UseCtxProfile.empty()));
----------------
avl-llvm wrote:

This fragment has been duplicated several times:

```
PGOOpt && PGOOpt->Action == PGOOptions::IRUse) ||
                       !UseCtxProfile.empty()

```                       
worth to make it as separate function.

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


More information about the llvm-commits mailing list