This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Use number of iteration analysis from VRP


On Fri, Aug 27, 2010 at 7:57 AM, Richard Guenther <rguenther@suse.de> wrote:
>
> This makes VRP use number of iteration analysis to derive upper bounds
> for loop induction variables. ?Currently we only use SCEV to determine
> the initial value and drop the upper bound to INF when iterating the
> PHI node during propagation.
>
> A first variant uncovered may out-of-bound array accesses (you saw
> my patches to the testsuite), one somewhere in Boehm-GC. ?Those
> were all turned into infinite loops by optimizing away the exit
> test ... I figured that's not a good idea and thus added a flag
> to number of iteration analysis to disregard deriving bounds from
> out-of-bound accesses and other undefined behavior.
>
> The following patch still miscompiles CXB3014 due to PR45427, so
> the patch is a good test for our number of iteration analysis ...
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu.
>
> Comments welcome - I have to wait until PR45427 is fixed anyways.
>
> Thanks,
> Richard.
>
> 2010-08-27 ?Richard Guenther ?<rguenther@suse.de>
>
> ? ? ? ?* tree-vrp.c (adjust_range_with_scev): Use number of iteration
> ? ? ? ?estimate.
> ? ? ? ?(vrp_visit_phi_node): Delay using SCEV till we balloon the
> ? ? ? ?range.
> ? ? ? ?(execute_vrp): Compute number of iteration estimates.
> ? ? ? ?* cfgloop.h (estimate_numbers_of_iterations_loop): Adjust prototype.
> ? ? ? ?* tree-flow.h (estimate_numbers_of_iterations): Likewise.
> ? ? ? ?* tree-data-ref.c (estimated_loop_iterations): Adjust.
> ? ? ? ?* tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop):
> ? ? ? ?Infer loop bounds from undefined behavior based on a new
> ? ? ? ?parameter.
> ? ? ? ?(estimate_numbers_of_iterations): Likewise.
> ? ? ? ?(scev_probably_wraps_p): Adjust.
> ? ? ? ?* tree-ssa-loop.c (tree_ssa_loop_bounds): Likewise.
>
> ? ? ? ?* gcc.dg/vect/vect-outer-fir.c: Adjust.
> ? ? ? ?* gcc.dg/tree-ssa/vrp54.c: New testcase.
>

This may have caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46675

H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]