[llvm] [BOLT] Set call to continuation count in pre-aggregated profile (PR #109486)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 11:53:42 PDT 2024


================
@@ -774,42 +774,86 @@ bool DataAggregator::doInterBranch(BinaryFunction *FromFunc,
 }
 
 bool DataAggregator::doBranch(uint64_t From, uint64_t To, uint64_t Count,
-                              uint64_t Mispreds) {
-  bool IsReturn = false;
-  auto handleAddress = [&](uint64_t &Addr, bool IsFrom) -> BinaryFunction * {
-    if (BinaryFunction *Func = getBinaryFunctionContainingAddress(Addr)) {
-      Addr -= Func->getAddress();
-      if (IsFrom) {
-        auto checkReturn = [&](auto MaybeInst) {
-          IsReturn = MaybeInst && BC->MIB->isReturn(*MaybeInst);
-        };
-        if (Func->hasInstructions())
-          checkReturn(Func->getInstructionAtOffset(Addr));
-        else
-          checkReturn(Func->disassembleInstructionAtOffset(Addr));
-      }
+                              uint64_t Mispreds, bool IsPreagg) {
----------------
maksfb wrote:

When `IsPreagg == false`, is this function supposed to be functionally equivalent to the old version? Did you test it?

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


More information about the llvm-commits mailing list