[PATCH] D25582: Timer: Remove group-less NamedRegionTimer constructor
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 13 16:10:00 PDT 2016
MatzeB created this revision.
MatzeB added a reviewer: kparzysz.
MatzeB added a subscriber: llvm-commits.
MatzeB set the repository for this revision to rL LLVM.
Herald added a subscriber: mcrosier.
The NamedRegionTimer initializer without a group name puts the Timer
into the "Misc" group but appears to be (mostly) 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.
(I am removing this code now because it will slightly simplify an upcoming patch of mine)
Repository:
rL LLVM
https://reviews.llvm.org/D25582
Files:
include/llvm/Support/Timer.h
lib/Support/Timer.cpp
lib/Target/Hexagon/HexagonGenInsert.cpp
Index: lib/Target/Hexagon/HexagonGenInsert.cpp
===================================================================
--- lib/Target/Hexagon/HexagonGenInsert.cpp
+++ lib/Target/Hexagon/HexagonGenInsert.cpp
@@ -1474,8 +1474,6 @@
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);
Index: lib/Support/Timer.cpp
===================================================================
--- lib/Support/Timer.cpp
+++ lib/Support/Timer.cpp
@@ -210,22 +210,8 @@
}
-static ManagedStatic<Name2TimerMap> NamedTimers;
static ManagedStatic<Name2PairMap> NamedGroupedTimers;
-static Timer &getNamedRegionTimer(StringRef Name) {
- sys::SmartScopedLock<true> 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)){}
Index: include/llvm/Support/Timer.h
===================================================================
--- include/llvm/Support/Timer.h
+++ include/llvm/Support/Timer.h
@@ -155,8 +155,6 @@
/// 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);
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25582.74593.patch
Type: text/x-patch
Size: 1899 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161013/8199f3cd/attachment.bin>
More information about the llvm-commits
mailing list