Commit 0ecf0d5f by Devang Patel Committed by Devang Patel

tree-if-conv.c (process_phi_nodes): Process latch block.

       * tree-if-conv.c (process_phi_nodes): Process latch block.
       (combine_blocks): Process latch block and update loop structure.

       * gcc.dg/pr17635.c : New test.

From-SVN: r89045
parent 1399eca1
2004-10-14 Devang Patel <dpatel@apple.com>
PR 17635
* tree-if-conv.c (process_phi_nodes): Process latch block.
(combine_blocks): Process latch block and update loop structure.
2004-10-14 Olga Golovanevsky <olga@il.ibm.com> 2004-10-14 Olga Golovanevsky <olga@il.ibm.com>
* tree-vectorizer.c (vect_generate_tmps_on_preheader): * tree-vectorizer.c (vect_generate_tmps_on_preheader):
......
2004-10-14 Devang Patel <dpatel@apple.com>
PR 17635
* gcc.dg/pr17635.c : New test.
2004-10-14 Olga GOlovanevsky <olga@il.ibm.com> 2004-10-14 Olga GOlovanevsky <olga@il.ibm.com>
* testsuite/gcc.dg/vect/vect-28.c : Remove xfail. * testsuite/gcc.dg/vect/vect-28.c : Remove xfail.
......
...@@ -815,7 +815,7 @@ process_phi_nodes (struct loop *loop) ...@@ -815,7 +815,7 @@ process_phi_nodes (struct loop *loop)
basic_block true_bb = NULL; basic_block true_bb = NULL;
bb = ifc_bbs[i]; bb = ifc_bbs[i];
if (bb == loop->header || bb == loop->latch) if (bb == loop->header)
continue; continue;
phi = phi_nodes (bb); phi = phi_nodes (bb);
...@@ -863,9 +863,6 @@ combine_blocks (struct loop *loop) ...@@ -863,9 +863,6 @@ combine_blocks (struct loop *loop)
bb = ifc_bbs[i]; bb = ifc_bbs[i];
if (bb == loop->latch)
continue;
if (!exit_bb && bb_with_exit_edge_p (bb)) if (!exit_bb && bb_with_exit_edge_p (bb))
exit_bb = bb; exit_bb = bb;
...@@ -891,6 +888,9 @@ combine_blocks (struct loop *loop) ...@@ -891,6 +888,9 @@ combine_blocks (struct loop *loop)
continue; continue;
} }
if (bb == loop->latch && empty_block_p (bb))
continue;
/* It is time to remove this basic block. First remove edges. */ /* It is time to remove this basic block. First remove edges. */
while (EDGE_COUNT (bb->succs) > 0) while (EDGE_COUNT (bb->succs) > 0)
ssa_remove_edge (EDGE_SUCC (bb, 0)); ssa_remove_edge (EDGE_SUCC (bb, 0));
...@@ -921,6 +921,8 @@ combine_blocks (struct loop *loop) ...@@ -921,6 +921,8 @@ combine_blocks (struct loop *loop)
delete_from_dominance_info (CDI_POST_DOMINATORS, bb); delete_from_dominance_info (CDI_POST_DOMINATORS, bb);
/* Remove basic block. */ /* Remove basic block. */
if (bb == loop->latch)
loop->latch = merge_target_bb;
remove_bb_from_loops (bb); remove_bb_from_loops (bb);
expunge_block (bb); expunge_block (bb);
} }
...@@ -928,7 +930,10 @@ combine_blocks (struct loop *loop) ...@@ -928,7 +930,10 @@ combine_blocks (struct loop *loop)
/* Now if possible, merge loop header and block with exit edge. /* Now if possible, merge loop header and block with exit edge.
This reduces number of basic blocks to 2. Auto vectorizer addresses This reduces number of basic blocks to 2. Auto vectorizer addresses
loops with two nodes only. FIXME: Use cleanup_tree_cfg(). */ loops with two nodes only. FIXME: Use cleanup_tree_cfg(). */
if (exit_bb != loop->latch && empty_block_p (loop->latch)) if (exit_bb
&& loop->header != loop->latch
&& exit_bb != loop->latch
&& empty_block_p (loop->latch))
{ {
if (can_merge_blocks_p (loop->header, exit_bb)) if (can_merge_blocks_p (loop->header, exit_bb))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment