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

Alexey Lapshin via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 17 13:10:47 PDT 2025


================
@@ -746,6 +770,17 @@ bool TailRecursionEliminator::eliminateCall(CallInst *CI) {
   CI->eraseFromParent();   // Remove call.
   DTU.applyUpdates({{DominatorTree::Insert, BB, HeaderBB}});
   ++NumEliminated;
+  if (OrigEntryBBFreq) {
+    assert(F.getEntryCount().has_value());
+    auto It = OriginalBBFreqs.find(BB);
+    assert(It != OriginalBBFreqs.end());
----------------
avl-llvm wrote:

looks like blocks frequency was not changed. Could we ask here  

BFI->getBlockFreq(&BB).getFrequency()

instead of storing it into the OriginalBBFreqs map?

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


More information about the llvm-commits mailing list