Merge lp:~eres/gcc-linaro/sms_fix_mem_dep-4.6 into lp:gcc-linaro/4.6

Proposed by Revital Eres
Status: Merged
Approved by: Richard Sandiford
Approved revision: no longer in the source branch.
Merged at revision: 106770
Proposed branch: lp:~eres/gcc-linaro/sms_fix_mem_dep-4.6
Merge into: lp:gcc-linaro/4.6
Diff against target: 144 lines (+110/-2)
3 files modified
ChangeLog.linaro (+9/-0)
gcc/ddg.c (+41/-2)
gcc/testsuite/gcc.dg/sms-9.c (+60/-0)
To merge this branch: bzr merge lp:~eres/gcc-linaro/sms_fix_mem_dep-4.6
Reviewer Review Type Date Requested Status
Richard Sandiford Approve
Review via email: mp+66769@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild has taken a snapshot of this branch at r106767 and queued it for build.

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.6+bzr106767~eres~sms_fix_mem_dep-4.6.tar.xdelta3.xz

and will be built on the following builders:
 a9-builder armv5-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.6+bzr106767~eres~sms_fix_mem_dep-4.6
cbuild-ancestor: lp:gcc-linaro/4.6+bzr106766
cbuild-state: check

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on x86_64-natty-cbuild148-oort1-x86_64r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106767~eres~sms_fix_mem_dep-4.6/logs/x86_64-natty-cbuild148-oort1-x86_64r1

The test suite results changed compared to the branch point lp:gcc-linaro/4.6+bzr106766:
 +PASS: gcc.dg/sms-9.c execution test
 +PASS: gcc.dg/sms-9.c (test for excess errors)

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106767~eres~sms_fix_mem_dep-4.6/logs/x86_64-natty-cbuild148-oort1-x86_64r1/gcc-testsuite.txt

cbuild-checked: x86_64-natty-cbuild148-oort1-x86_64r1

Revision history for this message
Ramana Radhakrishnan (ramana) wrote :

The default bootstrap and test doesn't check sms. My understanding was that the original patches on FSF trunk made sure that trunk bootstrapped with SMS. Should we regularly bootstrap with SMS turned on ?

cheers
Ramana

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on armv7l-natty-cbuild148-ursa4-cortexa9r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106767~eres~sms_fix_mem_dep-4.6/logs/armv7l-natty-cbuild148-ursa4-cortexa9r1

The test suite results changed compared to the branch point lp:gcc-linaro/4.6+bzr106766:
 +PASS: gcc.dg/sms-9.c execution test
 +PASS: gcc.dg/sms-9.c (test for excess errors)

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106767~eres~sms_fix_mem_dep-4.6/logs/armv7l-natty-cbuild148-ursa4-cortexa9r1/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild148-ursa4-cortexa9r1

Revision history for this message
Revital Eres (eres) wrote :

> The default bootstrap and test doesn't check sms. My understanding was that
> the original patches on FSF trunk made sure that trunk bootstrapped with SMS.

Right, the patches sent upstream are tested on ARM machine using bootstrap with SMS flags enabled.

> Should we regularly bootstrap with SMS turned on ?

If we have spare resources then yes. Please note that I usually do bootstrap on 4 different flavors of ARM, configuring with and without the following two flags --with-arch=armv7-a --with-mode=thumb. Also, I'm currently looking into another bootstrap failure on ARM machine exposed in recent trunk so once that will be resolved we can consider this issue again.

Revision history for this message
Michael Hope (michaelh1) wrote :

It's straight forward to run certain configurations, say, once a week. Let me know how to do a SMS bootstrap and what FSF or Linaro branches you'd like done.

Revision history for this message
Revital Eres (eres) wrote :

> It's straight forward to run certain configurations, say, once a week. Let me
> know how to do a SMS bootstrap and what FSF or Linaro branches you'd like
> done.

This is the command to bootstrap with SMS flags:

make -j 2 bootstrap BOOT_CFLAGS="-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fno-auto-inc-dec --param sms-min-sc=1"

