[llvm] [TRE] Adjust function entry count when using instrumented profiles (PR #143987)
Mircea Trofin via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 20 11:46:48 PDT 2025
================
@@ -428,8 +438,19 @@ class TailRecursionEliminator {
TailRecursionEliminator(Function &F, const TargetTransformInfo *TTI,
AliasAnalysis *AA, OptimizationRemarkEmitter *ORE,
- DomTreeUpdater &DTU)
- : F(F), TTI(TTI), AA(AA), ORE(ORE), DTU(DTU) {}
+ DomTreeUpdater &DTU, BlockFrequencyInfo *BFI)
+ : F(F), TTI(TTI), AA(AA), ORE(ORE), DTU(DTU), BFI(BFI),
+ OrigEntryBBFreq(
+ BFI ? BFI->getBlockFreq(&F.getEntryBlock()).getFrequency() : 0U) {
+ if (BFI) {
+ auto EC = F.getEntryCount();
+ (void)EC;
+ assert((EC.has_value() && EC->getCount() != 0 && OrigEntryBBFreq) &&
----------------
mtrofin wrote:
it's just for the caller. added a comment.
https://github.com/llvm/llvm-project/pull/143987
More information about the llvm-commits
mailing list