4 ms·
I'm pretty sure many compilers can replace naive implementations of memcpy with one of the compiler's built-in optimized versions.
by rrss 7y ago
I'm pretty sure many compilers can replace naive implementations of memcpy with one of the compiler's built-in optimized versions.
- vnorilo 7y agoYes; in fact memcpy/move are intrinsics in LLVM IR and are one of the more common targets of its idiom recognizer. Fun fact: many loop replacements and vectorizations depend on signed induction variable, so that the compiler doesn't have to prove it doesn't overflow. (Unsigned overflow is defined, signed overflow is UB and thus can be ignored)
- account42 7y agoIf only you could specify overflow behavior and value range separately.