This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Disable loop2_invariant for -Os
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Zhenqiang Chen <zhenqiang dot chen at arm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 27 Jun 2012 10:54:18 +0200
- Subject: Re: [PATCH] Disable loop2_invariant for -Os
- References: <4feac6fa.e288440a.73b3.ffffa5c7SMTPIN_ADDED@mx.google.com>
On Wed, Jun 27, 2012 at 10:40 AM, Zhenqiang Chen <zhenqiang.chen@arm.com> wrote:
> Hi,
>
> In general, invariant motion itself can not reduce code size. But it will
> change the liverange of the invariant, which might lead to more spilling.
This may be true for ARM but it's not true in general. Sometimes
loop-invariant address arithmetic, that is not exposed in GIMPLE, is
profitable to hoist out of the loop. See e.g. PR41026 (for which I
still have a patch in the queue).
If this goes in anyway, please mention PR39837 in your ChangeLog entry.
Ciao!
Steven