On Mon, Jul 16, 2012 at 1:49 PM, Richard Guenther <richard.guent...@gmail.com> wrote: > On Mon, Jul 16, 2012 at 11:12 AM, Steven Bosscher <stevenb....@gmail.com> > wrote: >> On Mon, Jul 16, 2012 at 11:00 AM, Richard Guenther >> <richard.guent...@gmail.com> wrote: >>> On Fri, Jul 13, 2012 at 3:38 PM, Steven Bosscher <stevenb....@gmail.com> >>> wrote: >>>> Hello, >>>> >>>> The attached monster patch re-organizes a lot of includes to avoid >>>> dependencies on tree-pass.h just for having dump_file available. >>>> >>>> I've used the following "rules" to decide what needs to go where: >>>> >>>> * tree-dump.h should be independent of the pass manager, i.e. not >>>> include tree-pass.h. >>>> >>>> * passes that do not need dumping of GENERIC do not need tree-dump.h >>>> either. >>>> >>>> * Any file that defines an opt_pass may include tree-pass.h. >>>> >>>> * If a file includes tree-pass.h, it does not need to include >>>> dumpfile.h or timevar.h, because tree-pass.h provides these already >>>> (the *opt_pass structs depend on them) >>>> >>>> * If a file does not include tree-pass.h, but it needs dump_file, it >>>> should include dumpfile.h. Likewise for timevar.h. This category of >>>> files are the implementation files for supporting code, like alias.c >>>> and cfg*.c. >>>> >>>> With those rules in mind, my hackathon started and the result is >>>> attached. I had to move a few functions around, but not very much. I >>>> also uncovered a bug in one of the DF files, where it was trying to >>>> use get_insns without including emit-rtl.h. No DF file should emit >>>> RTL, so I don't want to include emit-rtl.h there, so I removed that >>>> dumping (which was only for debugging purposes anyway, and obviously >>>> not tested in a while or I wouldn't have run into this problem to >>>> begin with :-) >>>> >>>> Bootstrapped&tested on powerpc64-unknown-linux-gnu and on >>>> x86_64-unknown-linux-gnu. OK for trunk? >>> >>> You moved get_ref_base_and_extent to tree.c - any reason for that? >> >> Yes, tree.c uses it (build_simple_mem_ref_loc) and I don't want tree.c >> to depend on tree-dfa.c. Longer-term I'd like to split tree.c and >> tree.h, and this function and the two others you mention below could >> go into e.g. tree-anal.c. >> >>> It is similar to get_inner_reference which is in expr.c and similar to >>> get_addr_base_and_unit_offset which is still in tree-dfa.c. I'd prefer >>> to have it stay where it is for this patch. >> >> OK. > > Seems to break build with graphite for me: > > /space/rguenther/src/svn/trunk/gcc/graphite-dependences.c: In function > 'graphite_legal_transform': > /space/rguenther/src/svn/trunk/gcc/graphite-dependences.c:534: > warning: implicit declaration of function 'timevar_push' > /space/rguenther/src/svn/trunk/gcc/graphite-dependences.c:534: error: > 'TV_GRAPHITE_DATA_DEPS' undeclared (first use in this function) > ... > /space/rguenther/src/svn/trunk/gcc/graphite-clast-to-gimple.c: In > function 'translate_clast_user': > /space/rguenther/src/svn/trunk/gcc/graphite-clast-to-gimple.c:1102: > error: 'TODO_update_ssa' undeclared (first use in this function) > ... > /space/rguenther/src/svn/trunk/gcc/graphite-clast-to-gimple.c:1644: > error: 'TV_GRAPHITE_CODE_GEN' undeclared (first use in this function) > ... > > /space/rguenther/src/svn/trunk/gcc/graphite-sese-to-poly.c:2341: > error: 'TODO_update_ssa' undeclared (first use in this function) > ...
Grr... (/me cursing about being able to build gcc without graphite) Index: Makefile.in =================================================================== --- Makefile.in (revision 189519) +++ Makefile.in (working copy) @@ -2541,11 +2541,11 @@ graphite-blocking.o : graphite-blocking. coretypes.h dumpfile.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ sese.h graphite-poly.h graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \ - $(SYSTEM_H) coretypes.h dumpfile.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) \ + $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_PASS_H) \ $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h \ graphite-poly.h graphite-clast-to-gimple.h graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h dumpfile.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ + coretypes.h $(TREE_FLOW_H) $(TREE_PASS_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ sese.h graphite-poly.h graphite-interchange.o : graphite-interchange.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h dumpfile.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ @@ -2557,7 +2557,7 @@ graphite-scop-detection.o : graphite-sco coretypes.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H) \ sese.h graphite-poly.h graphite-scop-detection.h graphite-sese-to-poly.o : graphite-sese-to-poly.c $(CONFIG_H) \ - $(SYSTEM_H) coretypes.h dumpfile.h $(TREE_FLOW_H) $(CFGLOOP_H) \ + $(SYSTEM_H) coretypes.h $(TREE_FLOW_H) $(TREE_PASS_H) $(CFGLOOP_H) \ $(TREE_DATA_REF_H) domwalk.h sese.h graphite-poly.h \ graphite-sese-to-poly.h graphite-optimize-isl.o : graphite-optimize-isl.c $(CONFIG_H) $(SYSTEM_H) \ Index: graphite-clast-to-gimple.c =================================================================== --- graphite-clast-to-gimple.c (revision 189519) +++ graphite-clast-to-gimple.c (working copy) @@ -36,7 +36,7 @@ along with GCC; see the file COPYING3. #include "coretypes.h" #include "diagnostic-core.h" #include "tree-flow.h" -#include "dumpfile.h" +#include "tree-pass.h" #include "cfgloop.h" #include "tree-chrec.h" #include "tree-data-ref.h" Index: graphite-dependences.c =================================================================== --- graphite-dependences.c (revision 189519) +++ graphite-dependences.c (working copy) @@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. #include "system.h" #include "coretypes.h" #include "tree-flow.h" -#include "dumpfile.h" +#include "tree-pass.h" #include "cfgloop.h" #include "tree-chrec.h" #include "tree-data-ref.h" Index: graphite-sese-to-poly.c =================================================================== --- graphite-sese-to-poly.c (revision 189519) +++ graphite-sese-to-poly.c (working copy) @@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. #include "system.h" #include "coretypes.h" #include "tree-flow.h" -#include "dumpfile.h" +#include "tree-pass.h" #include "cfgloop.h" #include "tree-chrec.h" #include "tree-data-ref.h"