diff --git a/bolt/lib/Rewrite/BoltDiff.cpp b/bolt/lib/Rewrite/BoltDiff.cpp --- a/bolt/lib/Rewrite/BoltDiff.cpp +++ b/bolt/lib/Rewrite/BoltDiff.cpp @@ -83,6 +83,11 @@ "collection time and sampling rate for this to make sense"), cl::cat(BoltDiffCategory)); +static cl::opt SkipNonSimple( + "skip-non-simple", + cl::desc("skip non-simple functions in reporting"), + cl::cat(BoltDiffCategory)); + } // end namespace opts namespace llvm { @@ -537,6 +542,8 @@ Score2 = LTOAggregatedScore2[Iter2->second]; if (Score1 == 0.0 || Score2 == 0.0) continue; + if (opts::SkipNonSimple && !Func1->isSimple() && !Func2->isSimple()) + continue; LargestDiffs.insert( std::make_pair<>(std::abs(Score1 - Score2), MapEntry)); ScoreMap[Func2] = std::make_pair<>(Score1, Score2);