llvm/unittests/Support
Ivan Krasin c22ac1df07 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 02:54:54 +00:00
..
AlignOfTest.cpp [Support] Fix AlignOf test on i386-linux. 2016-10-21 09:15:57 +00:00
AllocatorTest.cpp Fix "the the" in comments. 2015-06-19 01:53:21 +00:00
ArrayRecyclerTest.cpp Rename the unittest from ArrayRecylerTest.cpp to ArrayRecyclerTest.cpp. 2013-01-05 02:08:43 +00:00
BlockFrequencyTest.cpp Add - and -= operators to BlockFrequency using saturating arithmetic. 2015-10-12 18:34:00 +00:00
BranchProbabilityTest.cpp BranchProbabilityTest.cpp: Suppress warnings. [-Wsign-compare] 2015-12-18 00:18:18 +00:00
Casting.cpp Removing LLVM_EXPLICIT, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:00:20 +00:00
Chrono.cpp Reapply "Add Chrono.h - std::chrono support header" 2016-10-20 12:05:50 +00:00
CMakeLists.txt Use trigrams to speed up SpecialCaseList. 2016-12-01 02:54:54 +00:00
CommandLineTest.cpp Attempt to pacify buildbot 2016-11-01 07:52:10 +00:00
CompressionTest.cpp [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
ConvertUTFTest.cpp [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
DataExtractorTest.cpp [C++11] Use 'nullptr'. 2014-06-08 22:29:17 +00:00
DwarfTest.cpp Re-commit "Use StringRef in Support/Darf APIs (NFC)" 2016-10-05 05:59:29 +00:00
EndianStreamTest.cpp Add a test showing we can write a vector of floats. 2016-01-25 19:02:20 +00:00
EndianTest.cpp Fix another UBSan test error from r248897 and follow on fix r249689 2015-10-08 20:52:23 +00:00
ErrorOrTest.cpp Use std::forward to make ErrorOr<T> constructible from a value that has a user-defined conversion to T. No functionality change intended. 2016-02-09 04:47:58 +00:00
ErrorTest.cpp Fix macro check for ABI breacking check: should use #if instead of #ifndef 2016-11-30 19:08:41 +00:00
FileOutputBufferTest.cpp Fix a real temp file leak in FileOutputBuffer 2016-09-02 01:10:53 +00:00
formatted_raw_ostream_test.cpp Sort the #include lines for unittest/... 2012-12-04 10:23:08 +00:00
FormatVariadicTest.cpp [Support] Introduce llvm::formatv() function. 2016-11-11 23:57:40 +00:00
Host.cpp Add computeHostNumPhysicalCores() implementation for Darwin 2016-10-19 22:36:07 +00:00
LEB128Test.cpp [Support] add decodeSLEB128() 2014-09-15 21:51:49 +00:00
LineIteratorTest.cpp LineIterator: Provide a variant that keeps blank lines 2014-09-17 15:43:01 +00:00
LockFileManagerTest.cpp Asserting that the call to chdir succeeds in this test. Fixes some -Wunused-result warnings. 2014-08-13 11:17:41 +00:00
ManagedStatic.cpp Re-apply r211287: Remove support for LLVM runtime multi-threading. 2014-06-27 15:13:01 +00:00
MathExtrasTest.cpp [ADT/MathExtras] Make buildbot happy again. 2016-11-11 04:03:29 +00:00
MD5Test.cpp Add convenient functions to compute hashes of byte vectors. 2016-11-23 00:46:09 +00:00
MemoryBufferTest.cpp Try to fix some temp file leaks in SupportTests, PR18335 2016-09-02 00:51:34 +00:00
MemoryTest.cpp Remove dead code. NFC. 2014-12-04 16:59:36 +00:00
NativeFormatTests.cpp [Support] Introduce llvm::formatv() function. 2016-11-11 23:57:40 +00:00
Path.cpp [Support] remove_dots: Remove windows test. 2016-10-17 13:57:16 +00:00
ProcessTest.cpp Remove dead code. NFC. 2014-12-04 16:59:36 +00:00
ProgramTest.cpp Resubmit "Update llvm command line parser to support subcommands." 2016-06-29 21:48:26 +00:00
raw_ostream_test.cpp [Support] Improve flexibility of binary blob formatter. 2016-11-10 20:16:45 +00:00
raw_pwrite_stream_test.cpp raw_pwrite_stream_test.cpp: _putenv_s() may be assumed as win32-generic. 2016-09-02 01:20:18 +00:00
raw_sha1_ostream_test.cpp Add convenient functions to compute hashes of byte vectors. 2016-11-23 00:46:09 +00:00
RegexTest.cpp [Support] - Fix possible crash in match() of llvm::Regex. 2016-09-02 08:44:46 +00:00
ReplaceFileTest.cpp Fix rename() sometimes failing if another process uses openFileForRead() 2015-10-12 15:11:47 +00:00
ScaledNumberTest.cpp Fix infinite recursion in ScaledNumber::toInt. 2015-05-01 17:59:15 +00:00
SourceMgrTest.cpp Return a std::unique_ptr when creating a new MemoryBuffer. 2014-08-27 20:03:13 +00:00
SpecialCaseListTest.cpp Use trigrams to speed up SpecialCaseList. 2016-12-01 02:54:54 +00:00
StringPool.cpp StringPool: Cleanup typos in unittest comments 2014-12-15 01:04:49 +00:00
SwapByteOrderTest.cpp Unit tests for the getSwappedBytes(double) fix from r237673. 2015-05-20 14:57:43 +00:00
TargetParserTest.cpp [AArch64] Add support for Qualcomm's Falkor CPU. 2016-11-15 21:34:12 +00:00
Threading.cpp Rename interface for querying physical hardware concurrency 2016-10-17 14:56:53 +00:00
ThreadLocalTest.cpp ThreadLocal: Return a mutable pointer if templated with a non-const type 2014-12-15 01:04:45 +00:00
ThreadPool.cpp [ThreadPool] Rollback recent changes until I figure out the breakage. 2016-11-28 09:17:12 +00:00
TimerTest.cpp Timer: Track name and description. 2016-11-18 19:43:18 +00:00
TrailingObjectsTest.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 15:02:18 +00:00
TrigramIndexTest.cpp Use trigrams to speed up SpecialCaseList. 2016-12-01 02:54:54 +00:00
TypeNameTest.cpp [Support] Add a fancy helper function to get a static name for a type. 2016-02-25 03:58:21 +00:00
UnicodeTest.cpp Move generic isPrint and columnWidth implementations to a separate header/source to allow using both generic and system-dependent versions on win32. 2013-09-04 16:00:12 +00:00
xxhashTest.cpp Add xxhash to llvm. 2016-09-27 15:45:57 +00:00
YAMLIOTest.cpp Improve error handling in YAML parsing 2016-11-28 21:38:52 +00:00
YAMLParserTest.cpp [NFC] Header cleanup 2016-04-18 09:17:29 +00:00