From: Steven Bosscher <stevenb.gcc@gmail.com>
To: Richard Guenther <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch] Introduce dumpfile.h, clean up tree-pass.h dependencies
Date: Mon, 16 Jul 2012 11:57:00 -0000 [thread overview]
Message-ID: <CABu31nOEUHu34qqq85ePJ+pJb+qbPoBWu8i3K+6SfesMdmPYKw@mail.gmail.com> (raw)
In-Reply-To: <CAFiYyc3m7At3x1zx4JUBRavO+cRUtPNM5diK7E74kepjS=NfKw@mail.gmail.com>
On Mon, Jul 16, 2012 at 1:49 PM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Mon, Jul 16, 2012 at 11:12 AM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
>> On Mon, Jul 16, 2012 at 11:00 AM, Richard Guenther
>> <richard.guenther@gmail.com> wrote:
>>> On Fri, Jul 13, 2012 at 3:38 PM, Steven Bosscher <stevenb.gcc@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"
prev parent reply other threads:[~2012-07-16 11:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-13 13:39 Steven Bosscher
2012-07-16 9:00 ` Richard Guenther
2012-07-16 9:12 ` Steven Bosscher
2012-07-16 11:49 ` Richard Guenther
2012-07-16 11:57 ` Steven Bosscher [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABu31nOEUHu34qqq85ePJ+pJb+qbPoBWu8i3K+6SfesMdmPYKw@mail.gmail.com \
--to=stevenb.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=richard.guenther@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).