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: [PING][PATCH][Modulo-sched] Add dump info


Revital1 Eres/Haifa/IBM wrote on 07/10/2007 17:20:53:

> Hello,
>
> http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00117.html
>
> Thanks,
> Revital

ok, with minor comments below.

Ayal.


> Index: modulo-sched.c
> ===================================================================
> --- modulo-sched.c   (revision 128689)
> +++ modulo-sched.c   (working copy)
> @@ -1105,6 +1105,16 @@
>      ASAP.  */
>        set_node_sched_params (g);
>
> +      if (dump_file)
> +       {
> +         int i;
> +
> +         fprintf (dump_file, "SMS final nodes order: \n");
> +         for (i = 0; i < g->num_nodes; i++)
> +           fprintf (dump_file, "%d ", node_order[i]);
> +         fprintf (dump_file, "\n");
> +       }
> +

Better place this at the end of sms_order_nodes, perhaps at the beginning
of check_nodes_order().

>        ps = sms_schedule_by_order (g, mii, maxii, node_order);
>
>        if (ps)
> @@ -1331,21 +1341,29 @@
>                print_ddg_edge (dump_file, e);
>           fprintf (dump_file,
>               "\nScheduling %d (%d) in psp_not_empty,"
> -             " checking node %d (%d): ", u_node->cuid,
> +             " checking p %d (%d): ", u_node->cuid,
>               INSN_UID (u_node->insn), v_node->cuid, INSN_UID
>               (v_node->insn));
>              }
>
>       if (TEST_BIT (sched_nodes, v_node->cuid))
>         {
> -         int node_st = SCHED_TIME (v_node)
> -                   + e->latency - (e->distance * ii);
> +              int p_st = SCHED_TIME (v_node);
>
> -         early_start = MAX (early_start, node_st);
> +              if (dump_file)
> +                fprintf (dump_file, "pred st = %d; ", p_st);
>
> +              early_start =
> +                MAX (early_start, p_st + e->latency - (e->distance *
ii));
> +
> +              if (dump_file)
> +                fprintf (dump_file, "early_start = %d;", early_start);
> +

Better combine the above two printf's under one if (dump_file).

>           if (e->data_type == MEM_DEP)
>        end = MIN (end, SCHED_TIME (v_node) + ii - 1);
>         }
> +         else if (dump_file)
> +            fprintf (dump_file, "the node is not scheduled\n");
>     }
>        start = early_start;
>        end = MIN (end, early_start + ii);
> @@ -1372,19 +1390,23 @@
>                print_ddg_edge (dump_file, e);
>                fprintf (dump_file,
>                         "\nScheduling %d (%d) in pss_not_empty,"
> -                       " checking node %d (%d): ", u_node->cuid,
> +                       " checking s %d (%d): ", u_node->cuid,
>                         INSN_UID (u_node->insn), v_node->cuid, INSN_UID
>                         (v_node->insn));
>              }
>
>       if (TEST_BIT (sched_nodes, v_node->cuid))
>         {
> -         late_start = MIN (late_start,
> -            SCHED_TIME (v_node) - e->latency
> -            + (e->distance * ii));
> -               if (dump_file)
> -                 fprintf (dump_file, "late_start = %d;", late_start);
> +              int s_st = SCHED_TIME (v_node);
>
> +              if (dump_file)
> +                fprintf (dump_file, "succ st = %d; ", s_st);
> +
> +              late_start = MIN (late_start,
> +                                s_st - e->latency + (e->distance * ii));
> +              if (dump_file)
> +                fprintf (dump_file, "late_start = %d;", late_start);
> +
>           if (e->data_type == MEM_DEP)
>        end = MAX (end, SCHED_TIME (v_node) - ii + 1);
>               if (dump_file)

Better combine the above three printf's under one if (dump_file).

> @@ -1430,12 +1452,24 @@
>
>       if (TEST_BIT (sched_nodes, v_node->cuid))
>         {
> +              int p_st = SCHED_TIME (v_node);
> +
> +              if (dump_file)
> +                 fprintf (dump_file, "pred st = %d; ", p_st);
> +
>           early_start = MAX (early_start,
> -             SCHED_TIME (v_node) + e->latency
> +             p_st + e->latency
>               - (e->distance * ii));
> +
> +                    if (dump_file)
> +                 fprintf (dump_file, "early_start = %d;", early_start);
> +

Better combine the above two printf's under one if (dump_file).

>           if (e->data_type == MEM_DEP)
>        end = MIN (end, SCHED_TIME (v_node) + ii - 1);
>         }
> +          else if (dump_file)
> +            fprintf (dump_file, "the node is not scheduled\n");
> +
>     }
>        for (e = u_node->out; e != 0; e = e->next_out)
>     {
> @@ -1454,12 +1488,23 @@
>
>       if (TEST_BIT (sched_nodes, v_node->cuid))
>         {
> -         late_start = MIN (late_start,
> -            SCHED_TIME (v_node) - e->latency
> +              int s_st = SCHED_TIME (v_node);
> +
> +               if (dump_file)
> +                 fprintf (dump_file, "succ st = %d; ", s_st);
> +
> +          late_start = MIN (late_start,
> +            s_st - e->latency
>              + (e->distance * ii));
> +               if (dump_file)
> +                 fprintf (dump_file, "late_start = %d;", late_start);
> +

Better combine the above two printf's under one if (dump_file).

>           if (e->data_type == MEM_DEP)
>        start = MAX (start, SCHED_TIME (v_node) - ii + 1);
>         }
> +          else if (dump_file)
> +            fprintf (dump_file, "the node is not scheduled\n");
> +
>     }
>        start = MAX (start, early_start);
>        end = MIN (end, MIN (early_start + ii, late_start + 1));
> @@ -1993,7 +2038,15 @@
>                 HEIGHT (e->dest) + e->latency);
>       }
>      }
> +  if (dump_file)
> +    for (u = num_nodes - 1; u > -1; u--)
> +      {
> +        ddg_node_ptr u_node = &g->nodes[u];
>
> +        fprintf (dump_file, "node %d, ASAP: %d, ALAP: %d, HEIGHT: %d\n",
u,
> +                 ASAP (u_node), ALAP (u_node), HEIGHT (u_node));
> +      }
> +

Any particular reason why you prefer to print the nodes backwards?

>    return node_order_params_arr;
>  }
>


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