mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Add support for putting NamedRegionTimers in TimerGroups, and
use a timer group for the timers in SelectionDAGISel. Also, Split scheduling out from emitting, to give each their own timer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53476 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
+34
-2
@@ -182,19 +182,51 @@ void Timer::addPeakMemoryMeasurement() {
|
||||
// NamedRegionTimer Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static ManagedStatic<std::map<std::string, Timer> > NamedTimers;
|
||||
namespace {
|
||||
|
||||
typedef std::map<std::string, Timer> Name2Timer;
|
||||
typedef std::map<std::string, std::pair<TimerGroup, Name2Timer> > Name2Pair;
|
||||
|
||||
}
|
||||
|
||||
static ManagedStatic<Name2Timer> NamedTimers;
|
||||
|
||||
static ManagedStatic<Name2Pair> NamedGroupedTimers;
|
||||
|
||||
static Timer &getNamedRegionTimer(const std::string &Name) {
|
||||
std::map<std::string, Timer>::iterator I = NamedTimers->find(Name);
|
||||
Name2Timer::iterator I = NamedTimers->find(Name);
|
||||
if (I != NamedTimers->end())
|
||||
return I->second;
|
||||
|
||||
return NamedTimers->insert(I, std::make_pair(Name, Timer(Name)))->second;
|
||||
}
|
||||
|
||||
static Timer &getNamedRegionTimer(const std::string &Name,
|
||||
const std::string &GroupName) {
|
||||
|
||||
Name2Pair::iterator I = NamedGroupedTimers->find(GroupName);
|
||||
if (I == NamedGroupedTimers->end()) {
|
||||
TimerGroup TG(GroupName);
|
||||
std::pair<TimerGroup, Name2Timer> Pair(TG, Name2Timer());
|
||||
I = NamedGroupedTimers->insert(I, std::make_pair(GroupName, Pair));
|
||||
}
|
||||
|
||||
Name2Timer::iterator J = I->second.second.find(Name);
|
||||
if (J == I->second.second.end())
|
||||
J = I->second.second.insert(J,
|
||||
std::make_pair(Name,
|
||||
Timer(Name,
|
||||
I->second.first)));
|
||||
|
||||
return J->second;
|
||||
}
|
||||
|
||||
NamedRegionTimer::NamedRegionTimer(const std::string &Name)
|
||||
: TimeRegion(getNamedRegionTimer(Name)) {}
|
||||
|
||||
NamedRegionTimer::NamedRegionTimer(const std::string &Name,
|
||||
const std::string &GroupName)
|
||||
: TimeRegion(getNamedRegionTimer(Name, GroupName)) {}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// TimerGroup Implementation
|
||||
|
||||
Reference in New Issue
Block a user