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] Modulo-scheduling improvements. Print the SCCs and add check.

Revital1 Eres/Haifa/IBM wrote on 02/07/2007 17:03:36:

> Hello,
> This patch adds a sanity-check for the sccs (testcase 20050330-1.c fails
> with this check if we do not fix the initialization of scc_nodes sbitmap
>; and also prints
> them to the dump file.
> It was bootstrapped and tested on ppc64 and x86_64 with -fmodulo-sched.
> OK for mainline?

Yes, with the following comments, the last of which requires re-testing.

+/* Check the SCCS.  */

Not a very useful comment.  Better explain what is checked - that every
element of NUM_NODES belongs to exactly one element of SCCS, and that no
element of SCCS is empty

+static void
+check_sccs (ddg_all_sccs_ptr sccs, int num_nodes)
+  int i = 0;
+  sbitmap tmp = sbitmap_alloc (num_nodes);
+  sbitmap_zero (tmp);
+  for (i = 0; i < sccs->num_sccs; i++)
+    {
+      /* Verify that every node in sccs is in exactly one strongly
+         connected component.  */
+      gcc_assert (!sbitmap_empty_p (sccs->sccs[i]->nodes)
+                  && !sbitmap_any_common_bits (tmp,

Better split this into two separate gcc_assert's.

+      sbitmap_a_or_b (tmp, tmp, sccs->sccs[i]->nodes);
+    }

Should also check that all bits in tmp are now set, i.e. every node belongs
to some scc. This addition requires retesting.

Thanks, Ayal.

+  sbitmap_free (tmp);

> :ADDPATCH modulo-sched:
> Thanks,
> Revital
> 2007-07-02  Revital Eres  <>
>         * ddg.c (print_sccs): New function.
>         (check_sccs): New function.
>         (create_ddg_all_sccs): Use it.
>         * ddg.h (print_sccs): Declare.
>         * modulo-sched.c (sms_order_nodes): Call print_sccs.
> [attachment "patch_sccs_sms_7_2.txt" deleted by Ayal Zaks/Haifa/IBM]

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