On Fri, Oct 13, 2017 at 5:04 PM, Bin Cheng <bin.ch...@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.ch...@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.ch...@arm.com>
>
>         * gcc.dg/tree-ssa/ivopt_6.c: New test.

Reply via email to