aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/Error.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-06-14 22:49:57 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-06-27 10:44:59 +0200
commit9a334a4d204127a6941071694bd7c67d6ab31acb (patch)
treea0ec9a0066e860fac702349494655a2f564035f2 /llvm/lib/Object/Error.cpp
parentba2ac689e606f1011d9a5b260c31a399316514df (diff)
downloadllvm-9a334a4d204127a6941071694bd7c67d6ab31acb.zip
llvm-9a334a4d204127a6941071694bd7c67d6ab31acb.tar.gz
llvm-9a334a4d204127a6941071694bd7c67d6ab31acb.tar.bz2
[IR] Store attributes that are available "somewhere" (NFC)
I noticed that for some benchmarks we spend quite a bit of time inside AttributeList::hasAttrSomewhere(), mainly when checking for the "returned" attribute. Most of the time the attribute will not be present, in which case this function has to walk through the whole attribute list and check for the attribute at each index. This patch adds a cache of all "available somewhere" attributes inside AttributeListImpl. This makes the structure 12 bytes larger, but I don't think that's problematic, as attribute lists are uniqued. Compile-time in terms of instructions retired improves by 0.4% on average, but >1% for sqlite. Differential Revision: https://reviews.llvm.org/D81867
Diffstat (limited to 'llvm/lib/Object/Error.cpp')
0 files changed, 0 insertions, 0 deletions