[PATCH] Refactor tree-vrp.c

Richard Biener richard.guenther@gmail.com
Mon May 11 12:53:26 GMT 2020


On Fri, May 8, 2020 at 7:11 PM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Fri, 2020-05-08 at 13:06 -0300, Giuliano Belinassi via Gcc-patches wrote:
> > Hi,
> >
> > This patch Refactors tree-vrp.c to eliminate all global variables except
> > 'x_vrp_values', which will require that 'thread_outgoing_edges' to
> > accept an extra argument and pass it to the 'simplify' callback.
> >
> > It also removes every access to 'cfun', retrieving the function being
> > compiled from the pass engine.
> >
> > Bootstrapped and ran the testsuite on Linux x86_64.
> >
> > gcc/ChangeLog
> > 2020-05-08  Giuliano Belinassi  <giuliano.belinassi@usp.br>
> >
> >       * tree-vrp.c (class liveness): New.
> >       (insert_range_assertions): Move to class liveness.
> >       (dump_all_asserts): Same as above.
> >       (dump_asserts_for): Same as above.
> >       (live): Same as above.
> >       (need_assert_for): Same as above.
> >       (live_on_edge): Same as above.
> >       (finish_register_edge_assert_for): Same as above.
> >       (find_switch_asserts): Same as above.
> >       (find_assert_locations): Same as above.
> >       (find_assert_locations_1): Same as above.
> >       (find_conditional_asserts): Same as above.
> >       (process_assert_insertions): Same as above.
> >       (register_new_assert_for): Same as above.
> >       (vrp_prop): New variable fun.
> >       (vrp_initialize): New parameter.
> >       (identify_jump_threads): Same as above.
> >       (execute_vrp): Same as above.
> Just a note.  While the old VRP implementation in tree-vrp.c is on the chopping
> block, but it'll likely be the end of summer before we know if further work in
> the new Ranger based implementation will be needed to totally replace tree-vrp
> w/o introducing any performance regressions.
>
> Thus, IMHO, we should go forward with the review.

Agreed, so I went ahead and reviewed it.  The only comment I have is
that 'liveness' is not a good match for the machinery which is about
insertion of ASSERT_EXPR stmts for VRP.  I suggest to use
vrp_insert or vrp_asserts instead.

OK with that change.
Richard.

>
> Jeff
>
>
>


More information about the Gcc-patches mailing list