[llvm-commits] [llvm-gcc-4.2] r72804 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Dale Johannesen dalej at apple.com
Thu Jun 4 11:23:18 PDT 2009


On Jun 4, 2009, at 11:14 AMPDT, Bill Wendling wrote:

> On Thu, Jun 4, 2009 at 12:37 AM, Duncan Sands <baldrick at free.fr>  
> wrote:
>> Hi Bill,
>>
>>>> I would have expected LLVM to give strings an alignment of 1.  Is  
>>>> that
>>>> not so?
>>>>
>>> No. At this point, before my patch, the alignment wasn't being set.
>>> During code generation, it defaults (through a series of calls) to a
>>> "preferred alignment" of 16 bytes.
>>
>> maybe that's a bug?  16 byte alignment seems an awful lot for a  
>> string.
>>
> I agree. But the back end has no concept of what's a string and what's
> an array of i8s. I think that my patch should fix this...

I don't know the history, but there are reasons you might want strings  
to have high alignment.  They cross fewer cache lines, and you can  
copy them with XMM (or Altivec) loads and stores.




More information about the llvm-commits mailing list