aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.c
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@arm.com>2017-06-07 11:28:17 +0000
committerBin Cheng <amker@gcc.gnu.org>2017-06-07 11:28:17 +0000
commit6355150f585e2d746a62df19ae89df7c93e8c3c7 (patch)
treeffd017ee04fe672e3f42d56032ae0e149f982e6f /gcc/tree-data-ref.c
parent0874a778ec0adf43167dd4aa014dadb75b0907f8 (diff)
downloadgcc-6355150f585e2d746a62df19ae89df7c93e8c3c7.zip
gcc-6355150f585e2d746a62df19ae89df7c93e8c3c7.tar.gz
gcc-6355150f585e2d746a62df19ae89df7c93e8c3c7.tar.bz2
tree-vect-data-refs.c (vect_mark_for_runtime_alias_test): Factor out code checking if runtime alias check is possible to below ...
* tree-vect-data-refs.c (vect_mark_for_runtime_alias_test): Factor out code checking if runtime alias check is possible to below ... Call the new function. * tree-data-ref.c (runtime_alias_check_p): ... to new function. * tree-data-ref.h (runtime_alias_check_p): New decalaration. From-SVN: r248962
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r--gcc/tree-data-ref.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index d16bc36..ba47302 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -1182,6 +1182,55 @@ data_ref_compare_tree (tree t1, tree t2)
return 0;
}
+/* Return TRUE it's possible to resolve data dependence DDR by runtime alias
+ check. */
+
+bool
+runtime_alias_check_p (ddr_p ddr, struct loop *loop, bool speed_p)
+{
+ if (dump_enabled_p ())
+ {
+ dump_printf (MSG_NOTE, "consider run-time aliasing test between ");
+ dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (DDR_A (ddr)));
+ dump_printf (MSG_NOTE, " and ");
+ dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (DDR_B (ddr)));
+ dump_printf (MSG_NOTE, "\n");
+ }
+
+ if (!speed_p)
+ {
+ if (dump_enabled_p ())
+ dump_printf (MSG_MISSED_OPTIMIZATION,
+ "runtime alias check not supported when optimizing "
+ "for size.\n");
+ return false;
+ }
+
+ /* FORNOW: We don't support versioning with outer-loop in either
+ vectorization or loop distribution. */
+ if (loop != NULL && loop->inner != NULL)
+ {
+ if (dump_enabled_p ())
+ dump_printf (MSG_MISSED_OPTIMIZATION,
+ "runtime alias check not supported for outer loop.\n");
+ return false;
+ }
+
+ /* FORNOW: We don't support creating runtime alias tests for non-constant
+ step. */
+ if (TREE_CODE (DR_STEP (DDR_A (ddr))) != INTEGER_CST
+ || TREE_CODE (DR_STEP (DDR_B (ddr))) != INTEGER_CST)
+ {
+ if (dump_enabled_p ())
+ dump_printf (MSG_MISSED_OPTIMIZATION,
+ "runtime alias check not supported for non-constant "
+ "step\n");
+ return false;
+ }
+
+ return true;
+}
+
/* Operator == between two dr_with_seg_len objects.
This equality operator is used to make sure two data refs