forked from OSchip/llvm-project
[RegisterBankInfo] Add statistics for dynamic value mappings.
Like partial mappings, as we move toward TableGen'ed information, the number should reach zero eventually. llvm-svn: 282325
This commit is contained in:
parent
fd8c95adf4
commit
a50813f608
|
@ -37,6 +37,10 @@ STATISTIC(NumPartialMappingsCreated,
|
|||
"Number of partial mappings dynamically created");
|
||||
STATISTIC(NumPartialMappingsAccessed,
|
||||
"Number of partial mappings dynamically accessed");
|
||||
STATISTIC(NumValueMappingsCreated,
|
||||
"Number of value mappings dynamically created");
|
||||
STATISTIC(NumValueMappingsAccessed,
|
||||
"Number of value mappings dynamically accessed");
|
||||
|
||||
const unsigned RegisterBankInfo::DefaultMappingID = UINT_MAX;
|
||||
const unsigned RegisterBankInfo::InvalidMappingID = UINT_MAX - 1;
|
||||
|
@ -364,10 +368,14 @@ RegisterBankInfo::getValueMapping(const PartialMapping *BreakDown,
|
|||
Hash = hash_combine_range(Hashes.begin(), Hashes.end());
|
||||
}
|
||||
|
||||
++NumValueMappingsAccessed;
|
||||
|
||||
const auto &It = MapOfValueMappings.find(Hash);
|
||||
if (It != MapOfValueMappings.end())
|
||||
return *It->second;
|
||||
|
||||
++NumValueMappingsCreated;
|
||||
|
||||
ValueMapping *&ValMapping = MapOfValueMappings[Hash];
|
||||
ValMapping = new ValueMapping{BreakDown, NumBreakDowns};
|
||||
return *ValMapping;
|
||||
|
|
Loading…
Reference in New Issue