[llvm] [BOLT] Add NamedRegionTimer to inferStaleProfile (PR #92621)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 09:50:10 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-bolt

Author: shaw young (shawbyoung)

<details>
<summary>Changes</summary>

Add a NamedRegionTimer to measure the time spent in inferStaleProfile.


---
Full diff: https://github.com/llvm/llvm-project/pull/92621.diff


1 Files Affected:

- (modified) bolt/lib/Profile/StaleProfileMatching.cpp (+5) 


``````````diff
diff --git a/bolt/lib/Profile/StaleProfileMatching.cpp b/bolt/lib/Profile/StaleProfileMatching.cpp
index 016962ff34d8d..33182d83449a2 100644
--- a/bolt/lib/Profile/StaleProfileMatching.cpp
+++ b/bolt/lib/Profile/StaleProfileMatching.cpp
@@ -30,6 +30,7 @@
 #include "llvm/ADT/Bitfields.h"
 #include "llvm/ADT/Hashing.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Timer.h"
 #include "llvm/Support/xxhash.h"
 #include "llvm/Transforms/Utils/SampleProfileInference.h"
 
@@ -705,6 +706,10 @@ void assignProfile(BinaryFunction &BF,
 
 bool YAMLProfileReader::inferStaleProfile(
     BinaryFunction &BF, const yaml::bolt::BinaryFunctionProfile &YamlBF) {
+
+  NamedRegionTimer T("inferStaleProfile", "inferring from stale profile",
+                     "rewrite", "Rewrite passes", opts::InferStaleProfile);
+
   if (!BF.hasCFG())
     return false;
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/92621


More information about the llvm-commits mailing list