From patchwork Tue Mar 19 12:41:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 229380 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 CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 0A58F2C00A7 for ; Thu, 21 Mar 2013 00:13:36 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :resent-from:resent-date:resent-message-id:resent-to:date:from :to:cc:subject:message-id:mime-version:content-type; q=dns; s= default; b=S+8dGYSomhOKT6gDpgzq6ylfvTZtXJ2ExBnTiWYaikiACY0AsvkI+ xXL0Tc5plBLeU61JFlR0eqc7wafWcPSXAJnUZiw3Y97alBRcJMdiEBiaDqi2GNTc wWfCf8x44/nH9U11jclcusv7C8z3yn5Ce91nSupRAlyf8Z8nsqqn0A= 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 :resent-from:resent-date:resent-message-id:resent-to:date:from :to:cc:subject:message-id:mime-version:content-type; s=default; bh=CvWUcIIVWAlj3vnNpNARadc8Twc=; b=JGUkbkP+ZBNqm7SnxSaHWxBjhK2n xOI6ov8wEzbSH0oN6JfKVoyJzzVymv6pnh4S5/MBbh9U4Xm9uzs346Bl0GlMoyaM Aod35Jf+Gncy3Oclt0OlBUetsoSajVAih095UcP6JnCq80K6H2gq5xrbYhHsicE6 9zXP363awVJu8+Q= Received: (qmail 1286 invoked by alias); 20 Mar 2013 13:13:31 -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 1261 invoked by uid 89); 20 Mar 2013 13:13:24 -0000 X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 20 Mar 2013 13:13:21 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 79EF6A51CB for ; Wed, 20 Mar 2013 14:13:19 +0100 (CET) Resent-From: Martin Jambor Resent-Date: Wed, 20 Mar 2013 14:13:19 +0100 Resent-Message-ID: <20130320131319.GA16552@virgil.suse> Resent-To: GCC Patches Date: Tue, 19 Mar 2013 13:41:23 +0100 From: Martin Jambor To: GCC Patches Cc: Jan Hubicka Subject: [PATCH] Incorporate INLINE_HINT_array_index in IPA-CP heuristics Message-ID: <20130319124123.GA4334@virgil.suse> Mail-Followup-To: GCC Patches , Jan Hubicka MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Hi, either it was added very late or I simply missed it in last stage1, but currently IPA-CP does not use INLINE_HINT_array_index in any way. This patch incorporates it to heuristics computations. I chose the bonus value to simply be slightly smaller than the bonuses for known strides and sizes, I plan to re-examine them once we have better aggregate jump functions and we start getting these hints in real Fortran benchmarks. Bootstrapped and tested on x86_64-linux. OK for trunk? Thanks, Martin 2013-01-21 Martin Jambor * params.def (PARAM_IPA_CP_ARRAY_INDEX_HINT_BONUS): New parameter. * ipa-cp.c (hint_time_bonus): Add abonus for known array indices. Index: src/gcc/ipa-cp.c =================================================================== --- src.orig/gcc/ipa-cp.c +++ src/gcc/ipa-cp.c @@ -1606,9 +1606,12 @@ devirtualization_time_bonus (struct cgra static int hint_time_bonus (inline_hints hints) { + int result = 0; if (hints & (INLINE_HINT_loop_iterations | INLINE_HINT_loop_stride)) - return PARAM_VALUE (PARAM_IPA_CP_LOOP_HINT_BONUS); - return 0; + result += PARAM_VALUE (PARAM_IPA_CP_LOOP_HINT_BONUS); + if (hints & INLINE_HINT_array_index) + result += PARAM_VALUE (PARAM_IPA_CP_ARRAY_INDEX_HINT_BONUS); + return result; } /* Return true if cloning NODE is a good idea, given the estimated TIME_BENEFIT Index: src/gcc/params.def =================================================================== --- src.orig/gcc/params.def +++ src/gcc/params.def @@ -919,6 +919,12 @@ DEFPARAM (PARAM_IPA_CP_LOOP_HINT_BONUS, "bounds or strides known.", 64, 0, 0) +DEFPARAM (PARAM_IPA_CP_ARRAY_INDEX_HINT_BONUS, + "ipa-cp-array-index-hint-bonus", + "Compile-time bonus IPA-CP assigns to candidates which make an array " + "index known.", + 48, 0, 0) + /* WHOPR partitioning configuration. */ DEFPARAM (PARAM_LTO_PARTITIONS,