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

Bill Wendling isanbard at gmail.com
Wed Oct 24 17:34:46 PDT 2007


On 10/24/07, Chris Lattner <clattner at apple.com> wrote:
> >> Here's what it's doing in PPCRegisterInfo::eliminateFrameIndex().
> >>
> >> (gdb) call MF.dump()
> >> # Machine code for Bork():
> >>    <fi #0>: size is 33 bytes, alignment is 1 byte, at location
> >> [SP-33]
> >
> > Ok, then the problem is just this stack object is misaligned? I
> > thought the source specified this alloca should be 4-byte aligned?
>
> I discussed this with Bill today.  The problem is that we have:
>
> llvm.memcpy(p, q, 8, 1/*alignment)
>
> this gets turned into an 8-byte load and an 8-byte store, but the
> alignment (of 1) from the memcpy isn't put onto the load or store, so
> the legalizer thinks they are properly aligned.
>
Hold on. Here's what we have in the bitcode:

   call void @llvm.memcpy.i64(p, q, 33, 8)

So the alignment is 8 here. But from the function above, the frame's
alignment is 1...

-bw



More information about the llvm-commits mailing list