[MSAN RT] Use __sanitizer::mem_is_zero in __msan_test_shadow
authorGui Andrade <guiand@google.com>
Mon, 10 Aug 2020 19:03:40 +0000 (19:03 +0000)
committerGui Andrade <guiand@google.com>
Mon, 10 Aug 2020 19:22:27 +0000 (19:22 +0000)
commitc0b5000bd848303320c03f80fbf84d71e74518c9
treee68d24497dc47c75ef0cffdac307ae98cd69ef18
parentab6a517ea41e1cb63856cce6f7fa4a196ffca368
[MSAN RT] Use __sanitizer::mem_is_zero in __msan_test_shadow

The former function is particularly optimized for exactly the
use case we're interested in: an all-zero buffer.

This reduces the overhead of calling this function some 80% or
more. This is particularly for instrumenting code heavy with
string processing functions, like grep. An invocation of grep
with the pattern '[aeiou]k[aeiou]' has its runtime reduced by
~75% with this patch

Differential Revision: https://reviews.llvm.org/D84961
compiler-rt/lib/msan/msan.cpp