From: Matthias Braun Date: Thu, 10 Nov 2016 23:36:44 +0000 (+0000) Subject: Timer: Remove group-less NamedRegionTimer constructor. X-Git-Tag: android-x86-7.1-r4~24688 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a46113773fdd10301ecbd76e7b250d586f94c92c;p=android-x86%2Fexternal-llvm.git Timer: Remove group-less NamedRegionTimer constructor. The NamedRegionTimer initializer without a group name puts the Timer into the "Misc" group and is (nearly) unused. Remove it. The only user of this constructor appears to be the HexagonGenInsert pass, which creates a counter without group to count the complete execution time of that pass, however since every pass gets a counter by the PassManager anyway this should be unnecessary. Also removed the pointless TimerGroup there. Differential Revision: https://reviews.llvm.org/D25582 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286524 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/Timer.h b/include/llvm/Support/Timer.h index a0051b57386..dbe20335e50 100644 --- a/include/llvm/Support/Timer.h +++ b/include/llvm/Support/Timer.h @@ -152,8 +152,6 @@ public: /// statement. All timers with the same name are merged. This is primarily /// used for debugging and for hunting performance problems. struct NamedRegionTimer : public TimeRegion { - explicit NamedRegionTimer(StringRef Name, - bool Enabled = true); explicit NamedRegionTimer(StringRef Name, StringRef GroupName, bool Enabled = true); }; diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp index afb16ca9e0c..548f9da42ee 100644 --- a/lib/Support/Timer.cpp +++ b/lib/Support/Timer.cpp @@ -210,22 +210,8 @@ public: } -static ManagedStatic NamedTimers; static ManagedStatic NamedGroupedTimers; -static Timer &getNamedRegionTimer(StringRef Name) { - sys::SmartScopedLock L(*TimerLock); - - Timer &T = (*NamedTimers)[Name]; - if (!T.isInitialized()) - T.init(Name); - return T; -} - -NamedRegionTimer::NamedRegionTimer(StringRef Name, - bool Enabled) - : TimeRegion(!Enabled ? nullptr : &getNamedRegionTimer(Name)) {} - NamedRegionTimer::NamedRegionTimer(StringRef Name, StringRef GroupName, bool Enabled) : TimeRegion(!Enabled ? nullptr : &NamedGroupedTimers->get(Name, GroupName)){} diff --git a/lib/Target/Hexagon/HexagonGenInsert.cpp b/lib/Target/Hexagon/HexagonGenInsert.cpp index c4adf519391..54df36a0ab6 100644 --- a/lib/Target/Hexagon/HexagonGenInsert.cpp +++ b/lib/Target/Hexagon/HexagonGenInsert.cpp @@ -1474,8 +1474,6 @@ bool HexagonGenInsert::runOnMachineFunction(MachineFunction &MF) { bool Timing = OptTiming, TimingDetail = Timing && OptTimingDetail; bool Changed = false; - TimerGroup __G("hexinsert"); - NamedRegionTimer __T("hexinsert", Timing && !TimingDetail); // Sanity check: one, but not both. assert(!OptSelectAll0 || !OptSelectHas0);