This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [DF] Replace various bitmaps with HARD_REG_SETs


i would like to see more testing on other platforms. this is a large patch. but otherwise it looks ok.

On 07/27/2011 08:26 AM, Dimitrios Apostolou wrote:
Hello list,

attached is a fairly intrusive patch that replaces many bitmaps in DF with HARD_REG_SETs. Tested on i386 - no regressions (besides mudflaps). Maybe we somehow should test on pa and mips, since I (slightly) touch those too.

Rationale is that it's a nice clean-up, avoiding the complex bitmap type when not needed, and making more clear the logic. I did these changes while doing some performance-related work on DF, which I'll hopefully post soon. Thanks to Paolo Bonzini for explaining the unexplicable. :-)

Performance measured unaffected:

trunk   : 0.627s, 1438.4 M instr
hardregs: 0.624s, 1434.2 M instr

(numbers differ from previous posts because I changed checks to --enable-checking=release)

This patch *includes* previously submitted patch that eliminates regs_invalidated_by_call_regset, since it's closely related and I got no replies on that one. It would be nice to commit together with the patch with subject "added some assert checks in hard-reg-set.h", these assertions are really useful now.

ChangeLog (emacs rescued me on style issues, Steven please let me know if you see any):


2011-07-27 Dimitrios Apostolou <jimis@gmx.net>


    * DataFlow: Use HARD_REG_SETs instead of bitmaps where we are
    certain that we don't map regs above FIRST_PSEUDO_REGISTERS.
    Detailed changelog follows.

    * regset.h:   Eliminated regs_invalidated_by_call_regset bitmap,
    use instead the original regs_invalidated_by_call HARD_REG_SET.
    * reginfo.c (initial_reg_alloc_order, init_reg_sets_1)
    (globalize_reg): Eliminate all initialising and handling of
    regs_invalidated_by_call_regset.
    * df.h: changed the following variables from bitmaps to
    HARD_REG_SETs: hardware_regs_used, regular_block_artificial_uses,
    eh_block_artificial_uses, entry_block_defs,
    exit_block_uses. Declared new function df_print_hard_reg_set.
    * target.def: removed hook_void_bitmap, added
    hook_void_hard_reg_set to be used by TARGET_EXTRA_LIVE_ON_ENTRY.
    * target.h: included hard-reg-set.h
    * targhooks.h, targhooks.c: Removed hook_void_bitmap, added
    hook_void_hard_reg_set.
    * i386.c (ix86_live_on_entry), mips.c (mips_extra_live_on_entry),
    pa.c (pa_extra_live_on_entry) : changed argument from bitmap to
    HARD_REG_SET *, also changed relevant set_bit operations.
    * tm.texi: Documented type of TARGET_EXTRA_LIVE_ON_ENTRY is now
    HARD_REG_SET * instead of bitmap.
    * dce.c (dce_process_block, fast_dce):
    * df-core.c (df_print_hard_reg_set): new function to print
    HARD_REG_SET to file.
    * df-problems.c (df_rd_local_compute, df_lr_local_compute)
    (df_lr_confluence_0, df_lr_confluence_n, df_word_lr_local_compute)
    (df_simulate_fixup_sets, df_md_confluence_n): replaced old bitmap
    operations with HARD_REG_SET ones, appropriate for new types.
    (df_word_lr_local_compute): eliminated unreachable code.
    (bitmap_copy_from_hard_reg_set, bitmap_ior_from_hard_reg_set)
    (bitmap_ior_and_compl_from_hard_reg_set): new functions for
    operations between bitmaps and hard_reg_sets.
    * df-scan.c: regs_ever_live converted from bool array to
    HARD_REG_SET.
    (df_regs_ever_live_p, df_set_regs_ever_live)
    (df_compute_regs_ever_live, ): use HARD_REG_SET_BIT,
    HARD_REG_CLEAR_BIT and HARD_REG_TEST_BIT instead of bitmap
    operations, to access regs_ever_live.
    (df_scan_free_internal, df_scan_alloc)
    (df_scan_start_dump, df_scan_blocks, df_get_call_refs)
    (df_bb_refs_collect, df_get_regular_block_artificial_uses)
    (df_get_regular_block_artificial_uses)
    (df_get_eh_block_artificial_uses, df_mark_reg)
    (df_get_entry_block_def_set, df_entry_block_defs_collect)
    (df_record_entry_block_defs, df_update_entry_block_defs)
    (df_get_exit_block_use_set, df_exit_block_uses_collect)
    (df_record_exit_block_uses, df_update_exit_block_uses)
    (df_entry_block_bitmap_verify, df_exit_block_bitmap_verify)
    (df_scan_verify): use HARD_REG_SET operations instead of bitmap
    ones to access changed types.
    (df_update_entry_block_defs, df_update_exit_block_uses):
    eliminate some dead code.



Thanks,
Dimitris


P.S. CC'd DF maintainers, please add to the CC list others I might have missed.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]