aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.c
diff options
context:
space:
mode:
authorPeter Bergner <bergner@linux.ibm.com>2019-10-24 19:17:39 +0000
committerPeter Bergner <bergner@linux.ibm.com>2019-10-24 19:17:39 +0000
commitb3875f87fbe002ad43f35ba5cc16efc80f809883 (patch)
treeecb74be9e46fcebac6dcaa2e911693b9b70891bf /gcc/tree-chrec.c
parentd3f50b70a40ea3518d7e386300c4e26e19924ad5 (diff)
parentd844b1d496ef9602a263834327aa73f72663cb6b (diff)
Merge up to 277354.
* REVISION: Update subversion id. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ibm/gcc-8-branch@277422 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r--gcc/tree-chrec.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index 896ff357842..19be8c071b3 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -979,10 +979,11 @@ is_multivariate_chrec (const_tree chrec)
return false;
}
-/* Determines whether the chrec contains symbolic names or not. */
+/* Determines whether the chrec contains symbolic names or not. If LOOP isn't
+ NULL, we also consider chrec wrto outer loops of LOOP as symbol. */
bool
-chrec_contains_symbols (const_tree chrec)
+chrec_contains_symbols (const_tree chrec, struct loop *loop)
{
int i, n;
@@ -999,9 +1000,14 @@ chrec_contains_symbols (const_tree chrec)
|| TREE_CODE (chrec) == FIELD_DECL)
return true;
+ if (loop != NULL
+ && TREE_CODE (chrec) == POLYNOMIAL_CHREC
+ && flow_loop_nested_p (get_chrec_loop (chrec), loop))
+ return true;
+
n = TREE_OPERAND_LENGTH (chrec);
for (i = 0; i < n; i++)
- if (chrec_contains_symbols (TREE_OPERAND (chrec, i)))
+ if (chrec_contains_symbols (TREE_OPERAND (chrec, i), loop))
return true;
return false;
}