I would prefer to test FSF trunk with the following configuration options: (I'm usually testing only c language)

--enable-checking --enable-bootstrap --enable-languages=c [--with-mode=thumb --with-arch=armv7-a]

Thanks,
Revital

Revision history for this message
Michael Hope (michaelh1) wrote :

I've added support for building a SMS variant and have the latest gcc-linaro-4.6 and gcc trunk to build once a week on all hosts.

I've spawned a test run. The results should appear here:
 http://ex.seabright.co.nz/build/gcc-4.7~svn175904%5Esms/

We'll also be able to diff between the plain bootstrap and SMS bootstrap to check for introduced errors.

Revision history for this message
Revital Eres (eres) wrote :

> I've spawned a test run. The results should appear here:
> http://ex.seabright.co.nz/build/gcc-4.7~svn175904%5Esms/
>
Thanks.

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on armv7l-natty-cbuild149-ursa3-armv5r2.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106767~eres~sms_fix_mem_dep-4.6/logs/armv7l-natty-cbuild149-ursa3-armv5r2

The test suite results changed compared to the branch point lp:gcc-linaro/4.6+bzr106766:
 +PASS: gcc.dg/sms-9.c execution test
 +PASS: gcc.dg/sms-9.c (test for excess errors)

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106767~eres~sms_fix_mem_dep-4.6/logs/armv7l-natty-cbuild149-ursa3-armv5r2/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild149-ursa3-armv5r2

Revision history for this message
Richard Sandiford (rsandifo) wrote :

OK. When you do the merge, could you add something to the changelog to
say that it's a backport from mainline?

review: Approve
Revision history for this message
Revital Eres (eres) wrote :

> OK. When you do the merge, could you add something to the changelog to
> say that it's a backport from mainline?

Sure, I will do that.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog.linaro'
2--- ChangeLog.linaro 2011-07-03 09:08:14 +0000
3+++ ChangeLog.linaro 2011-07-04 11:11:57 +0000
4@@ -1,3 +1,12 @@
5+2011-07-04 Revital Eres <revital.eres@linaro.org>
6+
7+ gcc/
8+ * ddg.c (add_intra_loop_mem_dep): New function.
9+ (build_intra_loop_deps): Call it.
10+
11+ gcc/testsuite
12+ * gcc.dg/sms-9.c: New file.
13+
14 2011-07-03 Ira Rosen <ira.rosen@linaro.org>
15
16 Backport from FSF:
17
18=== modified file 'gcc/ddg.c'
19--- gcc/ddg.c 2011-05-13 16:03:40 +0000
20+++ gcc/ddg.c 2011-07-04 11:11:57 +0000
21@@ -390,6 +390,33 @@
22 &PATTERN (insn2));
23 }
24
25+/* Given two nodes, analyze their RTL insns and add intra-loop mem deps
26+ to ddg G. */
27+static void
28+add_intra_loop_mem_dep (ddg_ptr g, ddg_node_ptr from, ddg_node_ptr to)
29+{
30+
31+ if ((from->cuid == to->cuid)
32+ || !insns_may_alias_p (from->insn, to->insn))
33+ /* Do not create edge if memory references have disjoint alias sets
34+ or 'to' and 'from' are the same instruction. */
35+ return;
36+
37+ if (mem_write_insn_p (from->insn))
38+ {
39+ if (mem_read_insn_p (to->insn))
40+ create_ddg_dep_no_link (g, from, to,
41+ DEBUG_INSN_P (to->insn)
42+ ? ANTI_DEP : TRUE_DEP, MEM_DEP, 0);
43+ else
44+ create_ddg_dep_no_link (g, from, to,
45+ DEBUG_INSN_P (to->insn)
46+ ? ANTI_DEP : OUTPUT_DEP, MEM_DEP, 0);
47+ }
48+ else if (!mem_read_insn_p (to->insn))
49+ create_ddg_dep_no_link (g, from, to, ANTI_DEP, MEM_DEP, 0);
50+}
51+
52 /* Given two nodes, analyze their RTL insns and add inter-loop mem deps
53 to ddg G. */
54 static void
55@@ -477,10 +504,22 @@
56 if (DEBUG_INSN_P (j_node->insn))
57 continue;
58 if (mem_access_insn_p (j_node->insn))
59- /* Don't bother calculating inter-loop dep if an intra-loop dep
60- already exists. */
61+ {
62+ /* Don't bother calculating inter-loop dep if an intra-loop dep
63+ already exists. */
64 if (! TEST_BIT (dest_node->successors, j))
65 add_inter_loop_mem_dep (g, dest_node, j_node);
66+ /* If -fmodulo-sched-allow-regmoves
67+ is set certain anti-dep edges are not created.
68+ It might be that these anti-dep edges are on the
69+ path from one memory instruction to another such that
70+ removing these edges could cause a violation of the
71+ memory dependencies. Thus we add intra edges between
72+ every two memory instructions in this case. */
73+ if (flag_modulo_sched_allow_regmoves
74+ && !TEST_BIT (dest_node->predecessors, j))
75+ add_intra_loop_mem_dep (g, j_node, dest_node);
76+ }
77 }
78 }
79 }
80
81=== added file 'gcc/testsuite/gcc.dg/sms-9.c'
82--- gcc/testsuite/gcc.dg/sms-9.c 1970-01-01 00:00:00 +0000
83+++ gcc/testsuite/gcc.dg/sms-9.c 2011-07-04 11:11:57 +0000
84@@ -0,0 +1,60 @@
85+/* { dg-do run } */
86+/* { dg-options "-O2 -fmodulo-sched -fno-auto-inc-dec -O2 -fmodulo-sched-allow-regmoves" } */
87+
88+#include <stdlib.h>
89+#include <stdarg.h>
90+
91+struct df_ref_info
92+{
93+ unsigned int *begin;
94+ unsigned int *count;
95+};
96+
97+extern void *memset (void *s, int c, __SIZE_TYPE__ n);
98+
99+
100+__attribute__ ((noinline))
101+ int
102+ df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info,
103+ int num, unsigned int start)
104+{
105+ unsigned int m = num;
106+ unsigned int offset = 77;
107+ unsigned int r;
108+
109+ for (r = start; r < m; r++)
110+ {
111+ ref_info->begin[r] = offset;
112+ offset += ref_info->count[r];
113+ ref_info->count[r] = 0;
114+ }
115+
116+ return offset;
117+}
118+
119+int
120+main ()
121+{
122+ struct df_ref_info temp;
123+ int num = 100;
124+ unsigned int start = 5;
125+ int i, offset;
126+
127+ temp.begin = malloc (100 * sizeof (unsigned int));
128+ temp.count = malloc (100 * sizeof (unsigned int));
129+
130+ memset (temp.begin, 0, sizeof (unsigned int) * num);
131+ memset (temp.count, 0, sizeof (unsigned int) * num);
132+
133+ for (i = 0; i < num; i++)
134+ temp.count[i] = i + 1;
135+
136+ offset = df_reorganize_refs_by_reg_by_insn (&temp, num, start);
137+
138+ if (offset != 5112)
139+ abort ();
140+
141+ free (temp.begin);
142+ free (temp.count);
143+ return 0;
144+}

Subscribers

People subscribed via source and target branches