Commit 06d5d63d by Roman Zhuykov

modulo-sched: fix bootstrap compare-debug issue

This patch removes all debug insns from DDG analysis.  It fixes bootstrap
comparison failure on powerpc64le when running with -fmodulo-sched enabled.

	* ddg.c (create_ddg_dep_from_intra_loop_link): Remove assertions.
	(create_ddg_dep_no_link): Likewise.
	(add_cross_iteration_register_deps): Move debug instruction check.
	Other minor refactoring.
	(add_intra_loop_mem_dep): Do not check for debug instructions.
	(add_inter_loop_mem_dep): Likewise.
	(build_intra_loop_deps): Likewise.
	(create_ddg): Do not include debug insns into the graph.
	* ddg.h (struct ddg): Remove num_debug field.
	* modulo-sched.c (doloop_register_get): Adjust condition.
	(res_MII): Remove DDG num_debug field usage.
	(sms_schedule_by_order): Use assertion against debug insns.
	(ps_has_conflicts): Drop debug insn check.

testsuite:

    	* gcc.c-torture/execute/pr70127-debug-sms.c: New test.
    	* gcc.dg/torture/pr87197-debug-sms.c: New test.
parent 71d69548
2020-03-27 Roman Zhuykov <zhroma@ispras.ru>
* ddg.c (create_ddg_dep_from_intra_loop_link): Remove assertions.
(create_ddg_dep_no_link): Likewise.
(add_cross_iteration_register_deps): Move debug instruction check.
Other minor refactoring.
(add_intra_loop_mem_dep): Do not check for debug instructions.
(add_inter_loop_mem_dep): Likewise.
(build_intra_loop_deps): Likewise.
(create_ddg): Do not include debug insns into the graph.
* ddg.h (struct ddg): Remove num_debug field.
* modulo-sched.c (doloop_register_get): Adjust condition.
(res_MII): Remove DDG num_debug field usage.
(sms_schedule_by_order): Use assertion against debug insns.
(ps_has_conflicts): Drop debug insn check.
2020-03-26 Richard Earnshaw <rearnsha@arm.com>
PR target/94220
......
......@@ -116,9 +116,6 @@ struct ddg
int num_loads;
int num_stores;
/* Number of debug instructions in the BB. */
int num_debug;
/* This array holds the nodes in the graph; it is indexed by the node
cuid, which follows the order of the instructions in the BB. */
ddg_node_ptr nodes;
......
......@@ -369,7 +369,7 @@ doloop_register_get (rtx_insn *head, rtx_insn *tail)
: prev_nondebug_insn (tail));
for (insn = head; insn != first_insn_not_to_check; insn = NEXT_INSN (insn))
if (!DEBUG_INSN_P (insn) && reg_mentioned_p (reg, insn))
if (NONDEBUG_INSN_P (insn) && reg_mentioned_p (reg, insn))
{
if (dump_file)
{
......@@ -428,7 +428,7 @@ res_MII (ddg_ptr g)
if (targetm.sched.sms_res_mii)
return targetm.sched.sms_res_mii (g);
return ((g->num_nodes - g->num_debug) / issue_rate);
return g->num_nodes / issue_rate;
}
......@@ -2152,11 +2152,7 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order)
ddg_node_ptr u_node = &ps->g->nodes[u];
rtx_insn *insn = u_node->insn;
if (!NONDEBUG_INSN_P (insn))
{
bitmap_clear_bit (tobe_scheduled, u);
continue;
}
gcc_checking_assert (NONDEBUG_INSN_P (insn));
if (bitmap_bit_p (sched_nodes, u))
continue;
......@@ -3158,9 +3154,6 @@ ps_has_conflicts (partial_schedule_ptr ps, int from, int to)
{
rtx_insn *insn = ps_rtl_insn (ps, crr_insn->id);
if (!NONDEBUG_INSN_P (insn))
continue;
/* Check if there is room for the current insn. */
if (!can_issue_more || state_dead_lock_p (curr_state))
return true;
......
2020-03-26 Marek Polacek <polacek@redhat.com>
2020-03-27 Roman Zhuykov <zhroma@ispras.ru>
* gcc.c-torture/execute/pr70127-debug-sms.c: New test.
* gcc.dg/torture/pr87197-debug-sms.c: New test.
2020-03-27 Marek Polacek <polacek@redhat.com>
PR c++/94336 - template keyword accepted before destructor names.
* g++.dg/template/template-keyword2.C: New test.
......
/* { dg-additional-options "-fcompare-debug -fmodulo-sched" } */
struct S { int f; signed int g : 2; } a[1], c = {5, 1}, d;
short b;
__attribute__((noinline, noclone)) void
foo (int x)
{
if (x != 1)
__builtin_abort ();
}
int
main ()
{
while (b++ <= 0)
{
struct S e = {1, 1};
d = e = a[0] = c;
}
foo (a[0].g);
return 0;
}
/* { dg-do compile } */
/* { dg-additional-options "-fcompare-debug -fmodulo-sched --param sms-min-sc=1" } */
int a, c, e, f, g;
void
h (int i)
{
a = i;
}
void
j (char *i, long k)
{
while (k--)
c = *i++;
}
void
l (unsigned char *i, long k)
{
unsigned char *b = i + k;
while (i < b)
{
h (*i);
i++;
}
}
void
m ()
{
while (e)
{
float d = g;
l ((char *) &d, sizeof (g));
if (f)
j ((char *) &d, sizeof (g));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment