[llvm-commits] [llvm] r48680 - in /llvm/trunk: lib/Transforms/Scalar/GVN.cpp test/Transforms/GVN/form-memset.ll

Dale Johannesen dalej at apple.com
Mon Mar 24 14:12:54 PDT 2008


It's even more common, and occurs several times in Spec, for people to  
write out memset or memcpy as a loop in the source...

On Mar 24, 2008, at 2:08 PM, Chris Lattner wrote:
> On Mar 22, 2008, at 9:06 PM, Evan Cheng wrote:
>
>> The idea is the turn consecutive loads and stores to memcpy and
>> memset. Codegen is responsible for turning them back into loads and
>> stores when appropriate.
>
> To be concrete, we've seen user code that looks like:
>
> char array[8];
> ...
> array[0] = -1; // why are they doing this manually!!!
> array[1] = -1;
> array[2] = -1;
> array[3] = -1;
> array[4] = -1;
> array[5] = -1;
> array[6] = -1;
> array[7] = -1;
>
> Without the memset hack, we emit 8 1-byte stores.  With the hack we
> emit a single 8-byte store on 64-bit systems or 2 32-bit stores on 32-
> bit systems.  This is smaller and faster in many cases.  The problem
> is that it horks the optimizer in some cases (because it isn't
> aggressive enough with memset) which is why evan disabled my stuff for
> now.
>
> -Chris
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list