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]

[new-ra] "#if DENIS"


Why we can't use both variants from "#if DENIS" condition ?
They will complete each other.

Denis.


2003-07-03  Denis Chertykov  <denisc@overta.ru>

	* ra-rewrite.c (insert_stores): "#if DENIS" removed. Use both
	variants of inserting spill slot into insn.
	* (emit_loads): Likewise.

Index: ra-rewrite.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-rewrite.c,v
retrieving revision 1.1.2.19
diff -c -3 -p -r1.1.2.19 ra-rewrite.c
*** ra-rewrite.c	2 Jul 2003 15:11:21 -0000	1.1.2.19
--- ra-rewrite.c	3 Jul 2003 18:58:01 -0000
*************** insert_stores (new_deaths)
*** 785,812 ****
  	      if ((!last_slot || !rtx_equal_p (slot, last_slot))
  		  && ! slot_member_p (slots, slot))
  		{
- 		  unsigned int done = 0;
  		  rtx insns, ni;
  		  struct ra_ref *rdef = DF2RA (df2ra, info.defs[n]);
  		  rtx spill;
  		  int has_use;
  		  last_slot = slot;
  		  remember_slot (&slots, slot);
- #if DENIS
  		  if ((web->pattern || copy_insn_p (insn, NULL, NULL)) 
  		      && ra_validate_change (insn, DF_REF_LOC (info.defs[n]),
  					     slot, 0))
! #else
! 		  if ((DF_REF_FLAGS (info.defs[n]) & DF_REF_ALREADY_SPILLED)
! 		      || (! (rdef && RA_REF_ADDRESS_P (rdef))
! 			  && validate_change (insn, DF_REF_LOC (info.defs[n]),
! 					      slot, 0)))
  		    {
  		      df_insn_modify (df, bb, insn);
  		      bitmap_set_bit (last_changed_insns, uid);
  		      if (!flag_ra_test)
  			bitmap_set_bit (ra_modified_insns, uid);
- #endif
  		      if (!bitmap_bit_p (useless_defs,
  					 DF_REF_ID (info.defs[n])))
  			ra_emit_move_insn (source, slot);
--- 785,818 ----
  	      if ((!last_slot || !rtx_equal_p (slot, last_slot))
  		  && ! slot_member_p (slots, slot))
  		{
  		  rtx insns, ni;
  		  struct ra_ref *rdef = DF2RA (df2ra, info.defs[n]);
  		  rtx spill;
  		  int has_use;
  		  last_slot = slot;
  		  remember_slot (&slots, slot);
  		  if ((web->pattern || copy_insn_p (insn, NULL, NULL)) 
  		      && ra_validate_change (insn, DF_REF_LOC (info.defs[n]),
  					     slot, 0))
! 		    {
! 		      df_insn_modify (df, bb, insn);
! 		      bitmap_set_bit (ra_modified_insns, uid);
! 		      bitmap_set_bit (last_changed_insns, uid);
! 		      if (!bitmap_bit_p (useless_defs,
! 					 DF_REF_ID (info.defs[n])))
! 			ra_emit_move_insn (source, slot);
! 		    }
! 		  else
! 		    if ((DF_REF_FLAGS (info.defs[n]) & DF_REF_ALREADY_SPILLED)
! 			|| (! (rdef && RA_REF_ADDRESS_P (rdef))
! 			    && validate_change (insn,
! 						DF_REF_LOC (info.defs[n]),
! 						slot, 0)))
  		    {
  		      df_insn_modify (df, bb, insn);
  		      bitmap_set_bit (last_changed_insns, uid);
  		      if (!flag_ra_test)
  			bitmap_set_bit (ra_modified_insns, uid);
  		      if (!bitmap_bit_p (useless_defs,
  					 DF_REF_ID (info.defs[n])))
  			ra_emit_move_insn (source, slot);
*************** emit_loads (ri, nl_first_reload, last_bl
*** 1109,1115 ****
  	slot = simplify_gen_subreg (GET_MODE (reg), slot, innermode,
  				    SUBREG_BYTE (reg));
        done = 0;
- #ifdef DENIS
        if (web->one_load && web->last_use_insn
   	  && copy_insn_p (web->last_use_insn, NULL,NULL)
  	  && ra_validate_change (web->last_use_insn,
--- 1115,1120 ----
*************** emit_loads (ri, nl_first_reload, last_bl
*** 1121,1128 ****
  	  bitmap_set_bit (last_changed_insns, INSN_UID (web->last_use_insn));
  	  done = 1;
  	}
! #else
!       if (web->one_load && web->last_use_insn)
  	{
  	  unsigned int n;
  	  struct ra_insn_info info = insn_df[INSN_UID (web->last_use_insn)];
--- 1126,1132 ----
  	  bitmap_set_bit (last_changed_insns, INSN_UID (web->last_use_insn));
  	  done = 1;
  	}
!       else if (web->one_load && web->last_use_insn)
  	{
  	  unsigned int n;
  	  struct ra_insn_info info = insn_df[INSN_UID (web->last_use_insn)];
*************** emit_loads (ri, nl_first_reload, last_bl
*** 1174,1180 ****
  				INSN_UID (web->last_use_insn));
  	    }
  	}
- #endif
        if (!done)
  	ra_emit_move_insn (reg, slot);
        ni = get_insns ();
--- 1178,1183 ----
*************** split_insert_load (web, insn, before, li
*** 3567,3579 ****
        for (web = web->subreg_next; web; web = web->subreg_next)
  	if (is_partly_live (live, web))
  	  {
  	    rtx reg = copy_rtx (web->orig_x);
  	    enum machine_mode slot_mode = GET_MODE (whole_slot);
  	    if (slot_mode == VOIDmode)
  	      slot_mode = GET_MODE (aweb->orig_x);
! 	    rtx slot = simplify_gen_subreg (GET_MODE (reg), whole_slot,
! 					    slot_mode,
! 					    SUBREG_BYTE (reg));
  	    ra_emit_move_insn (reg, slot);
  	  }
      }
--- 3570,3584 ----
        for (web = web->subreg_next; web; web = web->subreg_next)
  	if (is_partly_live (live, web))
  	  {
+ 	    rtx slot;
  	    rtx reg = copy_rtx (web->orig_x);
+ 	    
  	    enum machine_mode slot_mode = GET_MODE (whole_slot);
  	    if (slot_mode == VOIDmode)
  	      slot_mode = GET_MODE (aweb->orig_x);
! 	    slot = simplify_gen_subreg (GET_MODE (reg), whole_slot,
! 					slot_mode,
! 					SUBREG_BYTE (reg));
  	    ra_emit_move_insn (reg, slot);
  	  }
      }


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