From patchwork Fri Jun 25 18:42:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 56954 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 EBC07B6EEF for ; Sat, 26 Jun 2010 04:43:15 +1000 (EST) Received: (qmail 27344 invoked by alias); 25 Jun 2010 18:43:11 -0000 Received: (qmail 27325 invoked by uid 22791); 25 Jun 2010 18:43:07 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_DB, TW_TM X-Spam-Check-By: sourceware.org Received: from mail-vw0-f47.google.com (HELO mail-vw0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Jun 2010 18:43:01 +0000 Received: by vws19 with SMTP id 19so2959892vws.20 for ; Fri, 25 Jun 2010 11:42:59 -0700 (PDT) Received: by 10.224.88.220 with SMTP id b28mr930037qam.91.1277491379192; Fri, 25 Jun 2010 11:42:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.74.18 with HTTP; Fri, 25 Jun 2010 11:42:28 -0700 (PDT) In-Reply-To: References: From: Sebastian Pop Date: Fri, 25 Jun 2010 13:42:28 -0500 Message-ID: Subject: Re: [patch] More improvements for the code generation of the if-conversion To: Richard Guenther Cc: GCC Patches X-IsSubscribed: yes 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 On Fri, Jun 25, 2010 at 09:48, Richard Guenther wrote: >> 0001 adds a debug counter, useful to reduce code generation problems >> due to the tree-if-conversion pass. > > Ok. > Committed r161395. >> 0002 calls the cleanup_tree_cfg after if-conversion to ensure that the >> CFG representation passed to the vectorizer is in good shape. > > Instead of > > +  if (changed) > +    cleanup_tree_cfg (); > >   return 0; >  } > > do > >   return changed ? TODO_cleanup_cfg : 0; > > ok with that change. > Committed r161396. >> 0006 uses a single function reset_bb_predicate to reset the predicate >> of a BB to true.  This function has to release all the SSA_NAMEs used >> in the gimplification of a predicate. > > Ok. > Committed r161397. >> 0007 avoids the generation of code computing the true predicate, that >> occurs for all the BBs merging disjunct predicates leading to the true >> predicate. > > Ok. > Committed r161398. The attached patches are the ones that I committed to trunk. These patches passed regstrap on amd64-linux. Sebastian Pop --- AMD / Open Source Compiler Engineering / GNU Tools From ef28ff91f71fc5c62cc08d74cf93188aeec9ec08 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Fri, 25 Jun 2010 11:09:00 -0500 Subject: [PATCH 4/4] Do not insert statements computing the true predicate. 2010-06-25 Sebastian Pop * tree-if-conv.c (insert_gimplified_predicates): Do not insert statements computing the true predicate. --- gcc/ChangeLog | 5 +++++ gcc/tree-if-conv.c | 9 +++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0e9bd83..34afcc1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2010-06-25 Sebastian Pop + * tree-if-conv.c (insert_gimplified_predicates): Do not insert + statements computing the true predicate. + +2010-06-25 Sebastian Pop + * tree-if-conv.c (init_bb_predicate): Initialize the predicate to boolean_true_node. (reset_bb_predicate): New. diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 80a53a8..8d5d226 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -1021,6 +1021,15 @@ insert_gimplified_predicates (loop_p loop) basic_block bb = ifc_bbs[i]; gimple_seq stmts = bb_predicate_gimplified_stmts (bb); + if (!is_predicated (bb)) + { + /* Do not insert statements for a basic block that is not + predicated. Also make sure that the predicate of the + basic block is set to true. */ + reset_bb_predicate (bb); + continue; + } + if (stmts) { gimple_stmt_iterator gsi = gsi_last_bb (bb); -- 1.7.0.4