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
=== modified file 'ChangeLog.linaro'
--- ChangeLog.linaro 2011-07-03 09:08:14 +0000
+++ ChangeLog.linaro 2011-07-04 11:11:57 +0000
@@ -1,3 +1,12 @@
12011-07-04 Revital Eres <revital.eres@linaro.org>
2
3 gcc/
4 * ddg.c (add_intra_loop_mem_dep): New function.
5 (build_intra_loop_deps): Call it.
6
7 gcc/testsuite
8 * gcc.dg/sms-9.c: New file.
9
12011-07-03 Ira Rosen <ira.rosen@linaro.org>102011-07-03 Ira Rosen <ira.rosen@linaro.org>
211
3 Backport from FSF:12 Backport from FSF:
413
=== modified file 'gcc/ddg.c'
--- gcc/ddg.c 2011-05-13 16:03:40 +0000
+++ gcc/ddg.c 2011-07-04 11:11:57 +0000
@@ -390,6 +390,33 @@
390 &PATTERN (insn2));390 &PATTERN (insn2));
391}391}
392392
393/* Given two nodes, analyze their RTL insns and add intra-loop mem deps
394 to ddg G. */
395static void
396add_intra_loop_mem_dep (ddg_ptr g, ddg_node_ptr from, ddg_node_ptr to)
397{
398
399 if ((from->cuid == to->cuid)
400 || !insns_may_alias_p (from->insn, to->insn))
401 /* Do not create edge if memory references have disjoint alias sets
402 or 'to' and 'from' are the same instruction. */
403 return;
404
405 if (mem_write_insn_p (from->insn))
406 {
407 if (mem_read_insn_p (to->insn))
408 create_ddg_dep_no_link (g, from, to,
409 DEBUG_INSN_P (to->insn)
410 ? ANTI_DEP : TRUE_DEP, MEM_DEP, 0);
411 else
412 create_ddg_dep_no_link (g, from, to,
413 DEBUG_INSN_P (to->insn)
414 ? ANTI_DEP : OUTPUT_DEP, MEM_DEP, 0);
415 }
416 else if (!mem_read_insn_p (to->insn))
417 create_ddg_dep_no_link (g, from, to, ANTI_DEP, MEM_DEP, 0);
418}
419
393/* Given two nodes, analyze their RTL insns and add inter-loop mem deps420/* Given two nodes, analyze their RTL insns and add inter-loop mem deps
394 to ddg G. */421 to ddg G. */
395static void422static void
@@ -477,10 +504,22 @@
477 if (DEBUG_INSN_P (j_node->insn))504 if (DEBUG_INSN_P (j_node->insn))
478 continue;505 continue;
479 if (mem_access_insn_p (j_node->insn))506 if (mem_access_insn_p (j_node->insn))
480 /* Don't bother calculating inter-loop dep if an intra-loop dep507 {
481 already exists. */508 /* Don't bother calculating inter-loop dep if an intra-loop dep
509 already exists. */
482 if (! TEST_BIT (dest_node->successors, j))510 if (! TEST_BIT (dest_node->successors, j))
483 add_inter_loop_mem_dep (g, dest_node, j_node);511 add_inter_loop_mem_dep (g, dest_node, j_node);
512 /* If -fmodulo-sched-allow-regmoves
513 is set certain anti-dep edges are not created.
514 It might be that these anti-dep edges are on the
515 path from one memory instruction to another such that
516 removing these edges could cause a violation of the
517 memory dependencies. Thus we add intra edges between
518 every two memory instructions in this case. */
519 if (flag_modulo_sched_allow_regmoves
520 && !TEST_BIT (dest_node->predecessors, j))
521 add_intra_loop_mem_dep (g, j_node, dest_node);
522 }
484 }523 }
485 }524 }
486 }525 }
487526
=== added file 'gcc/testsuite/gcc.dg/sms-9.c'
--- gcc/testsuite/gcc.dg/sms-9.c 1970-01-01 00:00:00 +0000
+++ gcc/testsuite/gcc.dg/sms-9.c 2011-07-04 11:11:57 +0000
@@ -0,0 +1,60 @@
1/* { dg-do run } */
2/* { dg-options "-O2 -fmodulo-sched -fno-auto-inc-dec -O2 -fmodulo-sched-allow-regmoves" } */
3
4#include <stdlib.h>
5#include <stdarg.h>
6
7struct df_ref_info
8{
9 unsigned int *begin;
10 unsigned int *count;
11};
12
13extern void *memset (void *s, int c, __SIZE_TYPE__ n);
14
15
16__attribute__ ((noinline))
17 int
18 df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info,
19 int num, unsigned int start)
20{
21 unsigned int m = num;
22 unsigned int offset = 77;
23 unsigned int r;
24
25 for (r = start; r < m; r++)
26 {
27 ref_info->begin[r] = offset;
28 offset += ref_info->count[r];
29 ref_info->count[r] = 0;
30 }
31
32 return offset;
33}
34
35int
36main ()
37{
38 struct df_ref_info temp;
39 int num = 100;
40 unsigned int start = 5;
41 int i, offset;
42
43 temp.begin = malloc (100 * sizeof (unsigned int));
44 temp.count = malloc (100 * sizeof (unsigned int));
45
46 memset (temp.begin, 0, sizeof (unsigned int) * num);
47 memset (temp.count, 0, sizeof (unsigned int) * num);
48
49 for (i = 0; i < num; i++)
50 temp.count[i] = i + 1;
51
52 offset = df_reorganize_refs_by_reg_by_insn (&temp, num, start);
53
54 if (offset != 5112)
55 abort ();
56
57 free (temp.begin);
58 free (temp.count);
59 return 0;
60}

Subscribers

People subscribed via source and target branches