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

Amir Ayupov via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 16:06:07 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) {
----------------
aaupov wrote:

Right. Yes, it was tested with perf2bolt in NFC testing mode.

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


More information about the llvm-commits mailing list