diff mbox

More improvements for the code generation of the if-conversion

Message ID AANLkTin30JepN6eK16GYd1pvAlrsuyVQqbFd5_unzztq@mail.gmail.com
State New
Headers show

Commit Message

Sebastian Pop June 25, 2010, 6:42 p.m. UTC
On Fri, Jun 25, 2010 at 09:48, Richard Guenther <rguenther@suse.de> 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
diff mbox

Patch

From ef28ff91f71fc5c62cc08d74cf93188aeec9ec08 Mon Sep 17 00:00:00 2001
From: Sebastian Pop <sebpop@gmail.com>
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  <sebastian.pop@amd.com>

	* 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  <sebastian.pop@amd.com>
 
+	* tree-if-conv.c (insert_gimplified_predicates): Do not insert
+	statements computing the true predicate.
+
+2010-06-25  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* 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