From patchwork Sat May 14 19:39:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 95585 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 4997EB6EFE for ; Sun, 15 May 2011 05:46:02 +1000 (EST) Received: (qmail 19522 invoked by alias); 14 May 2011 19:46:00 -0000 Received: (qmail 19514 invoked by uid 22791); 14 May 2011 19:46:00 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 May 2011 19:45:45 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 3EE30CB0241 for ; Sat, 14 May 2011 21:45:44 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vNhH3cqB1lom for ; Sat, 14 May 2011 21:45:41 +0200 (CEST) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 34FEFCB01FC for ; Sat, 14 May 2011 21:45:41 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Small adjustment in tree-ssa-loop-im.c Date: Sat, 14 May 2011 21:39:25 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201105142139.25094.ebotcazou@adacore.com> 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 The Tree LIM pass keeps track of the execution status of statements by means of /* The outermost loop for that execution of the header guarantees that the block will be executed. */ #define ALWAYS_EXECUTED_IN(BB) ((struct loop *) (BB)->aux) and there is a fill_always_executed_in function: /* Fills ALWAYS_EXECUTED_IN information for basic blocks of LOOP, i.e. for each such basic block bb records the outermost loop for that execution of its header implies execution of bb. CONTAINS_CALL is the bitmap of blocks that contain a nonpure call. */ It turns out that the function never references ALWAYS_EXECUTED_IN, which is a little confusing. Instead it accesses the AUX field directly. Changed to using ALWAYS_EXECUTED_IN in all cases. Tested on i586-suse-linux, applied on the mainline as obvious. 2011-05-14 Eric Botcazou * tree-ssa-loop-im.c (SET_ALWAYS_EXECUTED_IN): New macro. (fill_always_executed_in): Use [SET_]ALWAYS_EXECUTED_IN. (tree_ssa_lim_finalize): Likewise. Index: tree-ssa-loop-im.c =================================================================== --- tree-ssa-loop-im.c (revision 173756) +++ tree-ssa-loop-im.c (working copy) @@ -197,9 +197,10 @@ static bool ref_indep_loop_p (struct loo /* Minimum cost of an expensive expression. */ #define LIM_EXPENSIVE ((unsigned) PARAM_VALUE (PARAM_LIM_EXPENSIVE)) -/* The outermost loop for that execution of the header guarantees that the +/* The outermost loop for which execution of the header guarantees that the block will be executed. */ #define ALWAYS_EXECUTED_IN(BB) ((struct loop *) (BB)->aux) +#define SET_ALWAYS_EXECUTED_IN(BB, VAL) ((BB)->aux = (void *) (VAL)) static struct lim_aux_data * init_lim_data (gimple stmt) @@ -2440,7 +2441,7 @@ fill_always_executed_in (struct loop *lo edge e; struct loop *inn_loop = loop; - if (!loop->header->aux) + if (ALWAYS_EXECUTED_IN (loop->header) == NULL) { bbs = get_loop_body_in_dom_order (loop); @@ -2482,7 +2483,7 @@ fill_always_executed_in (struct loop *lo while (1) { - last->aux = loop; + SET_ALWAYS_EXECUTED_IN (last, loop); if (last == loop->header) break; last = get_immediate_dominator (CDI_DOMINATORS, last); @@ -2537,9 +2538,7 @@ tree_ssa_lim_finalize (void) htab_t h; FOR_EACH_BB (bb) - { - bb->aux = NULL; - } + SET_ALWAYS_EXECUTED_IN (bb, NULL); pointer_map_destroy (lim_aux_data_map);