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

Peter Collingbourne peter at pcc.me.uk
Tue Apr 16 14:13:58 PDT 2013


On Tue, Apr 02, 2013 at 02:44:32PM -0700, Peter Collingbourne wrote:
> 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?

Ping.

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/20130416/57fb37d9/attachment.patch>


More information about the llvm-commits mailing list