summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-04-16 16:03:27 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-04-16 16:03:27 +0000
commit98461062a9b329e6d46e5016fd13e4e65edf8c84 (patch)
tree45b88d775b311239e9698932e5caa369e0bf23c2 /lib/CodeGen/CodeGenAction.cpp
parent6eeb8eb072504da7149331c6d666a4a2462567c9 (diff)
downloadclang-98461062a9b329e6d46e5016fd13e4e65edf8c84.tar.gz
clang-98461062a9b329e6d46e5016fd13e4e65edf8c84.tar.bz2
clang-98461062a9b329e6d46e5016fd13e4e65edf8c84.tar.xz
InstrProf: Calculate a better function hash
The function hash should change when control flow changes. This patch hashes the type of each AST node that affects counters, rather than just counting how many there are. These types are combined into a small enumerator that currently has 16 values. The new hash algorithm packs the enums for consecutively visited types into a `uint64_t`. In order to save space for new types, the types are assumed to be 6-bit values (instead of 4-bit). In order to minimize overhead for functions with little control flow, the `uint64_t` is used directly as a hash if it never fills up; if it does, it's passed through an MD5 context. <rdar://problem/16435801> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenAction.cpp')
0 files changed, 0 insertions, 0 deletions