summaryrefslogtreecommitdiff
path: root/gcc/tree-loop-distribution.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2013-08-30 10:24:49 +0200
committerMarek Polacek <polacek@redhat.com>2013-08-30 10:24:49 +0200
commit1a986fd51aa96fbd0d66f4d52739356374912563 (patch)
treef5310553e69c8a35180556d9af7e66bdecac7f92 /gcc/tree-loop-distribution.c
parent61fb959b676db6ca9ef0da335dfef0d8ec08e113 (diff)
parentf85c9de6ba5165bc1b941ceb09e4e8ffb1c7eb0f (diff)
downloadgcc-ubsan.tar.gz
Merge branch 'master' of git+ssh://gcc.gnu.org/git/gcc into ubsanubsan
Diffstat (limited to 'gcc/tree-loop-distribution.c')
-rw-r--r--gcc/tree-loop-distribution.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 2317edcc7a3..95c4d5f753a 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -542,17 +542,19 @@ already_processed_vertex_p (bitmap processed, int v)
|| !bitmap_bit_p (remaining_stmts, v));
}
-/* Returns NULL when there is no anti-dependence among the successors
- of vertex V, otherwise returns the edge with the anti-dep. */
+/* Returns NULL when there is no anti-dependence or output-dependence
+ among the successors of vertex V, otherwise returns the edge with the
+ dependency. */
static struct graph_edge *
-has_anti_dependence (struct vertex *v)
+has_anti_or_output_dependence (struct vertex *v)
{
struct graph_edge *e;
if (v->succ)
for (e = v->succ; e; e = e->succ_next)
- if (RDGE_TYPE (e) == anti_dd)
+ if (RDGE_TYPE (e) == anti_dd
+ || RDGE_TYPE (e) == output_dd)
return e;
return NULL;
@@ -604,11 +606,10 @@ mark_nodes_having_upstream_mem_writes (struct graph *rdg)
|| predecessor_has_mem_write (rdg, &(rdg->vertices[x]))
/* In anti dependences the read should occur before
the write, this is why both the read and the write
- should be placed in the same partition. */
- || has_anti_dependence (&(rdg->vertices[x])))
- {
- bitmap_set_bit (upstream_mem_writes, x);
- }
+ should be placed in the same partition. In output
+ dependences the writes order need to be preserved. */
+ || has_anti_or_output_dependence (&(rdg->vertices[x])))
+ bitmap_set_bit (upstream_mem_writes, x);
}
nodes.release ();
@@ -637,7 +638,7 @@ rdg_flag_uses (struct graph *rdg, int u, partition_t partition, bitmap loops,
use_operand_p use_p;
struct vertex *x = &(rdg->vertices[u]);
gimple stmt = RDGV_STMT (x);
- struct graph_edge *anti_dep = has_anti_dependence (x);
+ struct graph_edge *anti_dep = has_anti_or_output_dependence (x);
/* Keep in the same partition the destination of an antidependence,
because this is a store to the exact same location. Putting this