[PATCH] D151510: [BOLT] Add skip-non-simple for boltdiff

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 15:37:42 PDT 2023


Amir created this revision.
Amir added a reviewer: bolt.
Herald added a reviewer: rafauler.
Herald added subscribers: treapster, ayermolo.
Herald added a reviewer: maksfb.
Herald added a project: All.
Amir requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.

Extra filtering for boltdiff, excluding non-simple functions from comparison.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151510

Files:
  bolt/lib/Rewrite/BoltDiff.cpp


Index: bolt/lib/Rewrite/BoltDiff.cpp
===================================================================
--- bolt/lib/Rewrite/BoltDiff.cpp
+++ 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<bool> 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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151510.525843.patch
Type: text/x-patch
Size: 885 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230525/1ffe6f95/attachment.bin>


More information about the llvm-commits mailing list