This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH GCC][rework]Improve loop bound info by simplifying conversions in iv base
- From: "Bin.Cheng" <amker dot cheng at gmail dot com>
- To: Bin Cheng <bin dot cheng at arm dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 15 Sep 2015 13:57:34 +0800
- Subject: Re: [PATCH GCC][rework]Improve loop bound info by simplifying conversions in iv base
- Authentication-results: sourceware.org; auth=none
- References: <000001d0e0ac$9008b1b0$b01a1510$ at arm dot com>
Ping.
On Thu, Aug 27, 2015 at 5:41 PM, Bin Cheng <bin.cheng@arm.com> wrote:
> Hi,
> This is a rework for
> https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02335.html, with review
> comments addressed. For now, SCEV may compute iv base in the form of
> "(signed T)((unsigned T)base + step))". This complicates other
> optimizations/analysis depending on SCEV because it's hard to dive into type
> conversions. This kind of type conversions can be simplified with
> additional range information implied by loop initial conditions. This patch
> does such simplification.
> With simplified iv base, loop niter analysis can compute more accurate bound
> information since sensible value range can be derived for "base+step". For
> example, accurate loop bound&may_be_zero information is computed for cases
> added by this patch.
>
> The code is actually moved from loop_exits_before_overflow. After this
> patch, the corresponding code in loop_exits_before_overflow will be never
> executed, so I removed that part code. The patch also includes some code
> format changes.
>
> Bootstrap and test on x86_64. Is it OK?
>
> Thanks,
> bin
>
> 2015-08-27 Bin Cheng <bin.cheng@arm.com>
>
> * tree-ssa-loop-niter.c (tree_simplify_using_condition_1): Support
> new parameter.
> (tree_simplify_using_condition): Ditto.
> (simplify_using_initial_conditions): Ditto.
> (loop_exits_before_overflow): Pass new argument to function
> simplify_using_initial_conditions. Remove case for type conversions
> simplification.
> * tree-ssa-loop-niter.h (simplify_using_initial_conditions): New
> parameter.
> * tree-scalar-evolution.c (simple_iv): Simplify type conversions
> in iv base using loop initial conditions.
>
> gcc/testsuite/ChangeLog
> 2015-08-27 Bin Cheng <bin.cheng@arm.com>
>
> * gcc.dg/tree-ssa/loop-bound-2.c: New test.
> * gcc.dg/tree-ssa/loop-bound-4.c: New test.
> * gcc.dg/tree-ssa/loop-bound-6.c: New test.