diff options
| author | Kostya Kortchinsky <kostyak@google.com> | 2017-01-10 16:39:36 +0000 |
|---|---|---|
| committer | Kostya Kortchinsky <kostyak@google.com> | 2017-01-10 16:39:36 +0000 |
| commit | c4d6c938e3519c1ac348dfbea9cbf3deb3e8a4a1 (patch) | |
| tree | 1a36442e79912fa919c4cdce268f1d4394fad07e /compiler-rt/lib/scudo/scudo_utils.h | |
| parent | e999ddb8de59e261ffd16ea27e65126feb26c6a0 (diff) | |
| download | bcm5719-llvm-c4d6c938e3519c1ac348dfbea9cbf3deb3e8a4a1.tar.gz bcm5719-llvm-c4d6c938e3519c1ac348dfbea9cbf3deb3e8a4a1.zip | |
[scudo] Separate hardware CRC32 routines
Summary:
As raised in D28304, enabling SSE 4.2 for the whole Scudo tree leads to the
emission of SSE 4.2 instructions everywhere, while the runtime checks only
applied to the CRC32 computing function.
This patch separates the CRC32 function taking advantage of the hardware into
its own file, and only enabled -msse4.2 for that file, if detected to be
supported by the compiler.
Another consequence of removing SSE4.2 globally is realizing that memcpy were
not being optimized, which turned out to be due to the -fno-builtin in
SANITIZER_COMMON_CFLAGS. So we now explicitely enable builtins for Scudo.
The resulting assembly looks good, with some CALLs are introduced instead of
the CRC32 code being inlined.
Reviewers: kcc, mgorny, alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28417
llvm-svn: 291570
Diffstat (limited to 'compiler-rt/lib/scudo/scudo_utils.h')
| -rw-r--r-- | compiler-rt/lib/scudo/scudo_utils.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler-rt/lib/scudo/scudo_utils.h b/compiler-rt/lib/scudo/scudo_utils.h index f93f26ef122..ef2a609671a 100644 --- a/compiler-rt/lib/scudo/scudo_utils.h +++ b/compiler-rt/lib/scudo/scudo_utils.h @@ -53,8 +53,8 @@ struct Xorshift128Plus { u64 State[2]; }; -// Software CRC32 functions, to be used when SSE 4.2 support is not detected. -u32 computeCRC32(u32 Crc, uptr Data); +// Software CRC32 functions, to be used when hardware support is not detected. +u32 computeSoftwareCRC32(u32 Crc, uptr Data); } // namespace __scudo |

