summaryrefslogtreecommitdiff
path: root/gcc/df-problems.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/df-problems.c')
-rw-r--r--gcc/df-problems.c757
1 files changed, 35 insertions, 722 deletions
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index 9ae57d12e2f..dd56399be50 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -71,9 +71,7 @@ df_get_live_out (basic_block bb)
{
gcc_assert (df_lr);
- if (df_urec)
- return DF_RA_LIVE_OUT (bb);
- else if (df_live)
+ if (df_live)
return DF_LIVE_OUT (bb);
else
return DF_LR_OUT (bb);
@@ -89,31 +87,12 @@ df_get_live_in (basic_block bb)
{
gcc_assert (df_lr);
- if (df_urec)
- return DF_RA_LIVE_IN (bb);
- else if (df_live)
+ if (df_live)
return DF_LIVE_IN (bb);
else
return DF_LR_IN (bb);
}
-/* Get the live at top set for BB no matter what problem happens to be
- defined. This function is used by the register allocators who
- choose different dataflow problems depending on the optimization
- level. */
-
-bitmap
-df_get_live_top (basic_block bb)
-{
- gcc_assert (df_lr);
-
- if (df_urec)
- return DF_RA_LIVE_TOP (bb);
- else
- return DF_LR_TOP (bb);
-}
-
-
/*----------------------------------------------------------------------------
Utility functions.
----------------------------------------------------------------------------*/
@@ -210,9 +189,28 @@ df_unset_seen (void)
See df.h for details.
----------------------------------------------------------------------------*/
-/* See the comment at the top of the Reaching Uses problem for how the
- uses are represented in the kill sets. The same games are played
- here for the defs. */
+/* This problem plays a large number of games for the sake of
+ efficiency.
+
+ 1) The order of the bits in the bitvectors. After the scanning
+ phase, all of the defs are sorted. All of the defs for the reg 0
+ are first, followed by all defs for reg 1 and so on.
+
+ 2) There are two kill sets, one if the number of defs is less or
+ equal to DF_SPARSE_THRESHOLD and another if the number of defs is
+ greater.
+
+ <= : Data is built directly in the kill set.
+
+ > : One level of indirection is used to keep from generating long
+ strings of 1 bits in the kill sets. Bitvectors that are indexed
+ by the regnum are used to represent that there is a killing def
+ for the register. The confluence and transfer functions use
+ these along with the bitmap_clear_range call to remove ranges of
+ bits without actually generating a knockout vector.
+
+ The kill and sparse_kill and the dense_invalidated_by_call and
+ sparse_invalidated_by_call both play this game. */
/* Private data used to compute the solution for this problem. These
data structures are not accessible outside of this module. */
@@ -740,14 +738,6 @@ df_lr_free_bb_info (basic_block bb ATTRIBUTE_UNUSED,
{
BITMAP_FREE (bb_info->use);
BITMAP_FREE (bb_info->def);
- if (bb_info->in == bb_info->top)
- bb_info->top = NULL;
- else
- {
- BITMAP_FREE (bb_info->top);
- BITMAP_FREE (bb_info->ause);
- BITMAP_FREE (bb_info->adef);
- }
BITMAP_FREE (bb_info->in);
BITMAP_FREE (bb_info->out);
pool_free (df_lr->block_pool, bb_info);
@@ -777,11 +767,6 @@ df_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
{
bitmap_clear (bb_info->def);
bitmap_clear (bb_info->use);
- if (bb_info->adef)
- {
- bitmap_clear (bb_info->adef);
- bitmap_clear (bb_info->ause);
- }
}
else
{
@@ -791,9 +776,6 @@ df_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
bb_info->def = BITMAP_ALLOC (NULL);
bb_info->in = BITMAP_ALLOC (NULL);
bb_info->out = BITMAP_ALLOC (NULL);
- bb_info->top = bb_info->in;
- bb_info->adef = NULL;
- bb_info->ause = NULL;
}
}
@@ -815,7 +797,6 @@ df_lr_reset (bitmap all_blocks)
gcc_assert (bb_info);
bitmap_clear (bb_info->in);
bitmap_clear (bb_info->out);
- bitmap_clear (bb_info->top);
}
}
@@ -879,23 +860,18 @@ df_lr_bb_local_compute (unsigned int bb_index)
bitmap_set_bit (bb_info->use, DF_REF_REGNO (use));
}
}
- /* Process the registers set in an exception handler. */
+
+ /* Process the registers set in an exception handler or the hard
+ frame pointer if this block is the target of a non local
+ goto. */
for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
{
struct df_ref *def = *def_rec;
- if ((DF_REF_FLAGS (def) & DF_REF_AT_TOP)
- && (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL))))
+ if (DF_REF_FLAGS (def) & DF_REF_AT_TOP)
{
unsigned int dregno = DF_REF_REGNO (def);
- if (bb_info->adef == NULL)
- {
- gcc_assert (bb_info->ause == NULL);
- gcc_assert (bb_info->top == bb_info->in);
- bb_info->adef = BITMAP_ALLOC (NULL);
- bb_info->ause = BITMAP_ALLOC (NULL);
- bb_info->top = BITMAP_ALLOC (NULL);
- }
- bitmap_set_bit (bb_info->adef, dregno);
+ bitmap_set_bit (bb_info->def, dregno);
+ bitmap_clear_bit (bb_info->use, dregno);
}
}
@@ -906,17 +882,7 @@ df_lr_bb_local_compute (unsigned int bb_index)
struct df_ref *use = *use_rec;
/* Add use to set of uses in this BB. */
if (DF_REF_FLAGS (use) & DF_REF_AT_TOP)
- {
- if (bb_info->adef == NULL)
- {
- gcc_assert (bb_info->ause == NULL);
- gcc_assert (bb_info->top == bb_info->in);
- bb_info->adef = BITMAP_ALLOC (NULL);
- bb_info->ause = BITMAP_ALLOC (NULL);
- bb_info->top = BITMAP_ALLOC (NULL);
- }
- bitmap_set_bit (bb_info->ause, DF_REF_REGNO (use));
- }
+ bitmap_set_bit (bb_info->use, DF_REF_REGNO (use));
}
#endif
@@ -1041,19 +1007,8 @@ df_lr_transfer_function (int bb_index)
bitmap out = bb_info->out;
bitmap use = bb_info->use;
bitmap def = bb_info->def;
- bitmap top = bb_info->top;
- bitmap ause = bb_info->ause;
- bitmap adef = bb_info->adef;
- bool changed;
-
- changed = bitmap_ior_and_compl (top, use, out, def);
- if (in != top)
- {
- gcc_assert (ause && adef);
- changed |= bitmap_ior_and_compl (in, ause, top, adef);
- }
- return changed;
+ return bitmap_ior_and_compl (in, use, out, def);
}
@@ -1097,14 +1052,6 @@ df_lr_free (void)
{
BITMAP_FREE (bb_info->use);
BITMAP_FREE (bb_info->def);
- if (bb_info->in == bb_info->top)
- bb_info->top = NULL;
- else
- {
- BITMAP_FREE (bb_info->top);
- BITMAP_FREE (bb_info->ause);
- BITMAP_FREE (bb_info->adef);
- }
BITMAP_FREE (bb_info->in);
BITMAP_FREE (bb_info->out);
}
@@ -1297,7 +1244,6 @@ df_lr_verify_transfer_functions (void)
bitmap saved_adef;
bitmap saved_ause;
bitmap all_blocks;
- bool need_as;
if (!df)
return;
@@ -1326,33 +1272,9 @@ df_lr_verify_transfer_functions (void)
bitmap_clear (bb_info->def);
bitmap_clear (bb_info->use);
- if (bb_info->adef)
- {
- need_as = true;
- bitmap_copy (saved_adef, bb_info->adef);
- bitmap_copy (saved_ause, bb_info->ause);
- bitmap_clear (bb_info->adef);
- bitmap_clear (bb_info->ause);
- }
- else
- need_as = false;
-
df_lr_bb_local_compute (bb->index);
gcc_assert (bitmap_equal_p (saved_def, bb_info->def));
gcc_assert (bitmap_equal_p (saved_use, bb_info->use));
-
- if (need_as)
- {
- gcc_assert (bb_info->adef);
- gcc_assert (bb_info->ause);
- gcc_assert (bitmap_equal_p (saved_adef, bb_info->adef));
- gcc_assert (bitmap_equal_p (saved_ause, bb_info->ause));
- }
- else
- {
- gcc_assert (!bb_info->adef);
- gcc_assert (!bb_info->ause);
- }
}
}
else
@@ -1633,7 +1555,7 @@ df_live_local_finalize (bitmap all_blocks)
{
struct df_lr_bb_info *bb_lr_info = df_lr_get_bb_info (bb_index);
struct df_live_bb_info *bb_live_info = df_live_get_bb_info (bb_index);
-
+
/* No register may reach a location where it is not used. Thus
we trim the rr result to the places where it is used. */
bitmap_and_into (bb_live_info->in, bb_lr_info->in);
@@ -1913,615 +1835,6 @@ df_live_verify_transfer_functions (void)
BITMAP_FREE (saved_kill);
BITMAP_FREE (all_blocks);
}
-
-
-
-/*----------------------------------------------------------------------------
- UNINITIALIZED REGISTERS WITH EARLYCLOBBER
-
- Find the set of uses for registers that are reachable from the entry
- block without passing thru a definition. In and out bitvectors are built
- for each basic block. The regnum is used to index into these sets.
- See df.h for details.
-
- This is a variant of the UR problem above that has a lot of special
- features just for the register allocation phase. This problem
- should go away if someone would fix the interference graph.
-
- ----------------------------------------------------------------------------*/
-
-/* Private data used to compute the solution for this problem. These
- data structures are not accessible outside of this module. */
-struct df_urec_problem_data
-{
- bool earlyclobbers_found; /* True if any instruction contains an
- earlyclobber. */
-#ifdef STACK_REGS
- bitmap stack_regs; /* Registers that may be allocated to a STACK_REGS. */
-#endif
-};
-
-
-/* Set basic block info. */
-
-static void
-df_urec_set_bb_info (unsigned int index,
- struct df_urec_bb_info *bb_info)
-{
- gcc_assert (df_urec);
- gcc_assert (index < df_urec->block_info_size);
- df_urec->block_info[index] = bb_info;
-}
-
-
-/* Free basic block info. */
-
-static void
-df_urec_free_bb_info (basic_block bb ATTRIBUTE_UNUSED,
- void *vbb_info)
-{
- struct df_urec_bb_info *bb_info = (struct df_urec_bb_info *) vbb_info;
- if (bb_info)
- {
- BITMAP_FREE (bb_info->gen);
- BITMAP_FREE (bb_info->kill);
- BITMAP_FREE (bb_info->in);
- BITMAP_FREE (bb_info->out);
- BITMAP_FREE (bb_info->earlyclobber);
- pool_free (df_urec->block_pool, bb_info);
- }
-}
-
-
-/* Allocate or reset bitmaps for DF_UREC blocks. The solution bits are
- not touched unless the block is new. */
-
-static void
-df_urec_alloc (bitmap all_blocks)
-
-{
- unsigned int bb_index;
- bitmap_iterator bi;
- struct df_urec_problem_data *problem_data
- = (struct df_urec_problem_data *) df_urec->problem_data;
-
- if (!df_urec->block_pool)
- df_urec->block_pool = create_alloc_pool ("df_urec_block pool",
- sizeof (struct df_urec_bb_info), 50);
-
- if (!df_urec->problem_data)
- {
- problem_data = XNEW (struct df_urec_problem_data);
- df_urec->problem_data = problem_data;
- }
- problem_data->earlyclobbers_found = false;
-
- df_grow_bb_info (df_urec);
-
- EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi)
- {
- struct df_urec_bb_info *bb_info = df_urec_get_bb_info (bb_index);
- if (bb_info)
- {
- bitmap_clear (bb_info->kill);
- bitmap_clear (bb_info->gen);
- bitmap_clear (bb_info->earlyclobber);
- }
- else
- {
- bb_info = (struct df_urec_bb_info *) pool_alloc (df_urec->block_pool);
- df_urec_set_bb_info (bb_index, bb_info);
- bb_info->kill = BITMAP_ALLOC (NULL);
- bb_info->gen = BITMAP_ALLOC (NULL);
- bb_info->in = BITMAP_ALLOC (NULL);
- bb_info->out = BITMAP_ALLOC (NULL);
- bb_info->top = BITMAP_ALLOC (NULL);
- bb_info->earlyclobber = BITMAP_ALLOC (NULL);
- }
- }
- df_urec->optional_p = true;
-}
-
-
-/* The function modifies local info for register REG being changed in
- SETTER. DATA is used to pass the current basic block info. */
-
-static void
-df_urec_mark_reg_change (rtx reg, const_rtx setter, void *data)
-{
- int regno;
- int endregno;
- int i;
- struct df_urec_bb_info *bb_info = (struct df_urec_bb_info*) data;
-
- if (GET_CODE (reg) == SUBREG)
- reg = SUBREG_REG (reg);
-
- if (!REG_P (reg))
- return;
-
- regno = REGNO (reg);
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- endregno = END_HARD_REGNO (reg);
- for (i = regno; i < endregno; i++)
- {
- bitmap_set_bit (bb_info->kill, i);
-
- if (GET_CODE (setter) != CLOBBER)
- bitmap_set_bit (bb_info->gen, i);
- else
- bitmap_clear_bit (bb_info->gen, i);
- }
- }
- else
- {
- bitmap_set_bit (bb_info->kill, regno);
-
- if (GET_CODE (setter) != CLOBBER)
- bitmap_set_bit (bb_info->gen, regno);
- else
- bitmap_clear_bit (bb_info->gen, regno);
- }
-}
-/* Classes of registers which could be early clobbered in the current
- insn. */
-
-static VEC(int,heap) *earlyclobber_regclass;
-
-/* This function finds and stores register classes that could be early
- clobbered in INSN. If any earlyclobber classes are found, the function
- returns TRUE, in all other cases it returns FALSE. */
-
-static bool
-df_urec_check_earlyclobber (rtx insn)
-{
- int opno;
- bool found = false;
-
- extract_insn (insn);
-
- VEC_truncate (int, earlyclobber_regclass, 0);
- for (opno = 0; opno < recog_data.n_operands; opno++)
- {
- char c;
- bool amp_p;
- int i;
- enum reg_class class;
- const char *p = recog_data.constraints[opno];
-
- class = NO_REGS;
- amp_p = false;
- for (;;)
- {
- c = *p;
- switch (c)
- {
- case '=': case '+': case '?':
- case '#': case '!':
- case '*': case '%':
- case 'm': case '<': case '>': case 'V': case 'o':
- case 'E': case 'F': case 'G': case 'H':
- case 's': case 'i': case 'n':
- case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P':
- case 'X':
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- /* These don't say anything we care about. */
- break;
-
- case '&':
- amp_p = true;
- break;
- case '\0':
- case ',':
- if (amp_p && class != NO_REGS)
- {
- int rc;
-
- found = true;
- for (i = 0;
- VEC_iterate (int, earlyclobber_regclass, i, rc);
- i++)
- {
- if (rc == (int) class)
- goto found_rc;
- }
-
- /* We use VEC_quick_push here because
- earlyclobber_regclass holds no more than
- N_REG_CLASSES elements. */
- VEC_quick_push (int, earlyclobber_regclass, (int) class);
- found_rc:
- ;
- }
-
- amp_p = false;
- class = NO_REGS;
- break;
-
- case 'r':
- class = GENERAL_REGS;
- break;
-
- default:
- class = REG_CLASS_FROM_CONSTRAINT (c, p);
- break;
- }
- if (c == '\0')
- break;
- p += CONSTRAINT_LEN (c, p);
- }
- }
-
- return found;
-}
-
-/* The function checks that pseudo-register *X has a class
- intersecting with the class of pseudo-register could be early
- clobbered in the same insn.
-
- This function is a no-op if earlyclobber_regclass is empty.
-
- Reload can assign the same hard register to uninitialized
- pseudo-register and early clobbered pseudo-register in an insn if
- the pseudo-register is used first time in given BB and not lived at
- the BB start. To prevent this we don't change life information for
- such pseudo-registers. */
-
-static int
-df_urec_mark_reg_use_for_earlyclobber (rtx *x, void *data)
-{
- enum reg_class pref_class, alt_class;
- int i, regno;
- struct df_urec_bb_info *bb_info = (struct df_urec_bb_info*) data;
-
- if (REG_P (*x) && REGNO (*x) >= FIRST_PSEUDO_REGISTER)
- {
- int rc;
-
- regno = REGNO (*x);
- if (bitmap_bit_p (bb_info->kill, regno)
- || bitmap_bit_p (bb_info->gen, regno))
- return 0;
- pref_class = reg_preferred_class (regno);
- alt_class = reg_alternate_class (regno);
- for (i = 0; VEC_iterate (int, earlyclobber_regclass, i, rc); i++)
- {
- if (reg_classes_intersect_p (rc, pref_class)
- || (rc != NO_REGS
- && reg_classes_intersect_p (rc, alt_class)))
- {
- bitmap_set_bit (bb_info->earlyclobber, regno);
- break;
- }
- }
- }
- return 0;
-}
-
-/* The function processes all pseudo-registers in *X with the aid of
- previous function. */
-
-static void
-df_urec_mark_reg_use_for_earlyclobber_1 (rtx *x, void *data)
-{
- for_each_rtx (x, df_urec_mark_reg_use_for_earlyclobber, data);
-}
-
-
-/* Compute local uninitialized register info for basic block BB. */
-
-static void
-df_urec_bb_local_compute (unsigned int bb_index)
-{
- basic_block bb = BASIC_BLOCK (bb_index);
- struct df_urec_bb_info *bb_info = df_urec_get_bb_info (bb_index);
- rtx insn;
- struct df_ref **def_rec;
-
- for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
- {
- struct df_ref *def = *def_rec;
- if (DF_REF_FLAGS (def) & DF_REF_AT_TOP)
- {
- unsigned int regno = DF_REF_REGNO (def);
- bitmap_set_bit (bb_info->gen, regno);
- }
- }
-
- FOR_BB_INSNS (bb, insn)
- {
- if (INSN_P (insn))
- {
- note_stores (PATTERN (insn), df_urec_mark_reg_change, bb_info);
- if (df_urec_check_earlyclobber (insn))
- {
- struct df_urec_problem_data *problem_data
- = (struct df_urec_problem_data *) df_urec->problem_data;
- problem_data->earlyclobbers_found = true;
- note_uses (&PATTERN (insn),
- df_urec_mark_reg_use_for_earlyclobber_1, bb_info);
- }
- }
- }
-
- for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++)
- {
- struct df_ref *def = *def_rec;
- if ((DF_REF_FLAGS (def) & DF_REF_AT_TOP) == 0)
- {
- unsigned int regno = DF_REF_REGNO (def);
- bitmap_set_bit (bb_info->gen, regno);
- }
- }
-}
-
-
-/* Compute local uninitialized register info. */
-
-static void
-df_urec_local_compute (bitmap all_blocks)
-{
- unsigned int bb_index;
- bitmap_iterator bi;
-#ifdef STACK_REGS
- int i;
- HARD_REG_SET stack_hard_regs, used;
- struct df_urec_problem_data *problem_data
- = (struct df_urec_problem_data *) df_urec->problem_data;
-
- /* Any register that MAY be allocated to a register stack (like the
- 387) is treated poorly. Each such register is marked as being
- live everywhere. This keeps the register allocator and the
- subsequent passes from doing anything useful with these values.
-
- FIXME: This seems like an incredibly poor idea. */
-
- CLEAR_HARD_REG_SET (stack_hard_regs);
- for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++)
- SET_HARD_REG_BIT (stack_hard_regs, i);
- problem_data->stack_regs = BITMAP_ALLOC (NULL);
- for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
- {
- COPY_HARD_REG_SET (used, reg_class_contents[reg_preferred_class (i)]);
- IOR_HARD_REG_SET (used, reg_class_contents[reg_alternate_class (i)]);
- AND_HARD_REG_SET (used, stack_hard_regs);
- if (!hard_reg_set_empty_p (used))
- bitmap_set_bit (problem_data->stack_regs, i);
- }
-#endif
-
- /* We know that earlyclobber_regclass holds no more than
- N_REG_CLASSES elements. See df_urec_check_earlyclobber. */
- earlyclobber_regclass = VEC_alloc (int, heap, N_REG_CLASSES);
-
- EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi)
- {
- df_urec_bb_local_compute (bb_index);
- }
-
- VEC_free (int, heap, earlyclobber_regclass);
-}
-
-
-/* Initialize the solution vectors. */
-
-static void
-df_urec_init (bitmap all_blocks)
-{
- unsigned int bb_index;
- bitmap_iterator bi;
-
- EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi)
- {
- struct df_urec_bb_info *bb_info = df_urec_get_bb_info (bb_index);
-
- bitmap_copy (bb_info->out, bb_info->gen);
- bitmap_clear (bb_info->in);
- }
-}
-
-
-/* Or in the stack regs, hard regs and early clobber regs into the
- urec_in sets of all of the blocks. */
-
-
-static void
-df_urec_local_finalize (bitmap all_blocks)
-{
- bitmap tmp = BITMAP_ALLOC (NULL);
- bitmap_iterator bi;
- unsigned int bb_index;
- struct df_urec_problem_data *problem_data
- = (struct df_urec_problem_data *) df_urec->problem_data;
-
- EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi)
- {
- struct df_urec_bb_info *bb_info = df_urec_get_bb_info (bb_index);
- struct df_lr_bb_info *bb_lr_info = df_lr_get_bb_info (bb_index);
-
- if (bb_index != ENTRY_BLOCK && bb_index != EXIT_BLOCK)
- {
- if (problem_data->earlyclobbers_found)
- bitmap_ior_into (bb_info->in, bb_info->earlyclobber);
-
-#ifdef STACK_REGS
- /* We can not use the same stack register for uninitialized
- pseudo-register and another living pseudo-register
- because if the uninitialized pseudo-register dies,
- subsequent pass reg-stack will be confused (it will
- believe that the other register dies). */
- bitmap_ior_into (bb_info->in, problem_data->stack_regs);
- bitmap_ior_into (bb_info->out, problem_data->stack_regs);
-#endif
- }
-
- /* No register may reach a location where it is not used. Thus
- we trim the rr result to the places where it is used. */
- bitmap_and_into (bb_info->in, bb_lr_info->in);
- bitmap_and_into (bb_info->out, bb_lr_info->out);
- bitmap_copy (bb_info->top, bb_info->in);
- if (bb_lr_info->adef)
- bitmap_ior_into (bb_info->top, bb_lr_info->adef);
- bitmap_and_into (bb_info->top, bb_lr_info->top);
-#if 0
- /* Hard registers may still stick in the ur_out set, but not
- be in the ur_in set, if their only mention was in a call
- in this block. This is because a call kills in the lr
- problem but does not kill in the rr problem. To clean
- this up, we execute the transfer function on the lr_in
- set and then use that to knock bits out of ur_out. */
- bitmap_ior_and_compl (tmp, bb_info->gen, bb_lr_info->in,
- bb_info->kill);
- bitmap_and_into (bb_info->out, tmp);
-#endif
- }
-
-#ifdef STACK_REGS
- BITMAP_FREE (problem_data->stack_regs);
-#endif
- BITMAP_FREE (tmp);
-}
-
-
-/* Confluence function that ignores fake edges. */
-
-static void
-df_urec_confluence_n (edge e)
-{
- bitmap op1 = df_urec_get_bb_info (e->dest->index)->in;
- bitmap op2 = df_urec_get_bb_info (e->src->index)->out;
-
- if (e->flags & EDGE_FAKE)
- return;
-
- bitmap_ior_into (op1, op2);
-}
-
-
-/* Transfer function. */
-
-static bool
-df_urec_transfer_function (int bb_index)
-{
- struct df_urec_bb_info *bb_info = df_urec_get_bb_info (bb_index);
- bitmap in = bb_info->in;
- bitmap out = bb_info->out;
- bitmap gen = bb_info->gen;
- bitmap kill = bb_info->kill;
-
- return bitmap_ior_and_compl (out, gen, in, kill);
-}
-
-
-/* Free all storage associated with the problem. */
-
-static void
-df_urec_free (void)
-{
- if (df_urec->block_info)
- {
- unsigned int i;
-
- for (i = 0; i < df_urec->block_info_size; i++)
- {
- struct df_urec_bb_info *bb_info = df_urec_get_bb_info (i);
- if (bb_info)
- {
- BITMAP_FREE (bb_info->gen);
- BITMAP_FREE (bb_info->kill);
- BITMAP_FREE (bb_info->in);
- BITMAP_FREE (bb_info->out);
- BITMAP_FREE (bb_info->earlyclobber);
- BITMAP_FREE (bb_info->top);
- }
- }
-
- free_alloc_pool (df_urec->block_pool);
-
- df_urec->block_info_size = 0;
- free (df_urec->block_info);
- free (df_urec->problem_data);
- }
- free (df_urec);
-}
-
-
-/* Debugging info at top of bb. */
-
-static void
-df_urec_top_dump (basic_block bb, FILE *file)
-{
- struct df_urec_bb_info *bb_info = df_urec_get_bb_info (bb->index);
- if (!bb_info || !bb_info->in)
- return;
-
- fprintf (file, ";; urec in \t");
- df_print_regset (file, bb_info->in);
- fprintf (file, ";; urec gen \t");
- df_print_regset (file, bb_info->gen);
- fprintf (file, ";; urec kill\t");
- df_print_regset (file, bb_info->kill);
- fprintf (file, ";; urec ec\t");
- df_print_regset (file, bb_info->earlyclobber);
-}
-
-
-/* Debugging info at bottom of bb. */
-
-static void
-df_urec_bottom_dump (basic_block bb, FILE *file)
-{
- struct df_urec_bb_info *bb_info = df_urec_get_bb_info (bb->index);
- if (!bb_info || !bb_info->out)
- return;
- fprintf (file, ";; urec out \t");
- df_print_regset (file, bb_info->out);
-}
-
-
-/* All of the information associated with every instance of the problem. */
-
-static struct df_problem problem_UREC =
-{
- DF_UREC, /* Problem id. */
- DF_FORWARD, /* Direction. */
- df_urec_alloc, /* Allocate the problem specific data. */
- NULL, /* Reset global information. */
- df_urec_free_bb_info, /* Free basic block info. */
- df_urec_local_compute, /* Local compute function. */
- df_urec_init, /* Init the solution specific data. */
- df_worklist_dataflow, /* Worklist solver. */
- NULL, /* Confluence operator 0. */
- df_urec_confluence_n, /* Confluence operator n. */
- df_urec_transfer_function, /* Transfer function. */
- df_urec_local_finalize, /* Finalize function. */
- df_urec_free, /* Free all of the problem information. */
- df_urec_free, /* Remove this problem from the stack of dataflow problems. */
- NULL, /* Debugging. */
- df_urec_top_dump, /* Debugging start block. */
- df_urec_bottom_dump, /* Debugging end block. */
- NULL, /* Incremental solution verify start. */
- NULL, /* Incremental solution verify end. */
- &problem_LR, /* Dependent problem. */
- TV_DF_UREC, /* Timing variable. */
- false /* Reset blocks on dropping out of blocks_to_analyze. */
-};
-
-
-/* Create a new DATAFLOW instance and add it to an existing instance
- of DF. The returned structure is what is used to get at the
- solution. */
-
-void
-df_urec_add_problem (void)
-{
- df_add_problem (&problem_UREC);
-}
-
-
/*----------------------------------------------------------------------------
CREATE DEF_USE (DU) and / or USE_DEF (UD) CHAINS
@@ -3707,7 +3020,7 @@ df_simulate_fixup_sets (basic_block bb, bitmap live)
{
/* These regs are considered always live so if they end up dying
because of some def, we need to bring the back again. */
- if (df_has_eh_preds (bb))
+ if (bb_has_eh_pred (bb))
bitmap_ior_into (live, df->eh_block_artificial_uses);
else
bitmap_ior_into (live, df->regular_block_artificial_uses);