efriedma added a comment.

I would be careful about trying to over-generalize here.  There are a few 
different related bits of functionality which seem to be interesting, given the 
discussion in the llvm-dev thread, here, and in related patches:
1. The ability to specify -fno-builtin* on a per-function level, using function 
attributes.
2. Improved optimization when -fno-builtin-memcpy is specified.
3. The ability to avoid calls to memcpy for certain C constructs which would 
naturally be lowered to a memcpy call, like struct assignment of large structs, 
or explicit calls to __builtin_memcpy().  Maybe also some generalization of 
this involving other libc/libm/compiler-rt calls.
4. The ability to force the compiler to generate "rep; movs" on x86 without 
inline asm.

It's not clear to me that all of this should be tied together.  In particular, 
I'm not sure -fno-builtin-memcpy should imply the compiler never generates a 
call to memcpy().  On recent x86 chips, you might be able to get away with 
unconditionally using "rep movs", but generally an efficient memcpy for more 
than a few bytes is a lot longer than one instruction, and is not something 
reasonable for the compiler to synthesize inline.

If we're adding new IR attributes here, we should also consider the interaction 
with LTO.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61634/new/

https://reviews.llvm.org/D61634



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to