summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-04 09:34:58 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-04 09:34:58 +0000
commit0f52e33a15f60286aeb3ce739f0e9f56934e77a4 (patch)
tree0de58989cf334be8504e47b257a2df2a1aab7bc8 /gcc/tree-vect-data-refs.c
parent48118d023884b6ee7907bfa7b61a4dfb95eb06b5 (diff)
downloadgcc-0f52e33a15f60286aeb3ce739f0e9f56934e77a4.tar.gz
2014-02-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/60012 * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Apply TBAA disambiguation to all DDRs. * gcc.dg/vect/pr60012.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207455 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r--gcc/tree-vect-data-refs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index c3e8f372b83..d018add0a96 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -235,6 +235,18 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
|| (DR_IS_READ (dra) && DR_IS_READ (drb)))
return false;
+ /* Even if we have an anti-dependence then, as the vectorized loop covers at
+ least two scalar iterations, there is always also a true dependence.
+ As the vectorizer does not re-order loads and stores we can ignore
+ the anti-dependence if TBAA can disambiguate both DRs similar to the
+ case with known negative distance anti-dependences (positive
+ distance anti-dependences would violate TBAA constraints). */
+ if (((DR_IS_READ (dra) && DR_IS_WRITE (drb))
+ || (DR_IS_WRITE (dra) && DR_IS_READ (drb)))
+ && !alias_sets_conflict_p (get_alias_set (DR_REF (dra)),
+ get_alias_set (DR_REF (drb))))
+ return false;
+
/* Unknown data dependence. */
if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
{