From patchwork Fri Jul 2 13:00:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 57659 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 E086B1007D6 for ; Fri, 2 Jul 2010 23:00:26 +1000 (EST) Received: (qmail 11641 invoked by alias); 2 Jul 2010 13:00:24 -0000 Received: (qmail 11627 invoked by uid 22791); 2 Jul 2010 13:00:22 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Jul 2010 13:00:15 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id C32F89AC81C; Fri, 2 Jul 2010 15:00:12 +0200 (CEST) Date: Fri, 2 Jul 2010 15:00:12 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Enable array prefetching also with -fprofile-use Message-ID: <20100702130012.GD6378@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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 Hi, with -fprofile-use the prefetching should not be risky since we have idea about what loops are hot and what are their average number of iterations. So I think we ought to enable the pass as we do with -O3. If there will not be complains, I will commit the following tonight. bootstrapped/regtested x86_64-linux Honza * config/i386/i386.c (override_options): Enable prefetching also with -fprofile-use. Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 161690) +++ config/i386/i386.c (working copy) @@ -3558,7 +3558,7 @@ override_options (bool main_args_p) /* Enable sw prefetching at -O3 for CPUS that prefetching is helpful. */ if (flag_prefetch_loop_arrays < 0 && HAVE_prefetch - && optimize >= 3 + && (optimize >= 3 || flag_profile_use) && software_prefetching_beneficial_p ()) flag_prefetch_loop_arrays = 1;