================ @@ -266,6 +325,122 @@ class StaleMatcher { } return BestBlock; } + + /// A helper function for logging. + static bool LogErrIfExpr(bool Expr, StringRef Message) { + if (Expr) + errs() << Message; + return Expr; + } + + /// Matches an inlined profile block with an inlined binary block based on + /// pseudo probes. + const FlowBlock *matchWithInlinedBlockPseudoProbes( + SmallVector<const yaml::bolt::PseudoProbeInfo *> + &InlinedBlockPseudoProbes) const { + if (opts::Verbosity >= 3) + outs() << "BOLT-INFO: attempting to match block with inlined block " + "pseudo probes\n"; + + size_t NInlinedBlockPseudoProbes = InlinedBlockPseudoProbes.size(); + if (LogErrIfExpr(NInlinedBlockPseudoProbes == 0, + "BOLT-WARNING: no pseudo probes in profile block\n")) + return nullptr; + if (LogErrIfExpr( + NInlinedBlockPseudoProbes > 1, ---------------- wlei-llvm wrote:
it should be common that one basic block contains >1 pseudo probes, e.g. when inlining happens, the inlinee's entry pseudo probe(ID:1) is inlined to replace the inline callsite, whose basic block contains the inliner's pseudo probe. https://github.com/llvm/llvm-project/pull/99891 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits