This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Cleanup and improvement of if-conversion for vectorization
On Thu, May 27, 2010 at 08:28, Richard Guenther <rguenther@suse.de> wrote:
>> > I changed the comment as you proposed, and I committed the 8 approved
>> > patches to trunk.
>>
>> Caused
>>
>> FAIL: gcc.c-torture/compile/20040304-1.c ?-O3 -fomit-frame-pointer
Sorry for having missed to see these.
It looks to me that the last patch 0008 is the cause of this problem:
for non predicated BBs we still have to check the if-convertibility of
their phi nodes. The attached patch fixes these problems. I will
regstrap on amd64-linux. Ok for trunk?
> Also
>
> ?token_21 = [cond_expr] rest_args_16 == 0 ? token_15 : token_15;
>
> looks odd - that's simple token_21 = token_15. ?Please check
> for degenerate PHIs(?).
Is there a function that determines degenerate phis?
Thanks,
Sebastian
From 91e6fb05c7c7c82f688f7980d4418391f203c2cc Mon Sep 17 00:00:00 2001
From: Sebastian Pop <sebpop@gmail.com>
Date: Thu, 27 May 2010 09:25:07 -0500
Subject: [PATCH] Check the if-convertibility of phi nodes in non predicated BBs.
---
gcc/tree-if-conv.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 8dc1de6..c338ecb 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -693,6 +693,10 @@ if_convertible_loop_p (struct loop *loop)
basic_block bb = ifc_bbs[i];
gimple_stmt_iterator itr;
+ for (itr = gsi_start_phis (bb); !gsi_end_p (itr); gsi_next (&itr))
+ if (!if_convertible_phi_p (loop, bb, gsi_stmt (itr)))
+ return false;
+
/* For non predicated BBs, don't check their statements. */
if (!is_predicated (bb))
continue;
@@ -700,10 +704,6 @@ if_convertible_loop_p (struct loop *loop)
for (itr = gsi_start_bb (bb); !gsi_end_p (itr); gsi_next (&itr))
if (!if_convertible_stmt_p (loop, bb, gsi_stmt (itr)))
return false;
-
- for (itr = gsi_start_phis (bb); !gsi_end_p (itr); gsi_next (&itr))
- if (!if_convertible_phi_p (loop, bb, gsi_stmt (itr)))
- return false;
}
if (dump_file)
--
1.7.0.4