This is the mail archive of the 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] Improve handling of COND_EXECs in haifa_classify_insn.

Alexander Monakov wrote:

This patch has been in sel-sched branch for a while. It makes haifa_classify_insn look into predicate and code parts of COND_EXEC to decide whether it traps or not, instead of assuming that all COND_EXECs trap. It also factors code duplication in handling of PARALLELs (by using recursion).

Bootstrapped and regtested on x64_64 with --disable-multilib and on ia64.


I don't have the authority to approve the patch, so below are merely my suggestions to improve it.


    * gcc/haifa-sched.c (haifa_classify_insn): Rename to ...
    (haifa_classify_insn_pat): ... this.  Re-structure.  Improve handling
    of COND_EXECs.  Use it ...
    * gcc/sched-int.h (haifa_classify_insn): ... Here.  Reimplement.

--- gcc/haifa-sched.c    (revision 31645)
+++ gcc/haifa-sched.c    (local)


-haifa_classify_insn (const_rtx insn)
+haifa_classify_insn_pat (rtx pat)

Do you really want to remove const_rtx?

--- gcc/sched-int.h    (revision 31645)
+++ gcc/sched-int.h    (local)
@@ -829,7 +829,14 @@ extern ds_t ds_merge (ds_t, ds_t);
 extern void debug_ds (ds_t);

 /* Functions in haifa-sched.c.  */
-extern int haifa_classify_insn (const_rtx);
+extern int haifa_classify_insn_pat (rtx);
+static inline int
+haifa_classify_insn (const_rtx insn)
+  return haifa_classify_insn_pat (PATTERN (insn));

I wouldn't recommend using inline function in this case.

IMHO, you should move haifa_classify_insn () back to haifa-sched.c, rename haifa_classify_insn_pat () to haifa_classify_expr () and make the latter static.

-- Maxim

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