summaryrefslogtreecommitdiff
path: root/gcc/df-scan.c
diff options
context:
space:
mode:
authorzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-02 13:10:07 +0000
committerzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-02 13:10:07 +0000
commitdea7b504afdd99c98883a1e47226e805beb752b3 (patch)
treeb10f5b41b330de2e7955bcee2d0e55e357b7321d /gcc/df-scan.c
parent0c80423da5fc889b03078be0b322542054ed219f (diff)
downloadgcc-dea7b504afdd99c98883a1e47226e805beb752b3.tar.gz
2007-09-02 Kenneth Zadeck <zadeck@naturalbridge.com>
* ra-conflict.c: New file. * ra.h: New file. * reload.c (push_reload, find_dummy_reload): Change DF_RA_LIVE usage to DF_LIVE usage. * rtlanal.c (subreg_nregs_with_regno): New function. * df-scan.c (df_def_record_1, df_uses_record): Add code to set DF_REF_EXTRACT, DF_REF_STRICT_LOWER_PART, and DF_REF_SUBREG flags. (df_has_eh_preds): Removed. (df_bb_refs_collect, df_bb_refs_collect, df_bb_refs_collect, df_exit_block_uses_collect): Changed call from df_has_eh_preds to bb_has_eh_pred. * global.c (allocno, max_allocno, conflicts, allocno_row_words, reg_allocno, EXECUTE_IF_SET_IN_ALLOCNO_SET): Moved to ra.h (SET_ALLOCNO_LIVE, CLEAR_ALLOCNO_LIVE): Moved to ra-conflicts.c. (regs_set, record_one_conflict, record_conflicts, mark_reg_store, mark_reg_clobber, mark_reg_conflicts, mark_reg_death): Deleted. (global_alloc): Turn off rescanning insns after call to global_conflicts and added call to set_preferences. (global_conflicts): Moved to ra-alloc.c. (set_preferences_1, set_preferences): New function. (mirror_conflicts): Changed types for various variables. (mark_elimination): Change DF_RA_LIVE usage to DF_LIVE usage. (build_insn_chain): Rewritten from scratch and made local. (print_insn_chain, print_insn_chains): New functions. (dump_conflicts): Do not print conflicts for fixed_regs. (rest_of_handle_global_alloc): Turn off insn rescanning. * hard-reg-set.h: Fixed comment. * local-alloc.c (update_equiv_regs): Change DF_RA_LIVE usage to DF_LIVE usage and delete refs to TOP sets. (block_alloc): Mark regs as live if they are in the artificial defs at top of block. (find_stack_regs): New function. (rest_of_handle_local_alloc): Changed urec problem to live problem and do not turn off df rescanning. * df.h (DF_UREC, DF_UREC_BB_INFO, DF_LIVE_TOP, DF_RA_LIVE_IN, DF_RA_LIVE_TOP, DF_RA_LIVE_OUT, df_urec_bb_info, df_urec, df_urec_add_problem, df_urec_get_bb_info, df_has_eh_preds): Removed. (DF_CHAIN, DF_NOTE, DF_CHAIN): Renumbered. (DF_REF_EXTRACT, DF_REF_STRICT_LOWER_PART, DF_REF_SUBREG): New fields in df_ref_flags. The rest have been renumbered. * init-regs.c (initialize_uninitialized_regs): Enhanced debugging at -O1. * rtl.h (subreg_nregs_with_regno): New function. * df-problems.c: (df_get_live_out, df_get_live_in, df_get_live_top): Removed reference to DF_RA_LIVE. (df_lr_reset, df_lr_transfer_function, df_live_free_bb_info, df_live_alloc, df_live_reset, df_live_local_finalize, df_live_free): Make top set only if different from in set. (df_lr_top_dump, df_live_top_dump): Only print top set if different from in set. (df_lr_bb_local_compute): Removed unnecessary check. (df_urec_problem_data, df_urec_set_bb_info, df_urec_free_bb_info, df_urec_alloc, df_urec_mark_reg_change, earlyclobber_regclass, df_urec_check_earlyclobber, df_urec_mark_reg_use_for_earlyclobber, df_urec_mark_reg_use_for_earlyclobber_1, df_urec_bb_local_compute, df_urec_local_compute, df_urec_init, df_urec_local_finalize, df_urec_confluence_n, df_urec_transfer_function, df_urec_free, df_urec_top_dump, df_urec_bottom_dump, problem_UREC, df_urec_add_problem): Removed. (df_simulate_fixup_sets): Changed call from df_has_eh_preds to bb_has_eh_pred. * Makefile.in (ra-conflict.o, ra.h): New dependencies. * basic_block.h (bb_has_abnormal_pred): New function. * reload1.c (compute_use_by_pseudos): Change DF_RA_LIVE usage to DF_LIVE usage. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128957 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df-scan.c')
-rw-r--r--gcc/df-scan.c72
1 files changed, 35 insertions, 37 deletions
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index a1f71b03b6d..f4ced0d34c9 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -2752,23 +2752,37 @@ df_def_record_1 (struct df_collection_rec *collection_rec,
|| GET_CODE (dst) == ZERO_EXTRACT)
{
flags |= DF_REF_READ_WRITE | DF_REF_PARTIAL;
+ if (GET_CODE (dst) == ZERO_EXTRACT)
+ flags |= DF_REF_EXTRACT;
+ else
+ flags |= DF_REF_STRICT_LOWER_PART;
+
loc = &XEXP (dst, 0);
dst = *loc;
}
- if (df_read_modify_subreg_p (dst))
- flags |= DF_REF_READ_WRITE | DF_REF_PARTIAL;
+ /* At this point if we do not have a reg or a subreg, just return. */
+ if (REG_P (dst))
+ {
+ df_ref_record (collection_rec,
+ dst, loc, bb, insn, DF_REF_REG_DEF, flags);
- if (REG_P (dst)
- || (GET_CODE (dst) == SUBREG && REG_P (SUBREG_REG (dst))))
- df_ref_record (collection_rec,
- dst, loc, bb, insn, DF_REF_REG_DEF, flags);
+ /* We want to keep sp alive everywhere - by making all
+ writes to sp also use of sp. */
+ if (REGNO (dst) == STACK_POINTER_REGNUM)
+ df_ref_record (collection_rec,
+ dst, NULL, bb, insn, DF_REF_REG_USE, flags);
+ }
+ else if (GET_CODE (dst) == SUBREG && REG_P (SUBREG_REG (dst)))
+ {
+ if (df_read_modify_subreg_p (dst))
+ flags |= DF_REF_READ_WRITE | DF_REF_PARTIAL;
- /* We want to keep sp alive everywhere - by making all
- writes to sp also use of sp. */
- if (REG_P (dst) && REGNO (dst) == STACK_POINTER_REGNUM)
- df_ref_record (collection_rec,
- dst, NULL, bb, insn, DF_REF_REG_USE, flags);
+ flags |= DF_REF_SUBREG;
+
+ df_ref_record (collection_rec,
+ dst, loc, bb, insn, DF_REF_REG_DEF, flags);
+ }
}
@@ -2880,7 +2894,8 @@ df_uses_record (struct df_collection_rec *collection_rec,
if (df_read_modify_subreg_p (dst))
{
df_uses_record (collection_rec, &SUBREG_REG (dst),
- DF_REF_REG_USE, bb, insn, flags | DF_REF_READ_WRITE);
+ DF_REF_REG_USE, bb, insn,
+ flags | DF_REF_READ_WRITE | DF_REF_SUBREG);
break;
}
/* Fall through. */
@@ -2902,13 +2917,15 @@ df_uses_record (struct df_collection_rec *collection_rec,
dst = XEXP (dst, 0);
df_uses_record (collection_rec,
(GET_CODE (dst) == SUBREG) ? &SUBREG_REG (dst) : temp,
- DF_REF_REG_USE, bb, insn, DF_REF_READ_WRITE);
+ DF_REF_REG_USE, bb, insn,
+ DF_REF_READ_WRITE | DF_REF_STRICT_LOWER_PART);
}
break;
case ZERO_EXTRACT:
case SIGN_EXTRACT:
df_uses_record (collection_rec, &XEXP (dst, 0),
- DF_REF_REG_USE, bb, insn, DF_REF_READ_WRITE);
+ DF_REF_REG_USE, bb, insn,
+ DF_REF_READ_WRITE | DF_REF_EXTRACT);
df_uses_record (collection_rec, &XEXP (dst, 1),
DF_REF_REG_USE, bb, insn, flags);
df_uses_record (collection_rec, &XEXP (dst, 2),
@@ -3180,23 +3197,6 @@ df_insn_refs_collect (struct df_collection_rec* collection_rec,
df_canonize_collection_rec (collection_rec);
}
-/* Return true if any pred of BB is an eh. */
-
-bool
-df_has_eh_preds (basic_block bb)
-{
- edge e;
- edge_iterator ei;
-
- FOR_EACH_EDGE (e, ei, bb->preds)
- {
- if (e->flags & EDGE_EH)
- return true;
- }
- return false;
-}
-
-
/* Recompute the luids for the insns in BB. */
void
@@ -3261,7 +3261,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
}
#ifdef EH_RETURN_DATA_REGNO
- if (df_has_eh_preds (bb))
+ if (bb_has_eh_pred (bb))
{
unsigned int i;
/* Mark the registers that will contain data for the handler. */
@@ -3278,7 +3278,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
#ifdef EH_USES
- if (df_has_eh_preds (bb))
+ if (bb_has_eh_pred (bb))
{
unsigned int i;
/* This code is putting in an artificial ref for the use at the
@@ -3310,7 +3310,7 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
{
bitmap_iterator bi;
unsigned int regno;
- bitmap au = df_has_eh_preds (bb)
+ bitmap au = bb_has_eh_pred (bb)
? df->eh_block_artificial_uses
: df->regular_block_artificial_uses;
@@ -3481,8 +3481,6 @@ df_mark_reg (rtx reg, void *vset)
}
-
-
/* Set the bit for regs that are considered being defined at the entry. */
static void
@@ -3780,7 +3778,7 @@ df_exit_block_uses_collect (struct df_collection_rec *collection_rec, bitmap exi
I do not know why. */
if (reload_completed
&& !bitmap_bit_p (exit_block_uses, ARG_POINTER_REGNUM)
- && df_has_eh_preds (EXIT_BLOCK_PTR)
+ && bb_has_eh_pred (EXIT_BLOCK_PTR)
&& fixed_regs[ARG_POINTER_REGNUM])
df_ref_record (collection_rec, regno_reg_rtx[ARG_POINTER_REGNUM], NULL,
EXIT_BLOCK_PTR, NULL, DF_REF_REG_USE, 0);