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

llvm-svn: 286524
This commit is contained in:
Matthias Braun 2016-11-10 23:36:44 +00:00
parent 7a30a0c01d
commit 89e66b63d4
3 changed files with 0 additions and 18 deletions

View File

@ -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);
};

View File

@ -210,22 +210,8 @@ public:
}
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)){}

View File

@ -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);