#include "output.h"
#include "basic-block.h"
#include "cselib.h"
+#include "target.h"
+
+#ifdef INSN_SCHEDULING
#include "sel-sched-ir.h"
#include "sel-sched-dump.h"
\f
switch_dump (FILE *to)
{
gcc_assert (saved_sched_dump == NULL);
-
+
saved_sched_dump = sched_dump;
sched_dump = to;
}
}
\f
-/* Functions for dumping instructions, av sets, and exprs. */
+/* Functions for dumping instructions, av sets, and exprs. */
/* Default flags for dumping insns. */
static int dump_insn_rtx_flags = DUMP_INSN_RTX_PATTERN;
{
switch_dump (stderr);
dump_vinsn_1 (vi, debug_vinsn_flags);
- sel_print ("\n");
+ sel_print ("\n");
restore_dump ();
}
if (orig_bb != 0)
sel_print ("orig_bb:%d;", orig_bb);
}
-
+
if (EXPR_TARGET_AVAILABLE (expr) < 1)
sel_print ("target:%d;", EXPR_TARGET_AVAILABLE (expr));
sel_print ("]");
{
av_set_iterator i;
expr_t expr;
-
+
if (!sched_dump_to_dot_p)
sel_print ("{");
-
+
FOR_EACH_EXPR (expr, i, av)
{
dump_expr (expr);
else
sel_print ("\n");
}
-
+
if (!sched_dump_to_dot_p)
sel_print ("}");
}
unsigned i;
reg_set_iterator rsi;
int count = 0;
-
+
EXECUTE_IF_SET_IN_REG_SET (lv, 0, i, rsi)
{
sel_print (" %d", i);
sel_print (" [%s]", reg_names[i]);
++count;
}
-
+
++count;
-
+
if (sched_dump_to_dot_p && count == 12)
{
count = 0;
}
}
}
-
+
sel_print ("}\n");
}
for (; bnds; bnds = BLIST_NEXT (bnds))
{
bnd_t bnd = BLIST_BND (bnds);
-
+
sel_print ("[to: %d; ptr: ", INSN_UID (BND_TO (bnd)));
dump_ilist (BND_PTR (bnd));
sel_print ("] ");
{
int i;
rtx succ;
-
+
for (i = 0; VEC_iterate (rtx, succs, i, succ); i++)
if (succ)
dump_insn (succ);
{
static char buf[80];
- /* '+' before insn means it is a new cycle start and it's not been
+ /* '+' before insn means it is a new cycle start and it's not been
scheduled yet. '>' - has been scheduled. */
if (s_i_d && INSN_LUID (insn) > 0)
if (GET_MODE (insn) == TImode)
- sprintf (buf, "%s %4d",
- INSN_SCHED_TIMES (insn) > 0 ? "> " : "< ",
+ sprintf (buf, "%s %4d",
+ INSN_SCHED_TIMES (insn) > 0 ? "> " : "< ",
INSN_UID (insn));
else
- sprintf (buf, "%s %4d",
- INSN_SCHED_TIMES (insn) > 0 ? "! " : " ",
+ sprintf (buf, "%s %4d",
+ INSN_SCHED_TIMES (insn) > 0 ? "! " : " ",
INSN_UID (insn));
else
if (GET_MODE (insn) == TImode)
do
{
p = strstr (p, str1);
- if (p)
+ if (p)
{
char *p1 = p + str1_len;
/* Copy the rest of buf and '\0'. */
/* Copy str2. */
for (i = 0; i < str2_len; i++)
p[i] = str2[i];
-
+
p += str2_len;
buf_len += diff;
}
{
static char specials_from[7][2] = { "<", ">", "{", "|", "}", "\"",
"\n" };
- static char specials_to[7][3] = { "\\<", "\\>", "\\{", "\\|", "\\}",
+ static char specials_to[7][3] = { "\\<", "\\>", "\\{", "\\|", "\\}",
"\\\"", "\\l" };
unsigned i;
sched_dump_to_dot_p = false;
}
-/* Dump a cfg region to the file specified by TAG honoring flags.
+/* Dump a cfg region to the file specified by TAG honoring flags.
The file is created by the function. */
static void
sel_dump_cfg_1 (const char *tag, int flags)
debug_mem_addr_value (rtx x)
{
rtx t, addr;
+ enum machine_mode address_mode;
gcc_assert (MEM_P (x));
+ address_mode = targetm.addr_space.address_mode (MEM_ADDR_SPACE (x));
+
t = shallow_copy_rtx (x);
- if (cselib_lookup (XEXP (t, 0), Pmode, 0))
+ if (cselib_lookup (XEXP (t, 0), address_mode, 0))
XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0));
t = canon_rtx (t);
debug_rtx (addr);
return t;
}
-
+#endif