This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH PR68021]Set ratio to 1 when computing the value of biv cand by itself
- 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 at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Wed, 10 Feb 2016 14:13:27 +0000
- Subject: Re: [PATCH PR68021]Set ratio to 1 when computing the value of biv cand by itself
- Authentication-results: sourceware.org; auth=none
- References: <HE1PR08MB0507FEFCF4FF37E4E98CCDBFE7D70 at HE1PR08MB0507 dot eurprd08 dot prod dot outlook dot com> <CAFiYyc2Qd69YP9BZ=wPo-a3FeXfsdrgiJjqoRvWt5p-m55cjAw at mail dot gmail dot com>
On Wed, Feb 10, 2016 at 1:27 PM, Richard Biener
<richard.guenther@gmail.com> wrote:
>
> On Wed, Feb 10, 2016 at 12:34 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> > Hi,
> > This is another way to fix PR68021, and I think it's the least intrusive way. The issue is triggered in a special case in which cand is a original biv, and use denotes the value of the biv itself. In this case, the use is added specifically for the original biv, as a result, get_computation_aff isn't called for the <cand, use> pair before rewriting the use. It is possible that constant_multiple_of/operand_equal_q could fail because of inconsistent fold behavior. The fold behavior is fully described in PR68021.
> > This patch fixes IVOPT part of issue by setting ratio to 1, because it is known that the use has the value of the biv cand.
> >
> > Bootstrap and test on x86_64 and aarch64. Is it OK if no failures?
>
> Ok, but please add a comment why we have this special-casing instead
> of relying on constant_multiple_of.
Done, patch applied at revision 233269.
Thanks,
bin
>
>
> Thanks,
> Richard.
>
> > Thanks,
> > bin
> >
> > 2016-02-09 Bin Cheng <bin.cheng@arm.com>
> >
> > PR tree-optimization/68021
> > * tree-ssa-loop-ivopts.c (get_computation_aff): Set ratio to 1 if
> > when computing the value of biv cand by itself.
> >
> > gcc/testsuite/ChangeLog
> > 2016-02-09 Bin Cheng <bin.cheng@arm.com>
> >
> > PR tree-optimization/68021
> > * gcc.dg/tree-ssa/pr68021.c: New test.