This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH GCC]Try harder to find base object by expanding base address
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Bin Cheng <Bin dot Cheng at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Thu, 19 Oct 2017 13:18:59 +0200
- Subject: Re: [PATCH GCC]Try harder to find base object by expanding base address
- Authentication-results: sourceware.org; auth=none
- References: <DB5PR0801MB2742327C5CFB31929C0F66D2E7480@DB5PR0801MB2742.eurprd08.prod.outlook.com>
On Fri, Oct 13, 2017 at 5:04 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> I ran into this when investigating PR82369 which we failed to find base object.
> This simple patch tries harder to find base object by expanding base address
> in alloc_iv. In general, we don't want to do aggressive expansion, but this
> case is fine because finding base object means reduction happened during the
> expansion.
I'm not sure. Does simplification happen for the testcase when expanding?
> And it's good to have base object for address type iv_uses.
Because we find related candidates via base-object?
It looks like we could avoid excessive expansion by doing
determine_base_object together with expr expansion given
the base object search is linear. We can simply follow
SSA defs until we reach a suitable base and upon unwinding
build the base expression?
Richard.
> Bootstrap and test on x86_64 and AArch64. Is it OK?
>
> Thanks,
> bin
> 2017-10-12 Bin Cheng <bin.cheng@arm.com>
>
> * tree-scalar-evolution.c (alloc_iv): New parameter controlling
> base expansion for finding base object.
> (find_interesting_uses_address): Adjust call to alloc_iv.
>
> gcc/testsuite
> 2017-10-12 Bin Cheng <bin.cheng@arm.com>
>
> * gcc.dg/tree-ssa/ivopt_6.c: New test.