]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
DEP_PRO/DEP_CON scaffolding
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 19 Aug 2014 15:31:23 +0000 (15:31 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 19 Aug 2014 15:31:23 +0000 (15:31 +0000)
gcc/
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

* sched-int.h (DEP_PRO): struct _dep's "pro" and "con" fields will
eventually be rtx_insn *, but to help with transition, for now,
convert from an access macro into a pair of functions: DEP_PRO
returning an rtx_insn * and...
(SET_DEP_PRO): New function, for use where DEP_PRO is used as an
lvalue, returning an rtx&.
(DEP_CON): Analogous changes to DEP_PRO above.
(SET_DEP_CON): Likewise.

* haifa-sched.c (create_check_block_twin): Replace DEP_CON used as
an lvalue to SET_DEP_CON.
* sched-deps.c (init_dep_1): Likewise for DEP_PRO and DEP_CON.
(sd_copy_back_deps): Likewise for DEP_CON.
(DEP_PRO): New function, adding a checked cast for now.
(DEP_CON): Likewise.
(SET_DEP_PRO): New function.
(SET_DEP_CON): Likewise.

/
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

* rtx-classes-status.txt (TODO): Add SET_DEP_PRO, SET_DEP_CON.

From-SVN: r214164

ChangeLog
gcc/ChangeLog
gcc/haifa-sched.c
gcc/sched-deps.c
gcc/sched-int.h
rtx-classes-status.txt

index 3c35216fdbd7d70efd81e42e7a73ce2b2acba367..7da62f9dcdd085af8276ae1f3e95ed362de6e4d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-08-19  David Malcolm  <dmalcolm@redhat.com>
+
+       * rtx-classes-status.txt (TODO): Add SET_DEP_PRO, SET_DEP_CON.
+
 2014-08-19  David Malcolm  <dmalcolm@redhat.com>
 
        * rtx-classes-status.txt (TODO): Add DF_REF_INSN.
index b71c1c7144f0b04b13400f6aa9de9f81b0541752..14b9a38e58d9d875d78f92a79f5f6e417c762e9e 100644 (file)
@@ -1,3 +1,23 @@
+2014-08-19  David Malcolm  <dmalcolm@redhat.com>
+
+       * sched-int.h (DEP_PRO): struct _dep's "pro" and "con" fields will
+       eventually be rtx_insn *, but to help with transition, for now,
+       convert from an access macro into a pair of functions: DEP_PRO
+       returning an rtx_insn * and...
+       (SET_DEP_PRO): New function, for use where DEP_PRO is used as an
+       lvalue, returning an rtx&.
+       (DEP_CON): Analogous changes to DEP_PRO above.
+       (SET_DEP_CON): Likewise.
+
+       * haifa-sched.c (create_check_block_twin): Replace DEP_CON used as
+       an lvalue to SET_DEP_CON.
+       * sched-deps.c (init_dep_1): Likewise for DEP_PRO and DEP_CON.
+       (sd_copy_back_deps): Likewise for DEP_CON.
+       (DEP_PRO): New function, adding a checked cast for now.
+       (DEP_CON): Likewise.
+       (SET_DEP_PRO): New function.
+       (SET_DEP_CON): Likewise.
+
 2014-08-19  Yaakov Selkowitz  <yselkowi@redhat.com>
 
        * config.gcc (*-*-cygwin*): Use __cxa_atexit by default.
index 32b1adf5bd986bb0819fd4bce93c2036df034bdf..677cabc382d19e761be57e630e9c8c6d7947dae6 100644 (file)
@@ -7947,7 +7947,7 @@ create_check_block_twin (rtx insn, bool mutate_p)
 
       if (rec != EXIT_BLOCK_PTR_FOR_FN (cfun))
        {
-         DEP_CON (new_dep) = twin;
+         SET_DEP_CON (new_dep) = twin;
          sd_add_dep (new_dep, false);
        }
     }
index 049927fe6e0900da281bc7428d3651cfb196f19c..eaa2e4e00c63eac41600cd47f83effb97cefc2eb 100644 (file)
@@ -103,8 +103,8 @@ dk_to_ds (enum reg_note dk)
 void
 init_dep_1 (dep_t dep, rtx pro, rtx con, enum reg_note type, ds_t ds)
 {
-  DEP_PRO (dep) = pro;
-  DEP_CON (dep) = con;
+  SET_DEP_PRO (dep) = pro;
+  SET_DEP_CON (dep) = con;
   DEP_TYPE (dep) = type;
   DEP_STATUS (dep) = ds;
   DEP_COST (dep) = UNKNOWN_DEP_COST;
@@ -1416,7 +1416,7 @@ sd_copy_back_deps (rtx to, rtx from, bool resolved_p)
       dep_def _new_dep, *new_dep = &_new_dep;
 
       copy_dep (new_dep, dep);
-      DEP_CON (new_dep) = to;
+      SET_DEP_CON (new_dep) = to;
       sd_add_dep (new_dep, resolved_p);
     }
 }
@@ -4915,4 +4915,24 @@ find_modifiable_mems (rtx head, rtx tail)
             success_in_block);
 }
 
+rtx_insn *DEP_PRO (dep_t dep)
+{
+  return safe_as_a <rtx_insn *> (dep->pro);
+}
+
+rtx_insn *DEP_CON (dep_t dep)
+{
+  return safe_as_a <rtx_insn *> (dep->con);
+}
+
+rtx& SET_DEP_PRO (dep_t dep)
+{
+  return dep->pro;
+}
+
+rtx& SET_DEP_CON (dep_t dep)
+{
+  return dep->con;
+}
+
 #endif /* INSN_SCHEDULING */
index fe00496faa5a0388ec8113165ed6ca3edbc3ee4e..3680889fff55fa466ea763fbfe5b5e564e549baa 100644 (file)
@@ -250,8 +250,10 @@ struct _dep
 typedef struct _dep dep_def;
 typedef dep_def *dep_t;
 
-#define DEP_PRO(D) ((D)->pro)
-#define DEP_CON(D) ((D)->con)
+extern rtx_insn *DEP_PRO (dep_t dep);
+extern rtx_insn *DEP_CON (dep_t dep);
+extern rtx& SET_DEP_PRO (dep_t dep);
+extern rtx& SET_DEP_CON (dep_t dep);
 #define DEP_TYPE(D) ((D)->type)
 #define DEP_STATUS(D) ((D)->status)
 #define DEP_COST(D) ((D)->cost)
index e4d404ffca2d9b458250ec2465f164738cbad546..b93ee593c8d098596089cdd36cc78e0387f3e0eb 100644 (file)
@@ -16,4 +16,5 @@ TODO: "Scaffolding" to be removed
 =================================
 * DF_REF_INSN
 * SET_BB_HEAD, SET_BB_END, SET_BB_HEADER, SET_BB_FOOTER
+* SET_DEP_PRO, SET_DEP_CON
 * SET_NEXT_INSN, SET_PREV_INSN