From 32c9d5ef4fb171ad24dce91cdaa67683ccca2d78 Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Tue, 21 May 2024 13:55:32 -0700 Subject: [PATCH] Revert "[BOLT] Add NamedRegionTimer to inferStaleProfile (#92621)" This reverts commit 9f2313829fd210f9923375e93bc11fe9685c26d5. Creates a dependency cycle: lib/Rewrite depends on lib/Profile. --- bolt/lib/Profile/StaleProfileMatching.cpp | 6 ------ bolt/lib/Rewrite/RewriteInstance.cpp | 7 ++++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/bolt/lib/Profile/StaleProfileMatching.cpp b/bolt/lib/Profile/StaleProfileMatching.cpp index 712d9a121b5e..016962ff34d8 100644 --- a/bolt/lib/Profile/StaleProfileMatching.cpp +++ b/bolt/lib/Profile/StaleProfileMatching.cpp @@ -30,7 +30,6 @@ #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" @@ -43,7 +42,6 @@ using namespace llvm; namespace opts { -extern cl::opt TimeRewrite; extern cl::OptionCategory BoltOptCategory; cl::opt @@ -707,10 +705,6 @@ void assignProfile(BinaryFunction &BF, bool YAMLProfileReader::inferStaleProfile( BinaryFunction &BF, const yaml::bolt::BinaryFunctionProfile &YamlBF) { - - NamedRegionTimer T("inferStaleProfile", "stale profile inference", "rewrite", - "Rewrite passes", opts::TimeRewrite); - if (!BF.hasCFG()) return false; diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 2559c9bd4800..6e1021a6df22 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -235,9 +235,10 @@ UseGnuStack("use-gnu-stack", cl::ZeroOrMore, cl::cat(BoltCategory)); -cl::opt TimeRewrite("time-rewrite", - cl::desc("print time spent in rewriting passes"), - cl::Hidden, cl::cat(BoltCategory)); +static cl::opt + TimeRewrite("time-rewrite", + cl::desc("print time spent in rewriting passes"), cl::Hidden, + cl::cat(BoltCategory)); static cl::opt SequentialDisassembly("sequential-disassembly",