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

Proposed by Revital Eres
Status: Superseded
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
Linaro Toolchain Builder Needs Fixing
Review via email: mp+66772@code.launchpad.net

This proposal has been superseded by a proposal from 2011-07-05.

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 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 :

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 :

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

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-04 10:55:55 +0000
+++ ChangeLog.linaro 2011-07-05 09:18:30 +0000
@@ -1,7 +1,19 @@
1<<<<<<< TREE
12011-07-01 Andrew Stubbs <ams@codesourcery.com>22011-07-01 Andrew Stubbs <ams@codesourcery.com>
23
3 Merge from FSF 4.5 branch r175676 (pre 4.5.4).4 Merge from FSF 4.5 branch r175676 (pre 4.5.4).
45
6=======
72011-07-04 Revital Eres <revital.eres@linaro.org>
8
9 gcc/
10 * ddg.c (add_intra_loop_mem_dep): New function.
11 (build_intra_loop_deps): Call it.
12
13 gcc/testsuite
14 * gcc.dg/sms-9.c: New file.
15
16>>>>>>> MERGE-SOURCE
52011-07-01 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>172011-07-01 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
618
7 Backport from mainline.19 Backport from mainline.
820
=== modified file 'gcc/ddg.c'
--- gcc/ddg.c 2011-05-13 16:16:22 +0000
+++ gcc/ddg.c 2011-07-05 09:18:30 +0000
@@ -352,6 +352,33 @@
352}352}
353353
354354
355/* Given two nodes, analyze their RTL insns and add intra-loop mem deps
356 to ddg G. */
357static void
358add_intra_loop_mem_dep (ddg_ptr g, ddg_node_ptr from, ddg_node_ptr to)
359{
360
361 if ((from->cuid == to->cuid)
362 || !insn_alias_sets_conflict_p (from->insn, to->insn))
363 /* Do not create edge if memory references have disjoint alias sets
364 or 'to' and 'from' are the same instruction. */
365 return;
366
367 if (mem_write_insn_p (from->insn))
368 {
369 if (mem_read_insn_p (to->insn))
370 create_ddg_dep_no_link (g, from, to,
371 DEBUG_INSN_P (to->insn)
372 ? ANTI_DEP : TRUE_DEP, MEM_DEP, 0);
373 else
374 create_ddg_dep_no_link (g, from, to,
375 DEBUG_INSN_P (to->insn)
376 ? ANTI_DEP : OUTPUT_DEP, MEM_DEP, 0);
377 }
378 else if (!mem_read_insn_p (to->insn))
379 create_ddg_dep_no_link (g, from, to, ANTI_DEP, MEM_DEP, 0);
380}
381
355/* Given two nodes, analyze their RTL insns and add inter-loop mem deps382/* Given two nodes, analyze their RTL insns and add inter-loop mem deps
356 to ddg G. */383 to ddg G. */
357static void384static void
@@ -439,10 +466,22 @@
439 if (DEBUG_INSN_P (j_node->insn))466 if (DEBUG_INSN_P (j_node->insn))
440 continue;467 continue;
441 if (mem_access_insn_p (j_node->insn))468 if (mem_access_insn_p (j_node->insn))
442 /* Don't bother calculating inter-loop dep if an intra-loop dep469 {
443 already exists. */470 /* Don't bother calculating inter-loop dep if an intra-loop dep
471 already exists. */
444 if (! TEST_BIT (dest_node->successors, j))472 if (! TEST_BIT (dest_node->successors, j))
445 add_inter_loop_mem_dep (g, dest_node, j_node);473 add_inter_loop_mem_dep (g, dest_node, j_node);
474 /* If -fmodulo-sched-allow-regmoves
475 is set certain anti-dep edges are not created.
476 It might be that these anti-dep edges are on the
477 path from one memory instruction to another such that
478 removing these edges could cause a violation of the
479 memory dependencies. Thus we add intra edges between
480 every two memory instructions in this case. */
481 if (flag_modulo_sched_allow_regmoves
482 && !TEST_BIT (dest_node->predecessors, j))
483 add_intra_loop_mem_dep (g, j_node, dest_node);
484 }
446 }485 }
447 }486 }
448 }487 }
449488
=== 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-05 09:18:30 +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