This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][Modulo-sched] Add new testcase
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Revital1 Eres" <ERES at il dot ibm dot com>
- Cc: "Ayal Zaks" <ZAKS at il dot ibm dot com>, "Tehila Meyzels" <TEHILA at il dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 22 Oct 2007 13:53:02 +0200
- Subject: Re: [PATCH][Modulo-sched] Add new testcase
- References: <OF9E06A6C1.DDAE7CC0-ONC2257378.006BA7EA-C225737C.0035FF3F@il.ibm.com>
On 10/22/07, Revital1 Eres <ERES@il.ibm.com> wrote:
>
> Hello,
>
> Vladimir traced a problem related to DFS traversal that occurred when
> the header of a loop was at the same time the latch of it's outer loop -
> http://gcc.gnu.org/ml/gcc/2007-06/msg00172.html. Here is snippet from
> the SMS dump file showing the problematic cfg:
>
> ;; Loop 3:
> ;; header 20, latch 7
> ;; depth 3, level 2, outer 2
> ;; nodes: 20 7 6 4
> ;;
> ;; Loop 4:
> ;; header 7, latch 7
> ;; depth 4, level 1, outer 3
> ;; nodes: 7
>
> He was working on GCC version based on gcc 4.1.1.
>
> The problem was as follows: After versioning there were two edges incident
> to the header of the problematic outer loop: the header of the original
> loop and the header of the versioned loop. The DFS traversal of the
> outer loop began in the original loop (which is the outer loop's latch)
> walking backwards and stop when the header of the outer loop was reached
> (this is how the algorithm worked) so the versioned loop was not reached.
>
> This DFS traversal was called in gcc4.1 from dump_flow_loops in
> loop_optimizer_finalize at the end of the SMS driver. In current mainline
> this call does not appear; even after adding it the fail does not happen
> because the DFS traversal from dump_flow_loops function is changed-
> instead of beginning the traversal at the latch and walking backwards
> until the header is reached; we now begins at the header and continue
> as long as a maximum threshold of nodes is reached.
>
> So, for mainline we attach the following testcase which with some tweaks
> fails on gcc4.1 (ignoring the profitability check). We also prepare a
> patch for gcc4.1 with Vladimir solution for that problem. In gcc4.2 the
> call to dump_flow_loops from loop_optimizer_finalize does not exist so
> we do not expect this fail to happen, although the DFS traversal is as
> in gcc4.1.
>
> OK for mainline?
Ok.
Thanks,
Richard.
> Thanks,
> Tehila and Revital
>
> :ADDPATCH middle-end (modulo-sched):
>
> ChangeLog:
>
> * testsuite/gcc.dg/sms-2.c: New testcase.
>
> (See attached file: patch_testcase_sms.txt)
>