>>
>> 1) If -fira_loop_pressure is enabled, it reduces ~24% invariant motions in my
>tests. But it does not help on total code size. Seams there is issue to update
>the
>"regs_needed" after moving an invariant out of the loop (My benchmark logs
>show ~73% cases have more than one invariants moved)
On Tue, Jul 3, 2012 at 10:29 AM, Zhenqiang Chen wrote:
>>-Original Message-
>>From: Richard Guenther [mailto:richard.guent...@gmail.com]
>>Sent: 2012年6月28日 17:24
>>To: Zhenqiang Chen
>>Cc: gcc-patches@gcc.gnu.org
>>Subject: Re: [PATCH] Disable loop2_i
>-Original Message-
>From: Richard Guenther [mailto:richard.guent...@gmail.com]
>Sent: 2012年6月28日 17:24
>To: Zhenqiang Chen
>Cc: gcc-patches@gcc.gnu.org
>Subject: Re: [PATCH] Disable loop2_invariant for -Os
>
>On Thu, Jun 28, 2012 at 10:33 AM, Zhenqiang Chen
>w
On Thu, Jun 28, 2012 at 10:33 AM, Zhenqiang Chen wrote:
>>> diff --git a/gcc/loop-init.c b/gcc/loop-init.c index 03f8f61..5d8cf73
>>> 100644
>>> --- a/gcc/loop-init.c
>>> +++ b/gcc/loop-init.c
>>> @@ -273,6 +273,12 @@ struct rtl_opt_pass pass_rtl_loop_done =
>>> static bool
>>> gate_rtl_move_loo
>-Original Message-
>From: Steven Bosscher [mailto:stevenb@gmail.com]
>Sent: 2012年6月27日 16:54
>To: Zhenqiang Chen
>Cc: gcc-patches@gcc.gnu.org
>Subject: Re: [PATCH] Disable loop2_invariant for -Os
>
>On Wed, Jun 27, 2012 at 10:40 AM, Zhenqiang Chen
> wro
>> diff --git a/gcc/loop-init.c b/gcc/loop-init.c index 03f8f61..5d8cf73
>> 100644
>> --- a/gcc/loop-init.c
>> +++ b/gcc/loop-init.c
>> @@ -273,6 +273,12 @@ struct rtl_opt_pass pass_rtl_loop_done =
>> static bool
>> gate_rtl_move_loop_invariants (void)
>> {
>> + /* In general, invariant motion
On Wed, Jun 27, 2012 at 10:40 AM, Zhenqiang Chen 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 a
On Wed, Jun 27, 2012 at 10:40 AM, Zhenqiang Chen wrote:
> Hi,
>
> In general, invariant motion itself can not reduce code size.
It can expose CSE opportunities across loops though.
> But it will
> change the liverange of the invariant, which might lead to more spilling.
"might" - indeed. I won
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.
The patch disables loop2_invariant when optimizing for size.
I measured the code size benefit for four targets based on CSiBE benchmark:
ARM: 0.