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]

Re: [Patch] Detect true-dependency for strict_low_part in scheduling


> The function is already in df.c, I think it should simply get exported
> from there (with this clause fixed as well)

> Honza

Commited code to trunk, what about 3.3 branch ?

      Hartmut

ChangeLog

  * df.c (read_modify_subreg_p): Change from static to global.
  * df.h (read_modify_subreg_p): Add prototype.
  * sched-deps.c (sched_analyze_1): Generate true dependency for
  strict_low_part, certain subregs and zero/sign_extract.

Index: sched-deps.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-deps.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -c -p -r1.55 -r1.56
*** sched-deps.c  25 Feb 2003 20:40:56 -0000    1.55
--- sched-deps.c  11 Mar 2003 09:17:38 -0000    1.56
*************** 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)
*** 468,473 ****
--- 469,487 ----
    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.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -c -p -r1.16 -r1.17
*** df.h    7 Mar 2003 22:06:16 -0000     1.16
--- df.h    11 Mar 2003 09:17:37 -0000    1.17
*************** extern void iterative_dataflow_bitmap PA
*** 353,355 ****
--- 353,356 ----
                                     enum df_confluence_op,
                                     transfer_function_bitmap,
                                     int *, void *));
+ extern bool read_modify_subreg_p PARAMS ((rtx));
Index: df.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -c -p -r1.47 -r1.48
*** df.c    7 Mar 2003 22:06:16 -0000     1.47
--- df.c    11 Mar 2003 09:17:37 -0000    1.48
*************** 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
*** 885,891 ****

  /* 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;
  {
--- 884,890 ----

  /* 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;
  {


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