summaryrefslogtreecommitdiff
path: root/gcc/df-problems.c
diff options
context:
space:
mode:
authorzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-16 13:54:34 +0000
committerzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-16 13:54:34 +0000
commita1d42f3a69638d60111a84128b34dcd271786382 (patch)
tree63f780169efa14dd2849b28fc4cf07a474bd689d /gcc/df-problems.c
parentaf6cf582ab31d98c61020c753edac5b09860d984 (diff)
downloadgcc-a1d42f3a69638d60111a84128b34dcd271786382.tar.gz
2008-05-16 Kenneth Zadeck <zadeck@naturalbridge.com>
* ifcvt.c (dead_or_predicable): Rename df_simulate_one_insn_backwards to df_simulate_one_insn. * recog.c (peephole2_optimize): Ditto. * rtl-factoring.c (collect_pattern_seqs, clear_regs_live_in_seq): Ditto. * df.h: Rename df_simulate_one_insn_backwards to df_simulate_one_insn. and delete df_simulate_one_insn_forwards. * df-problems.c (df_simulate_artificial_refs_at_top) Reversed scanning of defs and uses. (df_simulate_one_insn_backwards): Renamed to df_simulate_one_insn. (df_simulate_one_insn_forwards): Removed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135422 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df-problems.c')
-rw-r--r--gcc/df-problems.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index f7288c78e8e..682cca857a7 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -3682,7 +3682,6 @@ df_note_add_problem (void)
DF_LR_IN. If you start at the bottom of the block use one of
DF_LIVE_OUT or DF_LR_OUT. BE SURE TO PASS A COPY OF THESE SETS,
THEY WILL BE DESTROYED.
-
----------------------------------------------------------------------------*/
@@ -3757,87 +3756,88 @@ df_simulate_fixup_sets (basic_block bb, bitmap live)
}
-/* Apply the artificial uses and defs at the top of BB in a forwards
+/*----------------------------------------------------------------------------
+ The following three functions are used only for BACKWARDS scanning:
+ i.e. they process the defs before the uses.
+
+ df_simulate_artificial_refs_at_end should be called first with a
+ bitvector copyied from the DF_LIVE_OUT or DF_LR_OUT. Then
+ df_simulate_one_insn should be called for each insn in the block,
+ starting with the last on. Finally,
+ df_simulate_artificial_refs_at_top can be called to get a new value
+ of the sets at the top of the block (this is rarely used).
+
+ It would be trivial to define a similar set of functions that work
+ in the forwards direction. The only changes would be to process
+ the uses before the defs and properly rename the functions. This
+ has so far not been necessary.
+----------------------------------------------------------------------------*/
+
+/* Apply the artificial uses and defs at the end of BB in a backwards
direction. */
void
-df_simulate_artificial_refs_at_top (basic_block bb, bitmap live)
+df_simulate_artificial_refs_at_end (basic_block bb, bitmap live)
{
struct df_ref **def_rec;
-#ifdef EH_USES
struct df_ref **use_rec;
-#endif
int bb_index = bb->index;
-#ifdef EH_USES
- for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
- {
- struct df_ref *use = *use_rec;
- if (DF_REF_FLAGS (use) & DF_REF_AT_TOP)
- bitmap_set_bit (live, DF_REF_REGNO (use));
- }
-#endif
-
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)
+ if ((DF_REF_FLAGS (def) & DF_REF_AT_TOP) == 0)
bitmap_clear_bit (live, DF_REF_REGNO (def));
}
+
+ for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
+ {
+ struct df_ref *use = *use_rec;
+ if ((DF_REF_FLAGS (use) & DF_REF_AT_TOP) == 0)
+ bitmap_set_bit (live, DF_REF_REGNO (use));
+ }
}
-/* Simulate the forwards effects of INSN on the bitmap LIVE. */
+/* Simulate the backwards effects of INSN on the bitmap LIVE. */
void
-df_simulate_one_insn_forwards (basic_block bb, rtx insn, bitmap live)
+df_simulate_one_insn (basic_block bb, rtx insn, bitmap live)
{
if (! INSN_P (insn))
return;
- df_simulate_uses (insn, live);
df_simulate_defs (insn, live);
+ df_simulate_uses (insn, live);
df_simulate_fixup_sets (bb, live);
}
-/* Apply the artificial uses and defs at the end of BB in a backwards
+/* Apply the artificial uses and defs at the top of BB in a backwards
direction. */
void
-df_simulate_artificial_refs_at_end (basic_block bb, bitmap live)
+df_simulate_artificial_refs_at_top (basic_block bb, bitmap live)
{
struct df_ref **def_rec;
+#ifdef EH_USES
struct df_ref **use_rec;
+#endif
int bb_index = bb->index;
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)
+ if (DF_REF_FLAGS (def) & DF_REF_AT_TOP)
bitmap_clear_bit (live, DF_REF_REGNO (def));
}
+#ifdef EH_USES
for (use_rec = df_get_artificial_uses (bb_index); *use_rec; use_rec++)
{
struct df_ref *use = *use_rec;
- if ((DF_REF_FLAGS (use) & DF_REF_AT_TOP) == 0)
+ if (DF_REF_FLAGS (use) & DF_REF_AT_TOP)
bitmap_set_bit (live, DF_REF_REGNO (use));
}
+#endif
}
-
-
-/* Simulate the backwards effects of INSN on the bitmap LIVE. */
-
-void
-df_simulate_one_insn_backwards (basic_block bb, rtx insn, bitmap live)
-{
- if (! INSN_P (insn))
- return;
-
- df_simulate_defs (insn, live);
- df_simulate_uses (insn, live);
- df_simulate_fixup_sets (bb, live);
-}
-
-