aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-09-18 07:38:12 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-09-18 07:38:12 +0000
commit72b03fde35443a0007dbbef4c2151ac0d7b6a1f9 (patch)
tree81736159be762bd412e9eb4ad48461e548c8096c /gcc
parent3d07d963f6eb6fce457e0414bef4ad428dfb7788 (diff)
downloadgcc-72b03fde35443a0007dbbef4c2151ac0d7b6a1f9.zip
gcc-72b03fde35443a0007dbbef4c2151ac0d7b6a1f9.tar.gz
gcc-72b03fde35443a0007dbbef4c2151ac0d7b6a1f9.tar.bz2
graphite-scop-detection.c (scop_detection::stmt_has_simple_data_ref): Simplify.
2017-09-18 Richard Biener <rguenther@suse.de> * graphite-scop-detection.c (scop_detection::stmt_has_simple_data_ref): Simplify. (build_alias_set): Reject aliases with no access function. From-SVN: r252906
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/graphite-scop-detection.c36
2 files changed, 16 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d75d249..fe4fcfa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2017-09-18 Richard Biener <rguenther@suse.de>
+ * graphite-scop-detection.c (scop_detection::stmt_has_simple_data_ref):
+ Simplify.
+ (build_alias_set): Reject aliases with no access function.
+
+2017-09-18 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/79622
* graphite-scop-detection.c (build_cross_bb_scalars_def): Properly
handle PHIs.
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index b209ba6..71ddfd8 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -1338,40 +1338,23 @@ scop_detection::stmt_has_simple_data_refs_p (sese_l scop, gimple *stmt)
{
loop_p nest = outermost_loop_in_sese (scop, gimple_bb (stmt));
loop_p loop = loop_containing_stmt (stmt);
- vec<data_reference_p> drs = vNULL;
+ if (!loop_in_sese_p (loop, scop))
+ loop = nest;
- graphite_find_data_references_in_stmt (nest, loop, stmt, &drs);
+ auto_vec<data_reference_p> drs;
+ if (! graphite_find_data_references_in_stmt (nest, loop, stmt, &drs))
+ return false;
int j;
data_reference_p dr;
FOR_EACH_VEC_ELT (drs, j, dr)
{
- int nb_subscripts = DR_NUM_DIMENSIONS (dr);
-
- if (nb_subscripts < 1)
- {
- free_data_refs (drs);
+ for (unsigned i = 0; i < DR_NUM_DIMENSIONS (dr); ++i)
+ if (! graphite_can_represent_scev (DR_ACCESS_FN (dr, i)))
return false;
- }
-
- tree ref = DR_REF (dr);
-
- for (int i = nb_subscripts - 1; i >= 0; i--)
- {
- if (!graphite_can_represent_scev (DR_ACCESS_FN (dr, i))
- || (TREE_CODE (ref) != ARRAY_REF && TREE_CODE (ref) != MEM_REF
- && TREE_CODE (ref) != COMPONENT_REF))
- {
- free_data_refs (drs);
- return false;
- }
-
- ref = TREE_OPERAND (ref, 0);
- }
}
- free_data_refs (drs);
- return true;
+ return true;
}
/* GIMPLE_ASM and GIMPLE_CALL may embed arbitrary side effects.
@@ -1875,7 +1858,8 @@ build_alias_set (scop_p scop)
{
/* Dependences in the same alias set need to be handled
by just looking at DR_ACCESS_FNs. */
- if (DR_NUM_DIMENSIONS (dr1->dr) != DR_NUM_DIMENSIONS (dr2->dr)
+ if (DR_NUM_DIMENSIONS (dr1->dr) == 0
+ || DR_NUM_DIMENSIONS (dr1->dr) != DR_NUM_DIMENSIONS (dr2->dr)
|| ! operand_equal_p (DR_BASE_OBJECT (dr1->dr),
DR_BASE_OBJECT (dr2->dr),
OEP_ADDRESS_OF)