From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30784 invoked by alias); 7 Jun 2011 23:16:51 -0000 Received: (qmail 30776 invoked by uid 22791); 7 Jun 2011 23:16:50 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Jun 2011 23:16:32 +0000 Received: from hpaq1.eem.corp.google.com (hpaq1.eem.corp.google.com [172.25.149.1]) by smtp-out.google.com with ESMTP id p57NGVLh016250 for ; Tue, 7 Jun 2011 16:16:31 -0700 Received: from yxd5 (yxd5.prod.google.com [10.190.1.197]) by hpaq1.eem.corp.google.com with ESMTP id p57NG9hj004158 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 7 Jun 2011 16:16:29 -0700 Received: by yxd5 with SMTP id 5so209466yxd.35 for ; Tue, 07 Jun 2011 16:16:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.10.8 with SMTP id n8mr6160051agi.201.1307488589026; Tue, 07 Jun 2011 16:16:29 -0700 (PDT) Received: by 10.91.213.2 with HTTP; Tue, 7 Jun 2011 16:16:28 -0700 (PDT) In-Reply-To: References: <20110601231202.224188ad.basile@starynkevitch.net> Date: Tue, 07 Jun 2011 23:34:00 -0000 Message-ID: Subject: Re: Dump before flag From: Xinliang David Li To: Richard Guenther Cc: GCC Patches , Diego Novillo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00595.txt.bz2 It might be also useful to implement the dumping behavior like this: if any of the start/before/after/finish option is explicitly specified, IR (and only IR) will be dumped into files suffixed with .start/.before/.after/.finish. The debug dump will be dumped as usual into the non suffixed file name. By default, the IR dump and debug dump will be dumped into the same file which is the current behavior. David On Tue, Jun 7, 2011 at 4:08 PM, Xinliang David Li wrot= e: > The following is the patch that does the job. Most of the changes are > just =A0removing TODO_dump_func. The major change is in passes.c and > tree-pass.h. > > -fdump-xxx-yyy-start =A0 =A0 =A0 <-- dump before TODO_start > -fdump-xxx-yyy-before =A0 =A0<-- dump before main pass after TODO_pass > -fdump-xxx-yyy-after =A0 =A0 =A0 <-- dump after main pass before TODO_fin= ish > -fdump-xxx-yyy-finish =A0 =A0 =A0<-- dump after TODO_finish > > The default is 'finish'. > > Does it look ok? > > Thanks, > > David > > On Tue, Jun 7, 2011 at 2:36 AM, Richard Guenther > wrote: >> On Mon, Jun 6, 2011 at 6:20 PM, Xinliang David Li w= rote: >>>> >>>> Your patch doesn't really improve this but adds to the confusion. >>>> >>>> + =A0/* Override dump TODOs. =A0*/ >>>> + =A0if (dump_file && (pass->todo_flags_finish & TODO_dump_func) >>>> + =A0 =A0 =A0&& (dump_flags & TDF_BEFORE)) >>>> + =A0 =A0{ >>>> + =A0 =A0 =A0pass->todo_flags_finish &=3D ~TODO_dump_func; >>>> + =A0 =A0 =A0pass->todo_flags_start |=3D TODO_dump_func; >>>> + =A0 =A0} >>>> >>>> and certainly writing to pass is not ok. =A0And the TDF_BEFORE flag >>>> looks misplaced as it controls TODOs, not dumping behavior. >>>> Yes, it's a mess right now but the above looks like a hack ontop >>>> of that mess (maybe because of it, but well ...). >>>> >>> >>> How about removing dumping TODO completely -- this can be done easily >>> -- I don't understand why pass wants extra control on the dumping if >>> user already asked for dumping -- it is annoying to see empty IR dump >>> for a pass when I want to see it. >>> >>>> At least I would have expected to also get the dump after the >>>> pass, not only the one before it with this dump flag. >>>> >>>> Now, why can't you look at the previous pass output for the >>>> before-dump (as I do usually)? >>> >>> For one thing, you need to either remember what is the previous pass, >>> or dump all passes which for large files can take very long time. Even >>> with all the dumps, you will need to eyeballing to find the previous >>> pass which may or may not have the IR dumped. >>> >>> How about removing dump TODO? >> >> Yeah, I think this would go in the right direction. =A0Currently some pa= sses >> do not dump function bodies because they presumably do no IL >> modification. =A0But this is certainly the minority (and some passes do = not >> dump bodies even though they are modifying the IL ...). >> >> So I'd say we should by default dump function bodies. >> >> Note that there are three useful dumping positions (maybe four), >> before todo-start, after todo-start, before todo-finish and after todo-f= inish. >> By default we'd want after todo-finish. =A0When we no longer dump via >> a TODO then we could indeed use dump-flags to control this >> (maybe -original for the body before todo-start). >> >> What to others think? >> >> Richard. >> >>> Thanks, >>> >>> David >>> >>> >>>> >>>> Richard. >>>> >>> >> >