[PATCH] D32971: [scudo] CRC32 optimizations

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 13:34:07 PDT 2017


alekseyshl added inline comments.


================
Comment at: lib/scudo/scudo_crc32.cpp:23
 }
 #endif  // defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
 
----------------
cryptoad wrote:
> alekseyshl wrote:
> > Please remind me, does it mean that computeHardwareCRC32 != 0 only when defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)? Or is it expected to come from other libraries too?
> computeHardwareCRC32 != 0 if `defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)`, but it could also be defined by an external library, even though this is **not** the expectation. With full RELRO (`-Wl,-z,relro,-z,now`), if not defined at load, it can't be defined later.
I see. I'm asking because in the current version of the code the same condition switches the top level code to CRC32_INTRINSIC, completely ignoring this function. I was curious if it is even necessary now.

It just does not add up. Even for the possible future other uses of computeCRC32, for the performance reasons we have to ifdef to INTRINSIC calls at the call site, which renders computeHardwareCRC32 useless, right?


https://reviews.llvm.org/D32971





More information about the llvm-commits mailing list