From patchwork Tue Jun 7 17:39:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Monakov X-Patchwork-Id: 99313 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 702CAB6F8C for ; Wed, 8 Jun 2011 03:40:24 +1000 (EST) Received: (qmail 32263 invoked by alias); 7 Jun 2011 17:40:19 -0000 Received: (qmail 32240 invoked by uid 22791); 7 Jun 2011 17:40:16 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL, BAYES_00, FSL_RU_URL, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.198.202) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Jun 2011 17:40:00 +0000 Received: from ispserv.ispras.ru (ispserv.ispras.ru [83.149.198.72]) by smtp.ispras.ru (Postfix) with ESMTP id 491635D40B0; Tue, 7 Jun 2011 21:35:11 +0400 (MSD) Received: from monoid.intra.ispras.ru (winnie.ispras.ru [83.149.198.236]) by ispserv.ispras.ru (Postfix) with ESMTP id CE4AE3FC48; Tue, 7 Jun 2011 21:39:57 +0400 (MSD) Date: Tue, 7 Jun 2011 21:39:57 +0400 (MSD) From: Alexander Monakov To: Bernd Schmidt cc: Steve Ellcey , Andrey Belevantsev , GCC Patches Subject: Re: Initialize INSN_COND In-Reply-To: <4DE91EC4.3060908@codesourcery.com> Message-ID: References: <201105311824.p4VIOf007288@lucas.cup.hp.com> <4DE5489F.4020005@hotbox.ru> <4DE5F5DF.7090407@ispras.ru> <1306942802.2556.281.camel@hpsje.cup.hp.com> <4DE77576.7060203@codesourcery.com> <4DE91EC4.3060908@codesourcery.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 On Fri, 3 Jun 2011, Bernd Schmidt wrote: > >> Ok. Although I wonder how sel-sched can end up reusing an entry in > >> h_d_i_d? Unlike Haifa scheduler, we recompute INSN_LUIDs for each region. However, we call sched_deps_{init,finish} once per function (like Haifa) and that makes us reuse entries in h_d_i_d. The proposed patch clears h_d_i_d when finishing a region in sel-sched. Bootstrapped and regtested on ia64-linux, OK for trunk? I also verified that HPUX failure mentioned by Steve is fixed on a cross-compiler. > >> How does it use this machinery? If it's not doing a normal > >> forward scan as in sched_analyze, the INSN_COND mechanism may break in > >> other ways. Normal forward scan is only done to compute insn priorities; now, it will also reset INSN_CONDs for instructions followed by an assignment to their predicate (for exposed-pipeline targets). After that, sel-sched's dependency analysis will treat such instructions as if they had no predicate, which is very conservative. Unfortunately, correctness still may be broken after a predicate assignment is moved into a different BB (or copied to one as a bookkeeping copy). I'll try to think of a way to fix it when preparing the predication patch. 2011-06-07 Alexander Monakov * sel-sched.c (move_op): Use correct type for 'res'. Verify that code_motion_path_driver returned 0 or 1. (sel_region_finish): Clear h_d_i_d. diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 3f22a3c..8a39d80 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -6675,7 +6675,7 @@ move_op (insn_t insn, av_set_t orig_ops, expr_t expr_vliw, { struct moveop_static_params sparams; struct cmpd_local_params lparams; - bool res; + int res; /* Init params for code_motion_path_driver. */ sparams.dest = dest; @@ -6694,6 +6694,8 @@ move_op (insn_t insn, av_set_t orig_ops, expr_t expr_vliw, code_motion_path_driver_info = &move_op_hooks; res = code_motion_path_driver (insn, orig_ops, NULL, &lparams, &sparams); + gcc_assert (res != -1); + if (sparams.was_renamed) EXPR_WAS_RENAMED (expr_vliw) = true; @@ -7269,6 +7271,7 @@ sel_region_finish (bool reset_sched_cycles_p) finish_deps_global (); sched_finish_luids (); + VEC_free (haifa_deps_insn_data_def, heap, h_d_i_d); sel_finish_bbs (); BITMAP_FREE (blocks_to_reschedule);