no_new_pseudos

Kenneth Zadeck zadeck@naturalbridge.com
Tue Jul 3 21:15:00 GMT 2007


Alexandre Oliva wrote:
> On Jul  2, 2007, Richard Earnshaw <Richard.Earnshaw@arm.com> wrote:
>
>   
>> On Mon, 2007-07-02 at 12:10 -0400, Kenneth Zadeck wrote:
>>     
>>> I do not remember if it was stevenb or bonzini that observed that
>>> because of changes that came with the dataflow branch it is now trivial
>>> to get rid of no_new_pseudos.  All of the sets can just go away, as well
>>> as the tests of it that occur in passes that only run before reload.
>>>
>>> For those few passes that can run both before and after reload, the test
>>> would be replaced with a test of reload_completed.
>>>
>>> I believe that the original purpose of this was to protect certain
>>> datastructures that had to be resized manually when pseudos were added. 
>>> However, all of these are gone, and have been replaced with structures
>>> inside of df that are automatically resized.
>>>
>>> Does anyone think this is a bad idea?  A grep for no_new_pseudos bears
>>> out that nothing is really going on here anymore. 
>>>       
>
>   
>> There are 199 uses of it in the backends; compared to 32 in the front
>> end.
>>     
>
>   
>> So it is quite heavily used by MD code.
>>     
>
> I recall having used it a number of times in expanders that shouldn't
> create new pseudos during reload.  These could easily be turned into
> (reload_in_progress || reload_completed).  Maybe we could turn
> no_new_pseudos into a macro that expands to this?
>
>   
199 reasons not to create pseudos. 

I bootstrapped and regression tested this patch on ppc32, x86-64 and
ia-64 linuxes.

The backend was done pretty mechanically.  This is important since i do
not plan to test every backend. 

In the config directory i took the route of changing no_new_pseudos to
(reload_completed || reload_in_progress).  This is safe and correct,
there my be some places to clean up.

David Edelsohn points out that some of the expanders could have all of
this code removed since expanders only run before reload. I do not know
how to figure this out.

The only thing else in the backends are the thunk generators which have
the references to no_new_pseudos removed.

The middle end changes either remove the references to no_new_pseudos if
the pass is only run before reload or changes the reference to
reload_completed.

OK for trunk?

Kenn


2007-07-02  Kenneth Zadeck <zadeck@naturalbridge.com>

    * toplev.c (no_new_pseudos): Deleted.
    * rtl.h (no_new_pseudos): Deleted.
    * tree-pass.h (pass_no_new_pseudos): Deleted.
    * passes.c (pass_no_new_pseudos): Deleted.
    * final.c (rest_of_clean_state): Removed no_new_pseudos.
    (rest_of_no_new_pseudos, pass_no_new_pseudos): Deleted.
    * struct-equiv.c (rtx_equiv_p): Replaced no_new_pseudos with
    reload_completed.
    * emit-rtl.c (gen_reg_rtx): Ditto.
    * cfgcleanup.c (try_crossjump_to_edge): Ditto.
    * rtlhooks.c (gen_lowpart_general): Ditto.
    * optabs.c (prepare_operand): Ditto.
    * mode-switching.c (rest_of_handle_mode_switching): Deleted set of
    no_new_pseudos.
    * modulo-sched.c (rest_of_handle_sms): Ditto.
    * see.c (rest_of_handle_see): Ditto.
    * ifcvt.c (if_convert): Ditto.
    (gate_handle_if_after_combine): Replaced no_new_pseudos with
    reload_completed.
    * init-regs.c (gate_initialize_regs): Deleted set of
    no_new_pseudos.
    * lower-subreg.c (decompose_multiword_subregs): Ditto.
    * bb-reorder.c (rest_of_handle_partition_blocks): Ditto.
    * config/alpha/alpha.c (alpha_legitimize_address,
    alpha_emit_set_const_1, alpha_emit_set_const,
    alpha_emit_conditional_move, alpha_split_conditional_move):
    Replaced no_new_pseudos with (reload_completed || reload_in_progress).
    * config/alpha/alpha.md: Ditto.
    * config/frv/frv.md: Ditto.
    * config/s390/s390.c (legitimize_tls_address): Ditto.
    * config/s390/s390.md: Ditto.
    * config/m32c/m32c.c (m32c_prepare_move, m32c_split_move,
    m32c_expand_insv): Ditto.
    * config/spu/spu.c (spu_split_immediate): Ditto.
    * config/sparc/sparc.md: Ditto.
    * config/sparc/sparc.c (legitimize_tls_address): Ditto.
    (sparc_output_mi_thunk): Removed set of no_new_pseudos.
    * config/i386/i386.md:     Replaced no_new_pseudos with
    (reload_completed || reload_in_progress).
    * config/i386/i386.c (ix86_expand_move, ix86_expand_vector_move,
    ix86_prepare_fp_compare_args, ix86_expand_carry_flag_compare): Ditto.
    * config/sh/predicates.md: Ditto.
    * config/sh/sh.c (prepare_move_operands, prepare_cbranch_operands,
    emit_fpu_switch, fpscr_set_from_mem, sh_get_pr_initial_val): Ditto.
    (sh_output_mi_thunk): Removed set of no_new_pseudos.
    * config/sh/sh.md: Replaced no_new_pseudos with
    (reload_completed || reload_in_progress).
    * config/cris/cris.c (cris_expand_pic_call_address): Ditto.
    * config/cris/cris.md: Ditto.
    * config/mn10300/mn10300.md: Ditto.
    * config/ia64/ia64.c (ia64_expand_move, ia64_expand_movxf_movrf): Ditto.
    (ia64_output_mi_thunk): Removed set of no_new_pseudos.
    * config/m68k/m68k.md: Replaced no_new_pseudos with
    (reload_completed || reload_in_progress).
    * config/m68k/m68k.c (m68k_output_mi_thunk):  Removed set of
no_new_pseudos.
    * config/rs6000/rs6000.c (rs6000_emit_set_const, rs6000_emit_move,
    rs6000_got_register, create_TOC_reference,
    rs6000_machopic_legitimize_pic_address): Ditto.
    (rs6000_output_mi_thunk): Removed set of no_new_pseudos.
    * config/rs6000/rs6000.md: Replaced no_new_pseudos with
    (reload_completed || reload_in_progress).
    * config/score/score.c (th_output_mi_thunk): Removed set of
no_new_pseudos.
    (score_address_p): Replaced no_new_pseudos with
    (reload_completed || reload_in_progress).
    * config/arm/arm.c (require_pic_register, legitimize_pic_address,
    arm_load_pic_register, arm_cannot_copy_insn_p): Ditto.
    * config/arm/arm.md: Ditto.
    * config/pa/pa.md: Ditto.
    * config/pa/pa.c (emit_move_sequence): Ditto.
    * config/mips/mips.c (mips_legitimate_address_p,
    mips_split_symbol, mips_move_integer, mips_legitimize_const_move):
    Ditto.
    (mips_output_mi_thunk): Removed set of no_new_pseudos.
    * config/h8300/h8300.md: Replaced no_new_pseudos with
    (reload_completed || reload_in_progress).
    * config/bfin/bfin.c (legitimize_pic_address): Ditto.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: no_new_pseudos1.diff
Type: text/x-patch
Size: 73352 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20070703/ea7d8783/attachment.bin>


More information about the Gcc mailing list