From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13400 invoked by alias); 14 Dec 2010 07:56:38 -0000 Received: (qmail 13392 invoked by uid 22791); 14 Dec 2010 07:56:38 -0000 X-SWARE-Spam-Status: No, hits=-2.0 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; Tue, 14 Dec 2010 07:56:31 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 29025) id 72A849ACB2F; Tue, 14 Dec 2010 08:56:29 +0100 (CET) Date: Tue, 14 Dec 2010 08:25:00 -0000 From: Zdenek Dvorak To: "Fang, Changpeng" Cc: "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH, Loop optimizer]: Add logic to disable certain loop optimizations on pre-/post-loops Message-ID: <20101214075629.GA10020@kam.mff.cuni.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg01070.txt.bz2 Hi, > The attached patch adds the logic to disable certain loop optimizations on pre-/post-loops. > > Some loop optimizations (auto-vectorization, loop unrolling, etc) may peel a few iterations > of a loop to form pre- and/or post-loops for various purposes (alignment, loop bounds, etc). > Currently, GCC loop optimizer is unable to recognize that such loops will roll only a few > iterations and still perform optimizations on them. While this does not hurt the performance in general, > it may significantly increase the compilation time and code size without performance benefit. > > This patch adds such logic for the loop optimizer to recognize pre- and/or post loops, and disable > prefetch, unswitch and loop unrolling on them. why not simply change the profile updating to correctly indicate that these loops do not roll? That way, all the optimizations would profit, not just those aware of the new bb flag, Zdenek