This is the mail archive of the gcc@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: -fnew-ra -- which architectures?


On 16 Jul 2002, Falk Hueffner wrote:

> Daniel Berlin <dberlin@dberlin.org> writes:
> 
> > On 16 Jul 2002, Falk Hueffner wrote:
> > 
> > > internal compiler error: Internal compiler error in check_df, at ra.c:629
> > > and
> > > internal compiler error: Internal compiler error in check_df, at ra.c:637
> > 
> > Yeah, these aren't new-ra problems, they are df.c problems.
> > 
> > ALl the df changes from the new-regalloc-branch haven't been 
> > reviewed/committed yet.
> > The one that fixes the above is (reversed, since i diffed new-ra to head, 
> > rather than head to new-ra):
> 
> Thanks, this fixes the problem. Improvements are moderate on my test
> case, though:
> 
>                   number of stack writes
> gcc -O1             0
> Compaq Compiler    11 (the caller saved registers)
> gcc -O3           119
> gcc -O3 -fnew-ra  101
> 
> Are you interested in the test case?
SUre, if course like, though a 20% reduction is nothing to sneeze at.


There is also a few subreg related changes to df.c that might help, if 
your test case's rtl has subregs.
*** df.c	2002-06-27 11:59:52.000000000 -0400
--- /buildspace/new-regalloc-branch/gcc/df.c	2002-05-03 15:51:05.000000000 -0400
*************** static rtx df_reg_use_gen (regno)
*** 625,631 ****
    rtx reg;
    rtx use;
  
!   reg = regno_reg_rtx[regno];
  
    use = gen_rtx_USE (GET_MODE (reg), reg);
    return use;
--- 635,642 ----
    rtx reg;
    rtx use;
  
!   reg = regno >= FIRST_PSEUDO_REGISTER
!     ? regno_reg_rtx[regno] : gen_rtx_REG (reg_raw_mode[regno], regno);
  
    use = gen_rtx_USE (GET_MODE (reg), reg);
    return use;
*************** static rtx df_reg_clobber_gen (regno)
*** 639,645 ****
    rtx reg;
    rtx use;
  
!   reg = regno_reg_rtx[regno];
  
    use = gen_rtx_CLOBBER (GET_MODE (reg), reg);
    return use;
--- 650,657 ----
    rtx reg;
    rtx use;
  
!   reg = regno >= FIRST_PSEUDO_REGISTER
!     ? regno_reg_rtx[regno] : gen_rtx_REG (reg_raw_mode[regno], regno);
  
    use = gen_rtx_CLOBBER (GET_MODE (reg), reg);
    return use;
*************** df_ref_record (df, reg, loc, insn, ref_t
*** 892,901 ****
  	 are really referenced.  E.g. a (subreg:SI (reg:DI 0) 0) does _not_
  	 reference the whole reg 0 in DI mode (which would also include
  	 reg 1, at least, if 0 and 1 are SImode registers).  */
!       endregno = regno + HARD_REGNO_NREGS (regno, GET_MODE (reg));
  
        for (i = regno; i < endregno; i++)
! 	df_ref_record_1 (df, regno_reg_rtx[i],
  			 loc, insn, ref_type, ref_flags);
      }
    else
--- 904,917 ----
  	 are really referenced.  E.g. a (subreg:SI (reg:DI 0) 0) does _not_
  	 reference the whole reg 0 in DI mode (which would also include
  	 reg 1, at least, if 0 and 1 are SImode registers).  */
!       endregno = HARD_REGNO_NREGS (regno, GET_MODE (reg));
!       if (GET_CODE (reg) == SUBREG)
!         regno += subreg_regno_offset (regno, GET_MODE (SUBREG_REG (reg)),
! 				      SUBREG_BYTE (reg), GET_MODE (reg));
!       endregno += regno;
  
        for (i = regno; i < endregno; i++)
! 	df_ref_record_1 (df, gen_rtx_REG (reg_raw_mode[i], i),
  			 loc, insn, ref_type, ref_flags);
      }
    else
*************** df_ref_record (df, reg, loc, insn, ref_t
*** 904,921 ****
      }
  }
  
! /* Writes to SUBREG of inndermode wider than word and outermode shorter than
!    word are read-modify-write.  */
  
  static inline bool
  read_modify_subreg_p (x)
       rtx x;
  {
    if (GET_CODE (x) != SUBREG)
      return false;
!   if (GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))) <= UNITS_PER_WORD)
      return false;
!   if (GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD)
      return false;
    return true;
  }
--- 920,942 ----
      }
  }
  
! /* Writes to paradoxical subregs, or subregs which are too narrow
!    are read-modify-write.  */
  
  static inline bool
  read_modify_subreg_p (x)
       rtx x;
  {
+   unsigned int isize, osize;
    if (GET_CODE (x) != SUBREG)
      return false;
!   isize = GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)));
!   osize = GET_MODE_SIZE (GET_MODE (x));
!   if (isize <= osize)
!     return true;
!   if (isize <= UNITS_PER_WORD)
      return false;
!   if (osize >= UNITS_PER_WORD)
      return false;
    return true;
  }


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