From patchwork Thu Jul 21 16:30:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Zhuykov X-Patchwork-Id: 106102 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]) by ozlabs.org (Postfix) with SMTP id 54E3DB6F75 for ; Fri, 22 Jul 2011 02:32:02 +1000 (EST) Received: (qmail 13256 invoked by alias); 21 Jul 2011 16:31:31 -0000 Received: (qmail 13085 invoked by uid 22791); 21 Jul 2011 16:31:23 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,TW_CF X-Spam-Check-By: sourceware.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (140.186.70.92) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Jul 2011 16:31:04 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qjw9L-0002Ds-Kz for gcc-patches@gcc.gnu.org; Thu, 21 Jul 2011 12:31:03 -0400 Received: from smtp.ispras.ru ([83.149.198.202]:44934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjw9L-0002CK-3o for gcc-patches@gcc.gnu.org; Thu, 21 Jul 2011 12:30:59 -0400 Received: from ispserv.ispras.ru (ispserv.ispras.ru [83.149.198.72]) by smtp.ispras.ru (Postfix) with ESMTP id CC16D5D407A; Thu, 21 Jul 2011 20:22:39 +0400 (MSD) Received: from condor.intra.ispras.ru (winnie.ispras.ru [83.149.198.236]) by ispserv.ispras.ru (Postfix) with ESMTP id 149423FC5D; Thu, 21 Jul 2011 20:30:35 +0400 (MSD) From: zhroma@ispras.ru To: gcc-patches@gcc.gnu.org Cc: dm@ispras.ru Subject: [PATCH 4/9] Move the SMS pass earlier Date: Thu, 21 Jul 2011 20:30:29 +0400 Message-Id: <1311265834-2144-5-git-send-email-zhroma@ispras.ru> In-Reply-To: <1311265834-2144-1-git-send-email-zhroma@ispras.ru> References: <1311265834-2144-1-git-send-email-zhroma@ispras.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 83.149.198.202 X-IsSubscribed: yes 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 This patch moves the pass_sms before the pass_partition_blocks. There is no doloop_end pattern on x86_64. That's why current SMS implementation can't schedule any loops. But regtesting trunk with SMS on x86_64 shows an ICE on gcc.dg/tree-prof/bb-reorg.c. The problem is in an unconditional edge created by pass_partition_blocks. The edge is not eliminated while entering cfg_layout mode, and this leads to assertion fail, because there should be no unconditional jumps in cfg_layout mode. Moving the pass seems reasonable besause it also allows to prevent additional entering and exiting cfl_layout mode. I can't say anything about how correct such pass movement is from other points of view. 2011-07-20 Roman Zhuykov * modulo-sched.c (rest_of_handle_sms): Do not enter or exit cfg_layout mode. * passes.c (init_optimization_passes): Move pass_sms before pass_partition_blocks. --- gcc/modulo-sched.c | 9 --------- gcc/passes.c | 2 +- 2 files changed, 1 insertions(+), 10 deletions(-) diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c index 24d99af..948209e 100644 --- a/gcc/modulo-sched.c +++ b/gcc/modulo-sched.c @@ -3352,21 +3352,12 @@ static unsigned int rest_of_handle_sms (void) { #ifdef INSN_SCHEDULING - basic_block bb; - /* Collect loop information to be used in SMS. */ - cfg_layout_initialize (0); sms_schedule (); /* Update the life information, because we add pseudos. */ max_regno = max_reg_num (); - - /* Finalize layout changes. */ - FOR_EACH_BB (bb) - if (bb->next_bb != EXIT_BLOCK_PTR) - bb->aux = bb->next_bb; free_dominance_info (CDI_DOMINATORS); - cfg_layout_finalize (); #endif /* INSN_SCHEDULING */ return 0; } diff --git a/gcc/passes.c b/gcc/passes.c index 88b7147..5594571 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1456,6 +1456,7 @@ init_optimization_passes (void) NEXT_PASS (pass_ud_rtl_dce); NEXT_PASS (pass_combine); NEXT_PASS (pass_if_after_combine); + NEXT_PASS (pass_sms); NEXT_PASS (pass_partition_blocks); NEXT_PASS (pass_regmove); NEXT_PASS (pass_outof_cfg_layout_mode); @@ -1465,7 +1466,6 @@ init_optimization_passes (void) NEXT_PASS (pass_stack_ptr_mod); NEXT_PASS (pass_mode_switching); NEXT_PASS (pass_match_asm_constraints); - NEXT_PASS (pass_sms); NEXT_PASS (pass_sched); NEXT_PASS (pass_ira); NEXT_PASS (pass_postreload);