This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Add tree-ssa-loop.h and friends.
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 7 Oct 2013 10:44:08 +0200
- Subject: Re: [patch] Add tree-ssa-loop.h and friends.
- Authentication-results: sourceware.org; auth=none
- References: <524CD236 dot 1010009 at redhat dot com>
On Thu, Oct 3, 2013 at 4:11 AM, Andrew MacLeod <firstname.lastname@example.org> wrote:
> this patch consolidates tree-ssa-loop*.c files with new .h files as required
> (8 in total)
> A number of the prototypes were in tree-flow.h, but there were also a few in
> cfgloop.h. tree-ssa-loop.h was created to contain a couple of common
> structs and act as the gathering file for any generally applicable
> tree-ssa-loop includes. tree-flow.h includes this file for now.
> There is a bit of a criss-cross mess between the cfg-* and tree-ssa-loop*
> routines, but I'm not touching that for now. Some of that might have to get
> resolved when I try to remove tree-flow.h as a standard include file from
> the .c files.. we'll see.
> In particular, tree-ssa-loop-niter.h exports a lot of more generally used
> routines. loop-iv.c, loop-unroll.c and loop-unswitch.c needed to include it.
> A few routines werent referenced outside their file so I made those static,
> and there was one routine stmt_invariant_in_loop_p wich was actually unused.
> bootstraps on x86_64-unknown-linux-gnu and passes with no new regressions.
+ enum tree_code cmp;
+ #include "tree-ssa-loop-im.h"
+ #include "tree-ssa-loop-ivcanon.h"
what's the particular reason to not do includes first? That looks really
odd (and maybe rather than doing that these includes should be done
elsewhere, like in .c files or in a header that includes tree-ssa-loop.h).
You seem to export things like movement_possibility that are not
used outside of tree-ssa-loop-im.c (in my tree at least).
Other than that the single reason we have to have all these exports
is that loop passes have their pass structures and gate / entries
defined in tree-ssa-loop.c instead of in the files the passes reside.
Consider changing that as a preparatory patch - it should cut down
the number of needed new .h files.