Page MenuHomePhabricator

[libc] Allow customization of memcpy via flags.

Authored by gchatelet on Thu, Jan 14, 7:53 AM.


  • Adds LLVM_LIBC_IS_DEFINED macro to libc/src/__support/common.h
  • Adds a few knobs to memcpy to help with experimentations:
    • LLVM_LIBC_MEMCPY_X86_USE_ONLY_REPMOVSB replaces the implementation with a single call to rep;movsb
    • LLVM_LIBC_MEMCPY_X86_USE_REPMOVSB_FROM_SIZE customizes where the usage of rep;movsb

Diff Detail

Event Timeline

gchatelet created this revision.Thu, Jan 14, 7:53 AM
gchatelet requested review of this revision.Thu, Jan 14, 7:53 AM
sivachandra accepted this revision.Thu, Jan 14, 9:10 AM

Few inline nits.


In other places, we have named such namespaces as internal.


Just pointing out, we cannot use the C++ standard library. So, this comment should either be removed or updated suitably.


Can we use the early return pattern for this as well without the else?

if (kUseOnlyRepMovSb)
  return CopyRepMovsb(...);
This revision is now accepted and ready to land.Thu, Jan 14, 9:10 AM

There is -nostdinc++.

gchatelet updated this revision to Diff 316869.Fri, Jan 15, 1:24 AM
gchatelet marked 3 inline comments as done.
  • Address comments
This revision was landed with ongoing or failed builds.Fri, Jan 15, 1:27 AM
This revision was automatically updated to reflect the committed changes.