diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2010-06-25 18:38:04 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2010-06-25 18:38:04 +0000 |
commit | 0f741287d6f41e37052c58fdb2bb3eee9ab3cd79 (patch) | |
tree | 8bd609215852906cf6f10e0388fceab4848130c3 /gcc | |
parent | 53aa40a821dbbcf90426ddd25682bb91b9572079 (diff) | |
download | gcc-0f741287d6f41e37052c58fdb2bb3eee9ab3cd79.tar.gz |
Call cleanup_tree_cfg after if-conversion.
2010-06-25 Sebastian Pop <sebastian.pop@amd.com>
* tree-if-conv.c (combine_blocks): Remove FIXME comment.
(tree_if_conversion): Returns true when something has been changed.
(main_tree_if_conversion): Return TODO_cleanup_cfg when if-conversion
changed something.
From-SVN: r161396
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-if-conv.c | 17 |
2 files changed, 17 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7eb78084c09..b7fbcb99dcf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2010-06-25 Sebastian Pop <sebastian.pop@amd.com> + * tree-if-conv.c (combine_blocks): Remove FIXME comment. + (tree_if_conversion): Returns true when something has been changed. + (main_tree_if_conversion): Return TODO_cleanup_cfg when if-conversion + changed something. + +2010-06-25 Sebastian Pop <sebastian.pop@amd.com> + * Makefile.in (tree-if-conv.o): Depends on DBGCNT_H. * dbgcnt.def (if_conversion_tree): New DEBUG_COUNTER. * tree-if-conv.c: Include dbgcnt.h. diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index b7fe749c419..f200d480b59 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -1162,9 +1162,7 @@ combine_blocks (struct loop *loop) /* If possible, merge loop header to the block with the exit edge. This reduces the number of basic blocks to two, to please the - vectorizer that handles only loops with two nodes. - - FIXME: Call cleanup_tree_cfg. */ + vectorizer that handles only loops with two nodes. */ if (exit_bb && exit_bb != loop->header && can_merge_blocks_p (loop->header, exit_bb)) @@ -1172,11 +1170,12 @@ combine_blocks (struct loop *loop) } /* If-convert LOOP when it is legal. For the moment this pass has no - profitability analysis. */ + profitability analysis. Returns true when something changed. */ -static void +static bool tree_if_conversion (struct loop *loop) { + bool changed = false; ifc_bbs = NULL; if (!if_convertible_loop_p (loop) @@ -1187,6 +1186,7 @@ tree_if_conversion (struct loop *loop) blocks into one huge basic block doing the if-conversion on-the-fly. */ combine_blocks (loop); + changed = true; cleanup: if (ifc_bbs) @@ -1199,6 +1199,8 @@ tree_if_conversion (struct loop *loop) free (ifc_bbs); ifc_bbs = NULL; } + + return changed; } /* Tree if-conversion pass management. */ @@ -1208,14 +1210,15 @@ main_tree_if_conversion (void) { loop_iterator li; struct loop *loop; + bool changed = false; if (number_of_loops () <= 1) return 0; FOR_EACH_LOOP (li, loop, 0) - tree_if_conversion (loop); + changed |= tree_if_conversion (loop); - return 0; + return changed ? TODO_cleanup_cfg : 0; } static bool |