Lines Matching full:profile
1 //===- SampleProfileMatcher.cpp - Sampling-based Stale Profile Matcher ----===//
10 // profile matching.
22 #define DEBUG_TYPE "sample-profile-matcher"
25 "func-profile-similarity-threshold", cl::Hidden, cl::init(80),
26 cl::desc("Consider a profile matches a function if the similarity of their "
32 "run stale profile call graph matching."));
37 "run stale profile call graph matching."));
45 "salvage-stale-profile-max-callsites", cl::Hidden, cl::init(UINT_MAX),
47 "profile matching will be skipped."));
75 // Extract profile matching anchors in the IR. in findIRAnchors()
100 // TODO: For line-number based profile(AutoFDO), currently only support in findIRAnchors()
102 // instructions to extract the line locations for profile matching. in findIRAnchors()
173 // If IR function doesn't have profile and the profile is unused, try in functionMatchesProfile()
181 "IR function should be different from profile function to match"); in functionMatchesProfile()
338 // Call target name anchor based profile fuzzy matching.
341 // profile locations, it's the call target name for BodySamples or inlinee's
342 // profile name for CallsiteSamples.
349 // Profile locations: [1, 2, 3(foo), 4, 7, 8(bar), 9]
361 LLVM_DEBUG(dbgs() << "Run stale profile matching for " << F.getName() in runStaleProfileMatching()
364 "Run stale profile matching only once per function"); in runStaleProfileMatching()
376 LLVM_DEBUG(dbgs() << "Skip stale profile matching for " << F.getName() in runStaleProfileMatching()
379 << " and in the profile is " in runStaleProfileMatching()
385 // between IR and profile. in runStaleProfileMatching()
390 // For 2), we only consider the anchor functions from IR and profile don't in runStaleProfileMatching()
409 // in profile only show up when they are hit by samples, i,e. the profile in runOnFunction()
412 // contexts, aka, the flattened profile to find profile anchors. in runOnFunction()
415 // Apply the matching in place to find the new function's matched profile. in runOnFunction()
416 // TODO: For extended profile format, if a function profile is unused and in runOnFunction()
417 // it's top-level, even if the profile is matched, it's not found in the in runOnFunction()
418 // profile. This is because sample reader only read the used profile at the in runOnFunction()
419 // beginning, we need to support loading the profile on-demand in future. in runOnFunction()
432 // Anchors for profile. It's a map from callsite location to a set of callee in runOnFunction()
437 // Compute the callsite match states for profile staleness report. in runOnFunction()
443 // For probe-based profiles, run matching only when profile checksum is in runOnFunction()
451 // dropped, so we leverage function attribute(profile-checksum-mismatch) to in runOnFunction()
455 F.addFnAttr("profile-checksum-mismatch"); in runOnFunction()
488 // After fuzzy profile matching, use the matching result to remap the in recordCallsiteMatchStates()
509 // Check if there are any callsites in the profile that does not match to any in recordCallsiteMatchStates()
580 // profile, go through it to count the non-inlined callsite samples. in countMismatchedCallsiteSamples()
615 "Profile matching state is inconsistent"); in countMismatchCallsites()
653 // Count profile mismatches for profile staleness report. in computeAndReportProfileStaleness()
682 << ") of functions' profile are invalid and (" in computeAndReportProfileStaleness()
688 << TotalProfiledFunc << ") of functions' profile are matched and (" in computeAndReportProfileStaleness()
695 << ") of callsites' profile are invalid and (" in computeAndReportProfileStaleness()
703 << ") of samples are recovered by stale profile matching.\n"; in computeAndReportProfileStaleness()
741 // TODO: Support MD5 profile. in findFunctionsWithoutProfile()
762 // top-level profile, so check the NameTable which has the all symbol names in findFunctionsWithoutProfile()
763 // in profile. in findFunctionsWithoutProfile()
767 // For extended binary, non-profiled function symbols are in the profile in findFunctionsWithoutProfile()
773 << " is not in profile or profile symbol list.\n"); in findFunctionsWithoutProfile()
801 << "(IR) and " << ProfFunc << "(Profile) match.\n"); in functionMatchesProfileHelper()
822 // Use the diff algorithm to find the LCS between IR and profile. in functionMatchesProfileHelper()
836 << "(IR) and " << ProfFunc << "(profile) is " in functionMatchesProfileHelper()
860 << " matches profile:" << ProfFunc << "\n"); in functionMatchesProfile()
917 // profile with the function name will be set to the same pointer.