summaryrefslogtreecommitdiff
path: root/gcc/bt-load.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-04 17:57:29 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-04 17:57:29 +0000
commit48ff1d417d4c49525c09b013395e38dda8bd50fe (patch)
treeffb4ea05f14bc936b5dd3681e19b2aa3cee8c3bf /gcc/bt-load.c
parent144409bbbdb293946cea105115e0e329f633d333 (diff)
downloadgcc-48ff1d417d4c49525c09b013395e38dda8bd50fe.tar.gz
2014-01-04 Basile Starynkevitch <basile@starynkevitch.net>
{{merge using svnmerge.py with trunk GCC 4.9 svn rev206333 now in stage 3; very unstable, xtramelt-ana-base don't compile anymore...}} git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@206336 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bt-load.c')
-rw-r--r--gcc/bt-load.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/gcc/bt-load.c b/gcc/bt-load.c
index 09eea06e379..4fa68f11e98 100644
--- a/gcc/bt-load.c
+++ b/gcc/bt-load.c
@@ -1,6 +1,6 @@
/* Perform branch target register load optimizations.
- Copyright (C) 2001-2013 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of GCC.
@@ -457,10 +457,10 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array,
btr_def_group all_btr_def_groups = NULL;
defs_uses_info info;
- bitmap_vector_clear (bb_gen, last_basic_block);
- for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
+ bitmap_vector_clear (bb_gen, last_basic_block_for_fn (cfun));
+ for (i = NUM_FIXED_BLOCKS; i < last_basic_block_for_fn (cfun); i++)
{
- basic_block bb = BASIC_BLOCK (i);
+ basic_block bb = BASIC_BLOCK_FOR_FN (cfun, i);
int reg;
btr_def defs_this_bb = NULL;
rtx insn;
@@ -618,8 +618,8 @@ compute_kill (sbitmap *bb_kill, sbitmap *btr_defset,
/* For each basic block, form the set BB_KILL - the set
of definitions that the block kills. */
- bitmap_vector_clear (bb_kill, last_basic_block);
- for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
+ bitmap_vector_clear (bb_kill, last_basic_block_for_fn (cfun));
+ for (i = NUM_FIXED_BLOCKS; i < last_basic_block_for_fn (cfun); i++)
{
for (regno = first_btr; regno <= last_btr; regno++)
if (TEST_HARD_REG_BIT (all_btrs, regno)
@@ -642,16 +642,16 @@ compute_out (sbitmap *bb_out, sbitmap *bb_gen, sbitmap *bb_kill, int max_uid)
int changed;
sbitmap bb_in = sbitmap_alloc (max_uid);
- for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
+ for (i = NUM_FIXED_BLOCKS; i < last_basic_block_for_fn (cfun); i++)
bitmap_copy (bb_out[i], bb_gen[i]);
changed = 1;
while (changed)
{
changed = 0;
- for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
+ for (i = NUM_FIXED_BLOCKS; i < last_basic_block_for_fn (cfun); i++)
{
- bitmap_union_of_preds (bb_in, bb_out, BASIC_BLOCK (i));
+ bitmap_union_of_preds (bb_in, bb_out, BASIC_BLOCK_FOR_FN (cfun, i));
changed |= bitmap_ior_and_compl (bb_out[i], bb_gen[i],
bb_in, bb_kill[i]);
}
@@ -668,13 +668,13 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out,
/* Link uses to the uses lists of all of their reaching defs.
Count up the number of reaching defs of each use. */
- for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
+ for (i = NUM_FIXED_BLOCKS; i < last_basic_block_for_fn (cfun); i++)
{
- basic_block bb = BASIC_BLOCK (i);
+ basic_block bb = BASIC_BLOCK_FOR_FN (cfun, i);
rtx insn;
rtx last;
- bitmap_union_of_preds (reaching_defs, bb_out, BASIC_BLOCK (i));
+ bitmap_union_of_preds (reaching_defs, bb_out, BASIC_BLOCK_FOR_FN (cfun, i));
for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb));
insn != last;
insn = NEXT_INSN (insn))
@@ -780,8 +780,10 @@ build_btr_def_use_webs (fibheap_t all_btr_defs)
btr_user *use_array = XCNEWVEC (btr_user, max_uid);
sbitmap *btr_defset = sbitmap_vector_alloc (
(last_btr - first_btr) + 1, max_uid);
- sbitmap *bb_gen = sbitmap_vector_alloc (last_basic_block, max_uid);
- HARD_REG_SET *btrs_written = XCNEWVEC (HARD_REG_SET, last_basic_block);
+ sbitmap *bb_gen = sbitmap_vector_alloc (last_basic_block_for_fn (cfun),
+ max_uid);
+ HARD_REG_SET *btrs_written = XCNEWVEC (HARD_REG_SET,
+ last_basic_block_for_fn (cfun));
sbitmap *bb_kill;
sbitmap *bb_out;
@@ -790,11 +792,11 @@ build_btr_def_use_webs (fibheap_t all_btr_defs)
compute_defs_uses_and_gen (all_btr_defs, def_array, use_array, btr_defset,
bb_gen, btrs_written);
- bb_kill = sbitmap_vector_alloc (last_basic_block, max_uid);
+ bb_kill = sbitmap_vector_alloc (last_basic_block_for_fn (cfun), max_uid);
compute_kill (bb_kill, btr_defset, btrs_written);
free (btrs_written);
- bb_out = sbitmap_vector_alloc (last_basic_block, max_uid);
+ bb_out = sbitmap_vector_alloc (last_basic_block_for_fn (cfun), max_uid);
compute_out (bb_out, bb_gen, bb_kill, max_uid);
sbitmap_vector_free (bb_gen);
@@ -814,13 +816,14 @@ build_btr_def_use_webs (fibheap_t all_btr_defs)
static int
block_at_edge_of_live_range_p (int bb, btr_def def)
{
- if (def->other_btr_uses_before_def && BASIC_BLOCK (bb) == def->bb)
+ if (def->other_btr_uses_before_def
+ && BASIC_BLOCK_FOR_FN (cfun, bb) == def->bb)
return 1;
else if (def->other_btr_uses_after_use)
{
btr_user user;
for (user = def->uses; user != NULL; user = user->next)
- if (BASIC_BLOCK (bb) == user->bb)
+ if (BASIC_BLOCK_FOR_FN (cfun, bb) == user->bb)
return 1;
}
return 0;
@@ -1404,9 +1407,9 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save)
{
int i;
- for (i = NUM_FIXED_BLOCKS; i < last_basic_block; i++)
+ for (i = NUM_FIXED_BLOCKS; i < last_basic_block_for_fn (cfun); i++)
{
- basic_block bb = BASIC_BLOCK (i);
+ basic_block bb = BASIC_BLOCK_FOR_FN (cfun, i);
fprintf (dump_file,
"Basic block %d: count = " HOST_WIDEST_INT_PRINT_DEC
" loop-depth = %d idom = %d\n",
@@ -1427,8 +1430,8 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save)
first_btr = reg;
}
- btrs_live = XCNEWVEC (HARD_REG_SET, last_basic_block);
- btrs_live_at_end = XCNEWVEC (HARD_REG_SET, last_basic_block);
+ btrs_live = XCNEWVEC (HARD_REG_SET, last_basic_block_for_fn (cfun));
+ btrs_live_at_end = XCNEWVEC (HARD_REG_SET, last_basic_block_for_fn (cfun));
build_btr_def_use_webs (all_btr_defs);