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]

Re: Experimental post-reload life analysis



  In message <Pine.SOL.3.90.981002152846.14944K-100000@jennifer.informatik.rwth
-aachen.de>you write:
  > The patch below adds a small pass after reload_cse_regs that computes
  > life information on hard regs and re-creates REG_DEAD and REG_UNUSED
  > notes.
  > This makes it possible to delete the following pieces of code:
  >  - everything dealing with PRESERVE_DEATH_INFO_REGNO_P
  >  - reload_cse_no_longer_dead and its friends
  >  - code in sched.c to deal with incorrect REG_DEAD notes
  >  - the reference to used_spill_regs in reorg.c (correct death notes
  >    are now available to achieve the same effect).
  > 
  > The patch is somewhat tested (c-torture runs on i586-linux and
  > sparc-sun-solaris2.6), but could use a bit more testing.  Also, it
  > absolutely depends on correct basic block boundaries: it will abort
  > mercilessly if it finds insns between basic blocks.  Please see my
  > previous mail with the patch to caller-save.c before trying this one.
  > 
  > Bernd
  > 
  > 	* jump.c (jump_optimize): Unconditionally use the code that was
  > 	previously conditional on PRESERVE_DEATH_INFO_REGNO_P.
  > 	* reload1.c (reload): When reloading is finished, delete all
  > 	REG_DEAD and REG_UNUSED notes.
  > 	(emit_reload_insns): Delete all code that was conditional on
  > 	PRESERVE_DEATH_INFO_REGNO_P.
  > 	(set_regs): New static variable.
  > 	(used_regs): New static variable.
  > 	(live_regs): New static variable.
  > 	(find_set_and_used_regs): New function.
  > 	(calc_reg_usage): New function.
  > 	(reload_life_analysis): New function.
  > 	(no_longer_dead_regs): Delete variable.
  > 	(reload_cse_delete_death_notes): Delete function.
  > 	(reload_cse_no_longer_dead): Delete function.
  > 	(reload_cse_regs_1): Delete all code to handle deletion of death
  > 	notes.
  > 	(reload_cse_noop_set_p): Likewise.
  > 	(reload_cse_simplify_set): Likewise.
  > 	(reload_cse_simplify_operands): Likewise.
  > 	(reload_cse_move2add): Likewise.
  > 	* reorg.c (used_spill_regs): Delete declaration.
  > 	(max_label_num_after_reload): Delete declaration.
  > 	(find_dead_or_set_registers): Don't assume that spill regs are
  > 	dead at a CODE_LABEL.
  > 	* rtl.h (reload_life_analysis): Declare function.
  > 	* rtlanal.c (dead_or_set_regno_p): Death notes are always accurate,
  > 	even after reload.
  > 	* sched.c (sched_analyze_info): Likewise.
  > 	(update_flow_info): Likewise.
  > 	* tm.texi (PRESERVE_DEATH_INFO_REGNO_P): Delete documentation.
  > 	* toplev.c (max_label_num_after_reload): Delete variable.
  > 	(rest_of_compilation): Don't set max_label_num_after_reload.
  > 	Call reload_life_analysis after reload_cse_regs if optimizing.
  > 	* config/gmicro/gmicro.h: Delete comment referring to
  > 	PRESERVE_DEATH_INFO_REGNO_P.
  > 	* config/i386/i386.h: Likewise.
  > 	* config/m88k/m88k.h: Likewise.
  > 	* config/m32r/m32r.h (PRESERVE_DEATH_INFO_REGNO_P): Delete definition.
  > 	* config/sh/sh.h: Likewise.
I'm wondering if instead of writing a whole new pass to gather this info if
instead we should simply re-use the existing life analysis code in flow.c.

We may want to break out the pieces of that code we want to be callable
multiple times, but that seems to be a safer bet than writing (yet another)
life analysis pass.

I did this in the past with some success, there was one bug I never managed to
get interested enough to track down -- the 2nd call into life_analysis ended
up deleting insns it shouldn't have deleted (epilogue/return value gunk if
I remember right).

jeff


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