[LLVMdev] RFC: llvm-convert.cpp Patch
Dale Johannesen
dalej at apple.com
Wed Nov 7 08:16:07 PST 2007
On Nov 7, 2007, at 12:16 AM, Bill Wendling wrote:
> On Nov 6, 2007, at 6:07 PM, Dale Johannesen wrote:
>>
>> Not sure I'm getting it, is this Bar itself or the constructed C.0
>> that's getting realigned?
>>
> It's C.0 that's getting realigned.
OK then, it looks like other people have made the points I was going
to, but briefly:
Using DECL_USER_ALIGN is wrong; that is for user-specified
alignments, and if
you use it for something else, you'll break that.
The alignment on memcpy needs to take both the source & destination
into account.
You seem to have gotten this far. Unfortunately that bit of llvm-
convert is a maze of
recursive little passages, but your last patch seems to be thinking
along the right lines.
Would it be terrible to drop the alignment on memcpy altogether? The
source and
destination have alignments and llvm should be able to figure out
what the safe
alignment is for memcpy. This is a target-dependent decision anyway;
misaligned
loads are a good idea on some targets, not on others.
More information about the llvm-dev
mailing list