diff --git a/bolt/lib/Profile/YAMLProfileReader.cpp b/bolt/lib/Profile/YAMLProfileReader.cpp index f0f87f9baec38..29388380ca216 100644 --- a/bolt/lib/Profile/YAMLProfileReader.cpp +++ b/bolt/lib/Profile/YAMLProfileReader.cpp @@ -448,7 +448,8 @@ size_t YAMLProfileReader::matchWithExactName() { // the profile. Function.setExecutionCount(BinaryFunction::COUNT_NO_PROFILE); - if (profileMatches(YamlBF, Function)) { + // Allow mismatching profile when stale matching is enabled. + if (profileMatches(YamlBF, Function) || opts::InferStaleProfile) { matchProfileToFunction(YamlBF, Function); ++MatchedWithExactName; }