[dragonegg PATCH] Use the preferred alignment when deciding whether to use an explicit alignment

Peter Collingbourne peter at pcc.me.uk
Tue Apr 2 14:44:32 PDT 2013


On Tue, Apr 02, 2013 at 11:23:09PM +0200, Duncan Sands wrote:
> Hi Peter,
>
>> Use the preferred alignment when deciding whether to use an explicit
>> alignment.
>>
>> OK to commit?
>
> I don't like it.  An alignment of 0 for a global variable guarantess it gets
> at least the ABI alignment, but maybe no more.  The optimizers may increase it
> in cases where that seems safe and profitable to them, usually to the preferred
> alignment, but they may not always do so.  In such cases (where the global only
> gets the ABI alignment) your patch would decrease the alignment from what the
> user requested (the preferred alignment) to the ABI alignment, which would be
> wrong.

That makes sense.  What about this, where we always use an explicit
alignment if DECL_USER_ALIGN holds?

Thanks,
-- 
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Always-use-an-explicit-alignment-if-the-alignment-wa.patch
Type: text/x-diff
Size: 1620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130402/348edbeb/attachment.patch>


More information about the llvm-commits mailing list