[Patch] Detect true-dependency for strict_low_part in scheduling

Hartmut Penner HPENNER@de.ibm.com
Mon Feb 24 12:20:00 GMT 2003


> > On Fri, Feb 21, 2003 at 02:08:28PM +0100, Hartmut Penner wrote:
> > > +   if (isize <= osize)
> > > +     return true;
> >
> > Not true.  Plus I think this function belongs elsewhere.  We've
> > too many places that check this sort of thing already.
> >
> > The rest is ok.
> The function is already in df.c, I think it should simply get exported
> from there (with this clause fixed as well)

Exported and changed function 'read_modify_subreg_p' in df.c.
Michael had done that last change in that function,
pls verify my changes.

> Honza
> >
> >
> >
> > r~


Index: sched-deps.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-deps.c,v
retrieving revision 1.54
diff -c -p -r1.54 sched-deps.c
*** sched-deps.c  28 Jan 2003 17:12:06 -0000    1.54
--- sched-deps.c  24 Feb 2003 08:29:30 -0000
*************** Software Foundation, 59 Temple Place - S
*** 42,47 ****
--- 42,48 ----
  #include "sched-int.h"
  #include "params.h"
  #include "cselib.h"
+ #include "df.h"

  extern char *reg_known_equiv_p;
  extern rtx *reg_known_value;
*************** sched_analyze_1 (deps, x, insn)
*** 466,471 ****
--- 467,485 ----
    while (GET_CODE (dest) == STRICT_LOW_PART || GET_CODE (dest) == SUBREG
       || GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) ==
SIGN_EXTRACT)
      {
+       if (GET_CODE (dest) == STRICT_LOW_PART
+      || GET_CODE (dest) == ZERO_EXTRACT
+      || GET_CODE (dest) == SIGN_EXTRACT
+      || read_modify_subreg_p (dest))
+         {
+       /* These both read and modify the result.  We must handle
+              them as writes to get proper dependencies for following
+              instructions.  We must handle them as reads to get proper
+              dependencies from this to previous instructions.
+              Thus we need to call sched_analyze_2. */
+
+       sched_analyze_2 (deps, XEXP (dest, 0), insn);
+     }
        if (GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) == SIGN_EXTRACT)
      {
        /* The second and third arguments are values read by this insn.  */
Index: df.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.c,v
retrieving revision 1.46
diff -c -p -r1.46 df.c
*** df.c    31 Jan 2003 23:34:12 -0000    1.46
--- df.c    24 Feb 2003 08:29:31 -0000
*************** static void hybrid_search_sbitmap PARAMS
*** 307,313 ****
                                 enum df_confluence_op,
                                 transfer_function_sbitmap,
                                 sbitmap, sbitmap, void *));
- static inline bool read_modify_subreg_p PARAMS ((rtx));


  /* Local memory allocation/deallocation routines.  */
--- 307,312 ----
*************** df_ref_record (df, reg, loc, insn, ref_t
*** 884,890 ****

  /* Return non-zero if writes to paradoxical SUBREGs, or SUBREGs which
     are too narrow, are read-modify-write.  */
! static inline bool
  read_modify_subreg_p (x)
       rtx x;
  {
--- 883,889 ----

  /* Return non-zero if writes to paradoxical SUBREGs, or SUBREGs which
     are too narrow, are read-modify-write.  */
! bool
  read_modify_subreg_p (x)
       rtx x;
  {
*************** read_modify_subreg_p (x)
*** 893,900 ****
      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)
--- 892,897 ----
Index: df.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.h,v
retrieving revision 1.15
diff -c -p -r1.15 df.h
*** df.h    26 Jan 2003 06:10:37 -0000    1.15
--- df.h    24 Feb 2003 08:29:31 -0000
*************** extern void iterative_dataflow_bitmap PA
*** 348,350 ****
--- 348,352 ----
                                     enum df_confluence_op,
                                     transfer_function_bitmap,
                                     int *, void *));
+
+ extern bool read_modify_subreg_p PARAMS ((rtx));






More information about the Gcc-patches mailing list