diff options
author | Ivan Krasin <krasin@chromium.org> | 2016-12-01 02:54:54 +0000 |
---|---|---|
committer | Ivan Krasin <krasin@chromium.org> | 2016-12-01 02:54:54 +0000 |
commit | 3dade419bff12f1c67fd5d4256a5e7f2338f1160 (patch) | |
tree | feb518f639418621ba7432b3f619abdacff605cb /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | fb8c2a4a6b9fb72430903677fc1ffc46e27160f4 (diff) | |
download | bcm5719-llvm-3dade419bff12f1c67fd5d4256a5e7f2338f1160.tar.gz bcm5719-llvm-3dade419bff12f1c67fd5d4256a5e7f2338f1160.zip |
Use trigrams to speed up SpecialCaseList.
Summary:
it's often the case when the rules in the SpecialCaseList
are of the form hel.o*bar. That gives us a chance to build
trigram index to quickly discard 99% of inputs without
running a full regex. A similar idea was used in Google Code Search
as described in the blog post:
https://swtch.com/~rsc/regexp/regexp4.html
The check is defeated, if there's at least one regex
more complicated than that. In this case, all inputs
will go through the regex. That said, the real-world
rules are often simple or can be simplied. That considerably
speeds up compiling Chromium with CFI and UBSan.
As measured on Chromium's content_message_generator.cc:
before, CFI: 44 s
after, CFI: 23 s
after, CFI, no blacklist: 23 s (~1% slower, but 3 runs were unable to show the difference)
after, regular compilation to bitcode: 23 s
Reviewers: pcc
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D27188
llvm-svn: 288303
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions