From patchwork Thu Nov 6 18:07:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renlin Li X-Patchwork-Id: 407657 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6C5A31400A0 for ; Fri, 7 Nov 2014 05:08:05 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=ifIixhpY8qg0rVLOH x7+pps5ZbGjXckcssdmKrdjoA7Ruyi6tsgbQld/Mt9hiE9jJMWHjys+OrcGe/DcA cy9/dwnGWVtF2pAXAiZxJsD5AQReN7u1T+LCxkLlkJKF9n8OxtT1Wp/kAWRkBMlL EylVyZxnirC3yn4PshfBMaFWew= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=5ahi2IPhltMJ+7HT8FHxijO 4NzM=; b=AKuPI6hxlykdtReW1CHRXwLVGiw+SVQlJQOH7XaPqIW1MsMVqIgw/88 gWhLyucZ0xJv1PqdaxvF/IY5KIbD/J3+LOhbMURrWH04i7EZ6AGqn8CrL69cfu3D Hms0Iz/uUdhzy2T3TWNimiKh4VGwN7wOwTrabA1ER8zh6jGZ4m9g= Received: (qmail 9619 invoked by alias); 6 Nov 2014 18:07:57 -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 9609 invoked by uid 89); 6 Nov 2014 18:07:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Nov 2014 18:07:56 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 06 Nov 2014 18:07:52 +0000 Received: from [10.1.203.158] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 6 Nov 2014 18:07:50 +0000 Message-ID: <545BB8F5.8070500@arm.com> Date: Thu, 06 Nov 2014 18:07:49 +0000 From: Renlin Li User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Teresa Johnson CC: Jeff Law , Dehao Chen , "gcc-patches@gcc.gnu.org" , Ramana Radhakrishnan , "su@cs.ucdavis.edu" Subject: Re: [PATCH]Partially fix PR61529, bound basic block frequency References: <5450B2C0.6040807@arm.com> <54579F5B.9070700@arm.com> <54594C46.6080704@redhat.com> <545B8F35.9070603@arm.com> <545BB5B5.90008@arm.com> In-Reply-To: X-MC-Unique: 114110618075210601 X-IsSubscribed: yes On 06/11/14 17:59, Teresa Johnson wrote: > Thanks for fixing the test case. Can you also add the comment I > suggested to the source change? > >> Please add a comment that this is needed due to insane incoming frequencies. >> Sorry, I mistakenly add it to the ChangeLog. Should be correct now. x86_64-unknown-linux-gnu bootstrap and regression test have been done, no new issue. aarch64-none-elf toolchain has been test on the model. No new regression. gcc/ChangeLog: 2014-11-06 Renlin Li PR middle-end/61529 * tree-ssa-threadupdate.c (compute_path_counts): Bound path_in_freq. gcc/testsuite/ChangeLog: 2014-11-06 Renlin Li PR middle-end/61529 * gcc.dg/pr61529.c: New. commit 35614b9b49d2478ad30225e4a3e864cd5df2e67f Author: Renlin Li Date: Tue Oct 28 16:30:42 2014 +0000 fix pr61529 diff --git a/gcc/testsuite/gcc.dg/pr61529.c b/gcc/testsuite/gcc.dg/pr61529.c new file mode 100644 index 0000000..392239e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr61529.c @@ -0,0 +1,27 @@ +/* PR middle-end/61529 */ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +unsigned int a = 0, b = 0; +unsigned int c; + +int +main () +{ + unsigned int d = 0; + int e[5]; + + for (; b < 1; b++) + d = 0; + for (; d < 1; d++) + a = 0; + for (; a < 1; a++) + ; + + for (c = 0; c < 5; c++) + e[c] = 1; + if (e[0]) + c = 0; + + return 0; +} diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index d2cf4de..3e20916 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -730,6 +730,11 @@ compute_path_counts (struct redirection_data *rd, nonpath_count += ein->count; } } + + /* This is needed due to insane incoming frequencies. */ + if (path_in_freq > BB_FREQ_MAX) + path_in_freq = BB_FREQ_MAX; + BITMAP_FREE (in_edge_srcs); /* Now compute the fraction of the total count coming into the first