[llvm] r282325 - [RegisterBankInfo] Add statistics for dynamic value mappings.
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 23 21:53:55 PDT 2016
Author: qcolombet
Date: Fri Sep 23 23:53:55 2016
New Revision: 282325
URL: http://llvm.org/viewvc/llvm-project?rev=282325&view=rev
Log:
[RegisterBankInfo] Add statistics for dynamic value mappings.
Like partial mappings, as we move toward TableGen'ed information, the
number should reach zero eventually.
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
Modified: llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp?rev=282325&r1=282324&r2=282325&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp Fri Sep 23 23:53:55 2016
@@ -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
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;
More information about the llvm-commits
mailing list