diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2010-05-26 16:47:08 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2010-05-26 16:47:08 +0000 |
commit | 4204425f00aab5563c6af03729c1ef379b706e0d (patch) | |
tree | 1e645c42d25ea3c1ff2a2be32630e1830f8f794c /gcc | |
parent | e1449456c0a88f5b3122db5452f7e91f5a9535f6 (diff) | |
download | gcc-4204425f00aab5563c6af03729c1ef379b706e0d.zip gcc-4204425f00aab5563c6af03729c1ef379b706e0d.tar.gz gcc-4204425f00aab5563c6af03729c1ef379b706e0d.tar.bz2 |
Do not check the if-convertibility of statements that are not predicated.
2010-05-26 Sebastian Pop <sebastian.pop@amd.com>
* tree-if-conv.c (if_convertible_gimple_assign_stmt_p): Do not
special case loop->header.
(is_predicated): New.
(if_convertible_loop_p): Call it.
From-SVN: r159887
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-if-conv.c | 21 |
2 files changed, 25 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed863df..31bc292 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2010-05-26 Sebastian Pop <sebastian.pop@amd.com> + * tree-if-conv.c (if_convertible_gimple_assign_stmt_p): Do not + special case loop->header. + (is_predicated): New. + (if_convertible_loop_p): Call it. + +2010-05-26 Sebastian Pop <sebastian.pop@amd.com> + * tree-if-conv.c (add_to_dst_predicate_list): Do not pass a statemet iterator in parameter. Do not generate code during the analysis. (tree_if_convert_cond_stmt): Removed. diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index da6b1cd..8dc1de6 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -274,9 +274,7 @@ if_convertible_gimple_assign_stmt_p (struct loop *loop, basic_block bb, return false; } - /* See if it needs speculative loading or not. */ - if (bb != loop->header - && gimple_assign_rhs_could_trap_p (stmt)) + if (gimple_assign_rhs_could_trap_p (stmt)) { if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "tree could trap...\n"); @@ -588,6 +586,19 @@ predicate_bbs (loop_p loop) return true; } +/* Returns true when BB has a predicate that is not trivial: true or + NULL_TREE. */ + +static bool +is_predicated (basic_block bb) +{ + tree cond = (tree) bb->aux; + + return (cond != NULL_TREE + && cond != boolean_true_node + && !integer_onep (cond)); +} + /* Return true when LOOP is if-convertible. LOOP is if-convertible if: - it is innermost, @@ -682,6 +693,10 @@ if_convertible_loop_p (struct loop *loop) basic_block bb = ifc_bbs[i]; gimple_stmt_iterator itr; + /* For non predicated BBs, don't check their statements. */ + if (!is_predicated (bb)) + continue; + 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; |