From patchwork Wed Sep 11 16:41:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Monakov X-Patchwork-Id: 274340 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 87DFF2C0128 for ; Thu, 12 Sep 2013 02:43:44 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; q=dns; s=default; b=r+7cAc0TNZ2Kdrt/ hYU9lSAIqTBiEheVyBBgv4Ahk8qgkMDtIk1GpjAgQuSaEsghOoIIqUe3ac+uvj88 l0Yk30eZYNDvDm1zSkkE2sU08/Y+N1PXqqE3Gj7Peb5tCmGTYcI7fu9v1rdoLKdY ce7pHs5mry8Hogr9nk+a5NkyvyQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; s=default; bh=OhiVbvC0Fs7XxLnOyNFeSw I2TMc=; b=U8qaxYnMCaLyW4uCCMekBDdRCiDIpVRQGIRIYYwMqfYPgtqL5SEBc+ NQpkUbS56J+MUe07CxwJwSgSjrSmx6zH4k7T3Z+G5bQQb9bnCG2PU1xsQ+8XKzNT oXkN6J3WW61wcm8n8suijKWWRQU1kCDwo/dRcbGlDqIj/PnDyFfJ4= Received: (qmail 8919 invoked by alias); 11 Sep 2013 16:43:38 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 8909 invoked by uid 89); 11 Sep 2013 16:43:37 -0000 Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.199.79) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Sep 2013 16:43:37 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RDNS_NONE autolearn=no version=3.3.2 X-HELO: smtp.ispras.ru Received: from [10.10.3.121] (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id DFF6822221; Wed, 11 Sep 2013 20:43:33 +0400 (MSK) Date: Wed, 11 Sep 2013 20:41:43 +0400 (MSK) From: Alexander Monakov To: Wei Mi cc: Steven Bosscher , GCC Patches , David Li Subject: Re: Fwd: [PATCH] Scheduling result adjustment to enable macro-fusion In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 On Wed, 11 Sep 2013, Wei Mi wrote: > I tried that and it caused some regressions, so I choosed to do > chain_to_prev_insn another time in add_branch_dependences. There could > be some dependence between those two functions. (please don't top-post on this list) In that case you can adjust 'last' in add_branch_dependences so that the dependences pin the compare rather than the jump to the end, like this (untested): I'm also not a fan of adding two scheduler hooks and explicit handling in sched-deps.c for this feature. You probably could handle that with sched_init hook entirely in the x86 backend (just loop over basic blocks and mark suitable jumps with SCHED_GROUP_P), but on the other hand I can see an argument that this might be useful in the future for other architectures. Have you considered that? What do other maintainers say? Thanks. Alexander diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index 2c971e2..a774d5d 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -2443,6 +2443,9 @@ add_branch_dependences (rtx head, rtx tail) cc0 setters remain at the end because they can't be moved away from their cc0 user. + Predecessors of SCHED_GROUP_P instructions that remain at the end also + remain at the end. + COND_EXEC insns cannot be moved past a branch (see e.g. PR17808). Insns setting TARGET_CLASS_LIKELY_SPILLED_P registers (usually return @@ -2465,6 +2468,7 @@ add_branch_dependences (rtx head, rtx tail) #endif || (!reload_completed && sets_likely_spilled (PATTERN (insn))))) + || (last != 0 && SCHED_GROUP_P (last)) || NOTE_P (insn)) { if (!NOTE_P (insn))