[llvm-commits] [llvm] r42433 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h test/CodeGen/X86/memcpy.ll

Rafael Espindola espindola at google.com
Fri Sep 28 10:47:47 PDT 2007


> I think this behavior makes sense.  If the size is variable, it could
> be arbitrarily large.  We should assume that memcpy (the library
> implementation) is tuned as best as possible for handling the unknown
> size case.

Yes, we know that libc memcpy is better for big values and that inline
is better for small values. When the value is not know at compile
time, we can only guess.

If we guess that it will be small, we get it wrong for any size bigger
then an small arch specific limit (128 for x86-64 I think). If we
guess that it will be large, we add it small overhead for small
values, but a big saving for big ones.

This might be a good case for profiling based optimization .....

> -Chris

Cheers,
-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047



More information about the llvm-commits mailing list