aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-05-26 16:46:25 +0000
committerSebastian Pop <spop@gcc.gnu.org>2010-05-26 16:46:25 +0000
commit6d7950341abe74d53a7931c2fb5faab2b2e01dee (patch)
tree6fcc95944632f63a4342768926abd256ed0afc31 /gcc
parentd730961859e499ae00626d5aed1c9ef11282fb1a (diff)
downloadgcc-6d7950341abe74d53a7931c2fb5faab2b2e01dee.zip
gcc-6d7950341abe74d53a7931c2fb5faab2b2e01dee.tar.gz
gcc-6d7950341abe74d53a7931c2fb5faab2b2e01dee.tar.bz2
Avoid if-conversion of loops in which the data dependence analysis fails.
2010-05-26 Sebastian Pop <sebastian.pop@amd.com> * tree-if-conv.c (if_convertible_loop_p): Avoid if-conversion of loops in which the data dependence analysis fails. From-SVN: r159883
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-if-conv.c14
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cef95f2..6a4bac3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-05-26 Sebastian Pop <sebastian.pop@amd.com>
+ * tree-if-conv.c (if_convertible_loop_p): Avoid if-conversion
+ of loops in which the data dependence analysis fails.
+
+2010-05-26 Sebastian Pop <sebastian.pop@amd.com>
+
* tree-if-conv.c (if_convertible_loop_p): Do not compute/free
CDI_POST_DOMINATORS.
(tree_if_conversion): Same.
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 23d71a0..f5247a3 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -623,6 +623,20 @@ if_convertible_loop_p (struct loop *loop)
return false;
}
+ /* Don't if-convert the loop when the data dependences cannot be
+ computed: the loop won't be vectorized in that case. */
+ {
+ VEC (data_reference_p, heap) *refs = VEC_alloc (data_reference_p, heap, 5);
+ VEC (ddr_p, heap) *ddrs = VEC_alloc (ddr_p, heap, 25);
+ bool res = compute_data_dependences_for_loop (loop, true, &refs, &ddrs);
+
+ free_data_refs (refs);
+ free_dependence_relations (ddrs);
+
+ if (!res)
+ return false;
+ }
+
calculate_dominance_info (CDI_DOMINATORS);
/* Allow statements that can be handled during if-conversion. */