[llvm-commits] [llvm] r43270 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/CodeGen/PowerPC/2007-10-23-UnalignedMemcpy.ll

Chris Lattner clattner at apple.com
Tue Oct 23 17:47:17 PDT 2007


On Oct 23, 2007, at 5:11 PM, Bill Wendling wrote:

> On 10/23/07, Chris Lattner <clattner at apple.com> wrote:
>>> URL: http://llvm.org/viewvc/llvm-project?rev=43270&view=rev
>>> Log:
>>> If there's an unaligned memcpy to/from the stack, don't lower it.
>>> Just call the
>>> memcpy library function instead.
>>
>> Hey Bill,
>>
>> There is nothing specific about the stack here, please just make it
>> depend on whether the alignment of the src/dest pointers are  
>> sufficient.
>>
> Are you certain? When Evan and I looked at it, it seemed like it was
> mostly having problems with the stack pointer and alignment. If it
> wasn't aligned for PPC, then it would barf.

In this testcase yes.

> I'm that's not the case, then this would be the patch, right?
>
>           if (Size % Align != 0)
>             break;

I haven't looked at the code, but the size of the memcpy has nothing  
to do with it.  This is strictly a problem because memcpy lowering is  
making 8-byte stores to a pointer that is not 8-byte aligned.  This  
is independent of the size that is ultimately copied.  Evan, thoughts?

-Chris



More information about the llvm-commits mailing list