From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28132 invoked by alias); 13 Mar 2008 09:21:31 -0000 Received: (qmail 28116 invoked by uid 22791); 13 Mar 2008 09:21:30 -0000 X-Spam-Check-By: sourceware.org Received: from wf-out-1314.google.com (HELO wf-out-1314.google.com) (209.85.200.170) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Mar 2008 09:21:07 +0000 Received: by wf-out-1314.google.com with SMTP id 28so3604308wfc.14 for ; Thu, 13 Mar 2008 02:21:05 -0700 (PDT) Received: by 10.142.128.6 with SMTP id a6mr4000637wfd.206.1205400065483; Thu, 13 Mar 2008 02:21:05 -0700 (PDT) Received: by 10.142.86.17 with HTTP; Thu, 13 Mar 2008 02:21:05 -0700 (PDT) Message-ID: <84fc9c000803130221x3e52a493y3d707dff78a9ebeb@mail.gmail.com> Date: Thu, 13 Mar 2008 09:21:00 -0000 From: "Richard Guenther" To: "Jan Hubicka" Subject: Re: Continue stmt branch prediction Cc: "Diego Novillo" , "Andrew MacLeod" , "Jan Hubicka" , gcc-patches@gcc.gnu.org In-Reply-To: <20080313013740.GO24550@atrey.karlin.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080209194852.GO1026@kam.mff.cuni.cz> <47B0CDB4.3070708@redhat.com> <20080305183319.GH24550@atrey.karlin.mff.cuni.cz> <20080305222822.GC14011@atrey.karlin.mff.cuni.cz> <47D818CE.10605@google.com> <20080313013740.GO24550@atrey.karlin.mff.cuni.cz> 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: 2008-03/txt/msg00783.txt.bz2 On Thu, Mar 13, 2008 at 2:37 AM, Jan Hubicka wrote: > > On 3/5/08 2:28 PM, Jan Hubicka wrote: > > > > >I will give it one last try. I think the misunderstanding can be here. > > >The prediction hint is not affecting edges *out* of the block it sits > > >in. When lowered, it is affecting all the edges that are going from > > >basic block not postdominated by the block to basic block postdominated > > >by the block (here the course of execution is crossing the point that it > > >inavoidably leads to the place PREDICT_EXPR is). Think of abort call: > > >it is affecting all conditionals that are guarding it in the program. > > > > Ah, I see now. Yes, I think I finally got your point. Adding > > PREDICT_EXPR is fine with me. > > Great :) > Thanks for time needed to get through this! > > > > > Instead of having to special-case it in places like DCE, how about we > > make it produce a value which is assigned to an artificial volatile > > global temporary? This way, we don't need to touch the optimizers, they > > will all naturally back away from moving and/or removing it. > > This decision is definitly up to you. I can definitly make PREDICT_EXPR > an expression tree instead of GIMPLE statement and put it into > MODIFY_EXPR destinating some dummy volatile. This seems bit hackish way > to me to save one case label in DCE: DCE is a bit special among the > early passes in a way that it does worry about more side effects of > statements beside the usual operands+semantics of statements all the > other propagation passes are about. DCE has to know all GIMPLE > statement types (and it just aborts on any new). I would tend to argue > that with exception of DCE we can hardly come with early scalar cleanup > pass that really do care here and will need to special case MODIFY_EXPR > statement. I also think this is a hack and adjusting DCE sounds more natural. A volatile global will also affect optimization because of the needed VOPs. Richard.