aboutsummaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorZdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>2002-05-28 14:53:47 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2002-05-28 12:53:47 +0000
commitbf77398cef20e7f1d079bb8b76d383c4ca163165 (patch)
treee6c0737229b9c2c57cf0353f3dd15ebecc686b75 /gcc/ifcvt.c
parentae12a094d64ceac6fa406c67f1e38e59bdfd95c9 (diff)
downloadgcc-bf77398cef20e7f1d079bb8b76d383c4ca163165.zip
gcc-bf77398cef20e7f1d079bb8b76d383c4ca163165.tar.gz
gcc-bf77398cef20e7f1d079bb8b76d383c4ca163165.tar.bz2
basic-block.h (last_basic_block): Declare.
* basic-block.h (last_basic_block): Declare. (expunge_block_nocompact): Declaration removed. (compact_blocks): Declare. * cfg.c (last_basic_block): New variable. (expunge_block_nocompact): Removed. (expunge_block): Do not compact basic blocks. (compact_blocks): New. * cfganal.c (flow_call_edges_add): Use the fact that bb indices no longer change. * cfgbuild.c (find_basic_blocks_1, find_basic_blocks): Set last_basic_block. * cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Do not change real positions of blocks. (delete_unreachable_blocks): Simplified -- quadratic behavior now cannot occur. (cleanup_cfg): Compact blocks. * cfgrtl.c (create_basic_block): Insert basic blocks to the end of basic_block_info varray. (flow_delete_block): Comment update. (back_edge_of_syntactic_loop_p): Modify position check code. (verify_flow_info): Update checking. * flow.c (calculate_global_regs_live): Use FOR_EACH_BB. * ifcvt.c (SET_ORIG_INDEX, ORIG_INDEX): Removed. (find_if_case_1, find_if_case_2, if_convert): Use the fact that bb indices no longer change. * lcm.c (optimize_mode_switching): Replace n_basic_blocks with last_basic_block. * predict.c (estimate_bb_frequencies): Remove unneccessary code. * profile.c (branch_prob): Compact blocks. * sched-rgn.c (find_rgns): Replace n_basic_blocks with last_basic_block. From-SVN: r53957
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index b444f3b..4ed1494 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -111,14 +111,6 @@ static int dead_or_predicable PARAMS ((basic_block, basic_block,
basic_block, basic_block, int));
static void noce_emit_move_insn PARAMS ((rtx, rtx));
-/* Abuse the basic_block AUX field to store the original block index,
- as well as a flag indicating that the block should be rescaned for
- life analysis. */
-
-#define SET_ORIG_INDEX(BB,I) ((BB)->aux = (void *)((size_t)(I)))
-#define ORIG_INDEX(BB) ((size_t)(BB)->aux)
-
-
/* Count the number of non-jump active insns in BB. */
static int
@@ -2279,6 +2271,7 @@ find_if_case_1 (test_bb, then_edge, else_edge)
basic_block then_bb = then_edge->dest;
basic_block else_bb = else_edge->dest, new_bb;
edge then_succ = then_bb->succ;
+ int then_bb_index;
/* THEN has one successor. */
if (!then_succ || then_succ->succ_next != NULL)
@@ -2319,11 +2312,15 @@ find_if_case_1 (test_bb, then_edge, else_edge)
then_bb->global_live_at_end, BITMAP_IOR);
new_bb = redirect_edge_and_branch_force (FALLTHRU_EDGE (test_bb), else_bb);
+ then_bb_index = then_bb->index;
+ flow_delete_block (then_bb);
/* Make rest of code believe that the newly created block is the THEN_BB
- block we are going to remove. */
+ block we removed. */
if (new_bb)
- new_bb->aux = then_bb->aux;
- flow_delete_block (then_bb);
+ {
+ new_bb->index = then_bb_index;
+ BASIC_BLOCK (then_bb_index) = new_bb;
+ }
/* We've possibly created jump to next insn, cleanup_cfg will solve that
later. */
@@ -2366,8 +2363,8 @@ find_if_case_2 (test_bb, then_edge, else_edge)
if (note && INTVAL (XEXP (note, 0)) >= REG_BR_PROB_BASE / 2)
;
else if (else_succ->dest->index < 0
- || TEST_BIT (post_dominators[ORIG_INDEX (then_bb)],
- ORIG_INDEX (else_succ->dest)))
+ || TEST_BIT (post_dominators[then_bb->index],
+ else_succ->dest->index))
;
else
return FALSE;
@@ -2706,10 +2703,6 @@ if_convert (x_life_data_ok)
if (life_data_ok)
clear_bb_flags ();
- /* Record initial block numbers. */
- FOR_EACH_BB (bb)
- SET_ORIG_INDEX (bb, bb->index);
-
/* Go through each of the basic blocks looking for things to convert. */
FOR_EACH_BB (bb)
while (find_if_header (bb))