From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1474 invoked by alias); 12 Apr 2012 11:17:01 -0000 Received: (qmail 1458 invoked by uid 22791); 12 Apr 2012 11:16:59 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Apr 2012 11:16:46 +0000 Received: by yenm3 with SMTP id m3so1036136yen.20 for ; Thu, 12 Apr 2012 04:16:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.188.134 with SMTP id ga6mr5526390igc.20.1334229405684; Thu, 12 Apr 2012 04:16:45 -0700 (PDT) Received: by 10.42.228.200 with HTTP; Thu, 12 Apr 2012 04:16:45 -0700 (PDT) In-Reply-To: References: Date: Thu, 12 Apr 2012 11:17:00 -0000 Message-ID: Subject: Re: [PATCH] Atom: Enabling unroll at O2 optimization level From: Richard Guenther To: Igor Zamyatin Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00739.txt.bz2 On Thu, Apr 12, 2012 at 1:05 PM, Igor Zamyatin wrote: > On Wed, Apr 11, 2012 at 12:39 PM, Richard Guenther > wrote: >> On Tue, Apr 10, 2012 at 8:43 PM, Igor Zamyatin wro= te: >>> Hi All! >>> >>> Here is a patch that enables unroll at O2 for Atom. >>> >>> This gives good performance boost on EEMBC 2.0 (~+8% in Geomean for 32 >>> bits) with quite moderate code size increase (~5% for EEMBC2.0, 32 >>> bits). >> >> 5% is not moderate. =A0Your patch does enable unrolling at -O2 but not -= O3, >> why? Why do you disable register renaming? =A0check_imull requires a fun= ction >> comment. > > Sure, enabling unroll for O3 could be the next step. > We can't avoid code size increase with unroll - what number do you > think will be appropriate? > Register renaming was the reason of several degradations during tuning pr= ocess > Comment for check_imull was added > >> >> This completely looks like a hack for EEMBC2.0, so it's definitely not o= k. > > Why? EEMBC was measured and result provided here just because this > benchmark considers to be very relevant for Atom I'd say that SPEC INT (2000 / 2006) is more relevant for Atom (SPEC FP would be irrelevant OTOH). Similar code size for, say, Mozilla Firefox or GCC itself would be important. >> -O2 is not supposed to give best benchmark results. > > O2 is wide-used so performance improvement could be important for users. But not at a 5% size cost. Please also always check the compile-time effect which is important for -O2 as well. Richard. >> >> Thanks, >> Richard. >> >>> >>> Tested for i386 and x86-64, ok for trunk? > > Updated patch attached > >>> >>> Thanks, >>> Igor >>> >>> ChangeLog: >>> >>> 2012-04-10 =A0Yakovlev Vladimir =A0 >>> >>> =A0 =A0 =A0 =A0* gcc/config/i386/i386.c (check_imul): New routine. >>> =A0 =A0 =A0 =A0(ix86_loop_unroll_adjust): New target hook. >>> =A0 =A0 =A0 =A0(ix86_option_override_internal): Enable unrolling on Ato= m at -O2. >>> =A0 =A0 =A0 =A0(TARGET_LOOP_UNROLL_ADJUST): New define.