[PATCH]: update to df for mainline.

Kenneth Zadeck zadeck@naturalbridge.com
Fri Apr 28 02:06:00 GMT 2006


The attached patch only differs from the original patch I submitted in
that the first frag for df-problems has a slightly different context
that the changes are to be inserted into.  This different context was
caused because someone added an include for "vecprim.h" right before
where I was adding a different include.

I did rebootstrap and regression test this patch on i686-pc-linux-gnu to
make sure that nothing else had rotted. 

Kenny


Kenneth Zadeck wrote:
> This patch fixes two larger bugs and several smaller bugs with the
> implementation of df.  It also adds two new features and does some
> simple cleanup.
>
> It has been bootstrapped and regression tested on three platforms:
> powerpc64-unknown-linux-gnu, x86_64-unknown-linux-gnu, and
> i686-pc-linux-gnu.
>
> The larger bugs are:
>
> 1) Subregs were handled improperly.  Subreg stores were treated as
> kills rather than mods.  This terminated some def use chains
> prematurely.
>
> 2) Clobbers were also not being handled properly.  Clobbers in calls
> were treated the same as clobbers just in the code.  The two cases are
> now separated and dealt with properly.
>
> This patch also fixes PR26855.  (I was preparing this patch before the
> bug report came in.)  This failure was almost certainly caused by one
> of the two problems mentoned above.  The particular test case causes a
> malformed def-use chain.  Either of the above problems could have
> caused it.
>
> The smaller bugs relate to inefficiencies or storage management
> issues:
>
> 1) The correct set of blocks was not being reinitialized in the
> reaching defs and reaching uses problems.  This is only be a problem
> if the problem is rerun using the same instance of df.  Because of the
> way the bits are layed out in the bit vectors, the transfer functions
> for all of the basic blocks must be rebuilt when any changes are made.
> This restriction is only true for these two dataflow problems.
>
> 2) On certain architectures some hard registers could be put into set
> of artificial uses for a block more than once.
>
> 3) The code would crash if you asked it to rescan a basic block that
> had been deleted.
>
> The cleanups are:
>
> 1) Making more of the code use the abstractions that were defined in df.h.
>
> 2) Unifying the way flags are passed with the dataflow problems are set up.
> This allows the dependent problems to be passed flags when they start.
>
> 3) Removal of unused parameters from some of the debugging functions.
>
> 4) Removal of some unnecessary pessimestic post processing operations
> in the UR and UREC dataflow problems.  This code was originally based
> on Vlad's register allocation code (make_accurate_live_analysis) but
> is now unnecessary because df does a more precise job of scanning the
> hard registers than Vlads code does.
>
> The additional features add by this patch are:
>
> 1) The RI problem now rebuilds REG_DEATH and REG_UNUSED notes in a
> compatible way to what flow does.  This pass can optionally build the
> register information that flow does.  In both cases, the df version is
> more precise because it is based on the pruned flow information that
> is obtained by applying both a forwards and a backwards view of the
> code.  This patch does not make use of this feature.
>
> 2006-03-28  Daniel Berlin  <dberlin@dberlin.org>
>         Kenneth Zadeck <zadeck@naturalbridge.com>
>
>     PR rtl-optimization/26855
>
>     * df-scan.c (mw_reg_pool, mw_link_pool): New allocation pools for
>     multiword refs.
>     (df_scan_free_internal, df_scan_alloc, df_insn_refs_delete,
>     df_ref_record): Added code to properly handle multiword hard
>     registers.
>     (df_rescan_blocks): Added code to remove deleted blocks from bitmap.
>     (df_ref_create_structure, df_ref_record): Added code to properly
>     handle subregs.
>     (df_scan_add_problem): Added flags parameter.
>     (df_ref_create_structure): Changed switching structure.
>     (df_bb_refs_record): Fixed case where duplicate artificial refs
>     were created.  Changed location of flags.
>     (df_record_entry_block_defs): Added code to make stack pointer
>     live in entry block.  Refined cases where frame pointer is needed.
>     Changed location of flags.
>     (df_record_exit_block_uses): Changed location of flags.   
>     (df_set_state): Removed function.
>     * df-core.c (df_mvs_dump, df_set_flags, df_clear_flags,
>     df_delete_basic_block): New function.
>     (df_init): Changed location of flags.
>     (df_add_problem): Added flags parameter and the way flags are
>     processed.
>     (df_insn_uid_debug, df_ref_debug, debug_df_defno, debug_df_ref,
>     debug_df_chain): Improved debugging output.
>     (df_insn_debug, df_insn_uid_debug): Added multiword reg support.
>     (df_refs_chain_dump): Removed df parameter.
>     (df_iterative_dataflow): Added consistency check.
>     (df_prune_to_subcfg): Made public.
>     (df_analyze_problem): Added blocks_to_init parameter and made public.
>     * df.h: Some reordering to remove forward references.
>     (df_ref_flags.DF_REF_MW_HARDREG, DF_REF_PARTIAL): New fields.
>     (dataflow.flags): New field.
>     (df.flag): Deleted field.
>     (df_alloc_function): Added additional bitmap parameter.
>     (df_dependent_problem_function): New type.
>     (df_problem.changeable_flags): New field.
>     (df_ref_flags.DF_REF_DIES_AFTER_THIS_USE, DF_SCAN_INITIAL,
>     DF_SCAN_GLOBAL, DF_SCAN_POST_ALLOC, df_state): Removed.
>     (df_mw_hardreg): New struct.
>     (DF_INSN_UID_MWS): New macro.
>     (df_refs_chain_dump, df_ref_debug, df_chain_dump): Removed df
>     parameter.
>     (df_add_problem, df_ru_add_problem, df_rd_add_problem,
>     df_lr_add_problem, df_ur_add_problem, df_urec_add_problem,
>     df_ri_add_problem, df_scan_add_problem): Added flags parameter.
>     (df_set_state): Removed function.
>     (df_set_flags, df_clear_flags, df_delete_basic_block) New functions.
>     * df-problems.c (df_chain_dump): Removed df parameter.
>     (df_ru_alloc, df_rd_alloc, df_lr_alloc, df_ur_alloc,
>     df_urec_alloc, df_chain_alloc, df_ri_alloc): Added all blocks
>     parameter.
>     (df_ru_alloc, df_rd_alloc): Now resets all blocks.
>         (df_ru_bb_local_compute_process_def,
>     df_rd_bb_local_compute_process_def, df_lr_bb_local_compute,
>     df_lr_bb_local_compute, df_chain_create_bb): Made subreg aware.
>     (df_ru_bb_local_compute, df_rd_bb_local_compute,
>     df_lr_bb_local_compute, df_lr_bb_local_compute,
>     df_chain_create_bb): Cleanup to use proper macros.
>     (df_ur_local_finalize, df_urec_local_finalize): Removed unnecessary
>     code to fixup bitvectors.
>     (df_ri_alloc): Cleared lifetime.
>     (df_ignore_stack_reg, df_kill_notes, df_set_notes_for_mw,
>     df_create_unused_note): New function.
>     (df_ri_bb_compute, df_ri_compute): Added code to create/update
>     REG_DEAD and REG_UNUSED notes as well as register information.
>     (df_ru_dump, df_rd_dump, df_lr_dump, df_ur_dump, df_urec_dump,
>     df_chains_dump): Fixed crash if problem was never run.
>     (df_ru_add_problem, df_rd_add_problem, df_lr_add_problem,
>     df_ur_add_problem, df_urec_add_problem, df_chain_add_problem,
>     df_ri_add_problem): Processes flags in uniform manner.
>     * modulo-sched.c (sms_schedule): Added flag parameter to calls.
>     * final.c (rest_of_clean_state) Added regstack_completed.
>     * rtl.h (regstack_completed): Ditto.
>     * reg-stack.c (regstack_completed): Ditto.
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: update3a.diff
Type: text/x-patch
Size: 95557 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060428/a5503957/attachment.bin>


More information about the Gcc-patches mailing list