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

Proposed by Revital Eres
Status: Merged
Approved by: Ulrich Weigand
Approved revision: no longer in the source branch.
Merged at revision: 99528
Proposed branch: lp:~eres/gcc-linaro/sms_fix_mem_dep
Merge into: lp:gcc-linaro/4.5
Diff against target: 151 lines (+113/-2) (has conflicts)
3 files modified
ChangeLog.linaro (+12/-0)
gcc/ddg.c (+41/-2)
gcc/testsuite/gcc.dg/sms-9.c (+60/-0)
Text conflict in ChangeLog.linaro
To merge this branch: bzr merge lp:~eres/gcc-linaro/sms_fix_mem_dep
Reviewer Review Type Date Requested Status
Ulrich Weigand (community) Approve
Linaro Toolchain Builder Pending
Review via email: mp+66870@code.launchpad.net

This proposal supersedes a proposal from 2011-07-04.

Description of the change

SMS patch backport from mainline (*):

http://gcc.gnu.org/ml/gcc-cvs/2011-06/msg00579.html

http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00960.html

(*)The branch contains the following change compared to the patch committed to trunk: Call insn_alias_sets_conflict_p function instead of insns_may_alias_p, as ddg.c uses insn_alias_sets_conflict_p instead of the later in 4.5.

To post a comment you must log in.
Revision history for this message
Linaro Toolchain Builder (cbuild) wrote : Posted in a previous version of this proposal

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

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.5+bzr99520~eres~sms_fix_mem_dep.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.5+bzr99520~eres~sms_fix_mem_dep
cbuild-ancestor: lp:gcc-linaro+bzr99519
cbuild-state: check

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote : Posted in a previous version of this proposal

cbuild had trouble building this on i686-natty-cbuild148-oort4-i686r1.
See the following failure logs:
 failed.txt gcc-build-failed.txt

under the build results at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99520~eres~sms_fix_mem_dep/logs/i686-natty-cbuild148-oort4-i686r1

The test suite was not checked as this build has no .sum style test results

cbuild-checked: i686-natty-cbuild148-oort4-i686r1

review: Needs Fixing
Revision history for this message
Linaro Toolchain Builder (cbuild) wrote : Posted in a previous version of this proposal

cbuild had trouble building this on x86_64-natty-cbuild148-oort1-x86_64r1.
See the following failure logs:
 failed.txt gcc-build-failed.txt

under the build results at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99520~eres~sms_fix_mem_dep/logs/x86_64-natty-cbuild148-oort1-x86_64r1

The test suite was not checked as this build has no .sum style test results

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

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

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

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.5+bzr99521~eres~sms_fix_mem_dep.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.5+bzr99521~eres~sms_fix_mem_dep
cbuild-ancestor: lp:gcc-linaro+bzr99519
cbuild-state: check

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

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

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

The test suite results changed compared to the branch point lp:gcc-linaro+bzr99519:
 +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.5+bzr99521~eres~sms_fix_mem_dep/logs/x86_64-natty-cbuild149-oort1-x86_64r1/gcc-testsuite.txt

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

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

cbuild successfully built this on armv7l-natty-cbuild149-ursa2-cortexa9r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99521~eres~sms_fix_mem_dep/logs/armv7l-natty-cbuild149-ursa2-cortexa9r1

The test suite results changed compared to the branch point lp:gcc-linaro+bzr99519:
 +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.5+bzr99521~eres~sms_fix_mem_dep/logs/armv7l-natty-cbuild149-ursa2-cortexa9r1/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild149-ursa2-cortexa9r1

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

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

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

The test suite was not checked as the branch point lp:gcc-linaro+bzr99519 has nothing to compare against.

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

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

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

cbuild successfully built this on i686-natty-cbuild151-oort6-i686r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99521~eres~sms_fix_mem_dep/logs/i686-natty-cbuild151-oort6-i686r1

The test suite results changed compared to the branch point lp:gcc-linaro+bzr99519:
 +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.5+bzr99521~eres~sms_fix_mem_dep/logs/i686-natty-cbuild151-oort6-i686r1/gcc-testsuite.txt

cbuild-checked: i686-natty-cbuild151-oort6-i686r1

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

I see this has already been merged.

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

> I see this has already been merged.

No, actually it's pending review... it's not yet in 4.5. (it's in 4.6 though)

Revision history for this message
Ulrich Weigand (uweigand) wrote :

This is OK once the branch is open after the release.

review: Approve

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

Subscribers

People subscribed via source and target branches