Commit 9ef8069a by Andrew Pinski Committed by Andrew Pinski

ifcvt.c (find_if_block): Move the check for the number of edges above the loops…

ifcvt.c (find_if_block): Move the check for the number of edges above the loops checking for complex edges.

2004-11-18  Andrew Pinski  <pinskia@physics.uc.edu>

        * ifcvt.c (find_if_block): Move the check for the number of edges
        above the loops checking for complex edges.
        Remove the counting of edges as we use EDGE_COUNT now.

From-SVN: r90865
parent 3afb0820
2004-11-18 Andrew Pinski <pinskia@physics.uc.edu>
* ifcvt.c (find_if_block): Move the check for the number of edges
above the loops checking for complex edges.
Remove the counting of edges as we use EDGE_COUNT now.
2004-11-18 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.comn> 2004-11-18 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.comn>
* config/m32r/linux.h (TARGET_ASM_FILE_END): Set * config/m32r/linux.h (TARGET_ASM_FILE_END): Set
......
...@@ -2445,8 +2445,6 @@ find_if_block (struct ce_if_block * ce_info) ...@@ -2445,8 +2445,6 @@ find_if_block (struct ce_if_block * ce_info)
basic_block then_bb = ce_info->then_bb; basic_block then_bb = ce_info->then_bb;
basic_block else_bb = ce_info->else_bb; basic_block else_bb = ce_info->else_bb;
basic_block join_bb = NULL_BLOCK; basic_block join_bb = NULL_BLOCK;
int then_predecessors;
int else_predecessors;
edge cur_edge; edge cur_edge;
basic_block next; basic_block next;
edge_iterator ei; edge_iterator ei;
...@@ -2511,28 +2509,24 @@ find_if_block (struct ce_if_block * ce_info) ...@@ -2511,28 +2509,24 @@ find_if_block (struct ce_if_block * ce_info)
} }
} }
/* Count the number of edges the THEN and ELSE blocks have. */ /* The THEN block of an IF-THEN combo must have exactly one predecessor,
then_predecessors = 0; other than any || blocks which jump to the THEN block. */
if ((EDGE_COUNT (then_bb->preds) - ce_info->num_or_or_blocks) != 1)
return FALSE;
/* The edges of the THEN and ELSE blocks cannot have complex edges. */
FOR_EACH_EDGE (cur_edge, ei, then_bb->preds) FOR_EACH_EDGE (cur_edge, ei, then_bb->preds)
{ {
then_predecessors++;
if (cur_edge->flags & EDGE_COMPLEX) if (cur_edge->flags & EDGE_COMPLEX)
return FALSE; return FALSE;
} }
else_predecessors = 0;
FOR_EACH_EDGE (cur_edge, ei, else_bb->preds) FOR_EACH_EDGE (cur_edge, ei, else_bb->preds)
{ {
else_predecessors++;
if (cur_edge->flags & EDGE_COMPLEX) if (cur_edge->flags & EDGE_COMPLEX)
return FALSE; return FALSE;
} }
/* The THEN block of an IF-THEN combo must have exactly one predecessor,
other than any || blocks which jump to the THEN block. */
if ((then_predecessors - ce_info->num_or_or_blocks) != 1)
return FALSE;
/* The THEN block of an IF-THEN combo must have zero or one successors. */ /* The THEN block of an IF-THEN combo must have zero or one successors. */
if (EDGE_COUNT (then_bb->succs) > 0 if (EDGE_COUNT (then_bb->succs) > 0
&& (EDGE_COUNT (then_bb->succs) > 1 && (EDGE_COUNT (then_bb->succs) > 1
......
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