>>> In general memcpy handling is highly target specific. I'd be wary
>>> of doing too
>>> much in target-independent code, although I think the general idea
>>> here is OK.
>>
>> I'm expecting target specific code generator to handle this if it
>> is handling unaligned memcpy.
>> No ?
>
> Might
On Oct 11, 2007, at 10:46 AM, Dale Johannesen wrote:
> You aren't checking alignment when choosing the new pointer type.
> Are you sure this works on machines that don't have misaligned load/
> store?
The codegen should handle unaligned loads. Devang is setting the
alignment of the load corre
On Oct 11, 2007, at 3:26 PM, Dan Gohman wrote:
> Oops, looking at this a little more, isn't the Size operand always in
> straight bytes, and MTy always i8, just because of how llvm.memcpy is
> declared?
yes. nice catch!
> Also, this code can be used for memmove as well as memcpy; since the
>
On Oct 11, 2007, at 3:08 PM, Dan Gohman wrote:
>> + ConstantInt *MemOpLength =
>> dyn_cast(CI.getOperand(3));
>> + if (isa(MI))
>> +if (MemOpLength) {
>
> Can you replace these two if statements with
>
> if (isa(MI) && MemOpLength) {
>
> ?
>
> Then the indentation of what
On Thu, Oct 11, 2007 at 05:08:55PM -0500, Dan Gohman wrote:
> > +unsigned Size = MemOpLength->getZExtValue();
> > +unsigned Align =
> > cast(CI.getOperand(4))->getZExtValue();
> > +const PointerType *PTy =
> > cast(CI.getOperand(1)->getType());
> > +const Type *MTy
> + // If MemCpyInst length is 1/2/4/8 bytes then replace memcpy with
> load/store
Neat!
> + ConstantInt *MemOpLength = dyn_cast(CI.getOperand(3));
> + if (isa(MI))
> +if (MemOpLength) {
Can you replace these two if statements with
if (isa(MI) && MemOpLength) {
?
On Oct 11, 2007, at 10:54 AM, Devang Patel wrote:
>
> On Oct 11, 2007, at 10:46 AM, Dale Johannesen wrote:
>
>> You aren't checking alignment when choosing the new pointer type.
>> Are you sure this works on machines that don't have misaligned
>> load/store?
>>
>> In general memcpy handling is
On Oct 11, 2007, at 10:46 AM, Dale Johannesen wrote:
> You aren't checking alignment when choosing the new pointer type.
> Are you sure this works on machines that don't have misaligned load/
> store?
>
> In general memcpy handling is highly target specific. I'd be wary
> of doing too
> much
You aren't checking alignment when choosing the new pointer type.
Are you sure this works on machines that don't have misaligned load/
store?
In general memcpy handling is highly target specific. I'd be wary of
doing too
much in target-independent code, although I think the general idea
here
Author: dpatel
Date: Thu Oct 11 12:21:57 2007
New Revision: 42864
URL: http://llvm.org/viewvc/llvm-project?rev=42864&view=rev
Log:
Lower memcpy if it makes sense.
Added:
llvm/trunk/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/Instruc
10 matches
Mail list logo