This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/3]Improve induction variable elimination
- From: "Bin.Cheng" <amker dot cheng at gmail dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Bin Cheng <bin dot cheng at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 25 Jul 2014 15:00:31 +0100
- Subject: Re: [PATCH 1/3]Improve induction variable elimination
- Authentication-results: sourceware.org; auth=none
- References: <002a01cfa19e$8752d0d0$95f87270$ at arm dot com> <CAFiYyc2T2dPF0PPsGLCFwfAW7MBhyHzxM36H2Tvdm=HWhjsi1g at mail dot gmail dot com>
On Fri, Jul 25, 2014 at 1:27 PM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Thu, Jul 17, 2014 at 11:07 AM, Bin Cheng <bin.cheng@arm.com> wrote:
>> Hi,
>> This is a series of three patches improving induction variable elimination.
>> Currently GCC only eliminates iv for very specific case when the loop's
>> latch could run zero times, i.e., when may_be_zero field of loop niter
>> information evaluates to true. In fact, it's so specific that
>> iv_elimination_compare_lt rarely succeeds during either GCC bootstrap or
>> spec2000/spec2006 compilation. Though intrusive data shows these patches
>> don't help iv elimination that much for GCC bootstrap, they do capture
>> 5%~15% more eliminations for compiling spec2000/2006. Detailed numbers are
>> like:
>> 2k/int 2k/fp 2k6/int 2k6/fp
>> improve ~9.6% ~4.8% ~5.5% ~14.4%
>>
>> All patches pass bootstrap and regression test on x86_64/x86. I will
>> bootstrap and test them on aarch64/arm platforms too.
>>
>> The first patch turns to tree operand_equal_p to check the number of
>> iterations in iv_elimination_lt. Though I think this change isn't necessary
>> for current code, it's needed if we further relax iv elimination for cases
>> in which sign/unsigned conversion is involved.
>
> As said elsewhere this bug should be fixed in tree-affine.c. Do you have
> a testcase?
>
Sorry I don't have test case without patching GCC, I will revisit the
problem and try to understand whether it's necessary or in which part
it should be fixed.
Thanks,
bin