From 7ed7512f3cd7e2a1251a6356719d1886b88030ac Mon Sep 17 00:00:00 2001 From: spop Date: Fri, 31 Jul 2009 02:38:13 +0000 Subject: [PATCH] Make scev_is_linear_expression return false if the evolution is not affine multivariate. 2009-07-30 Sebastian Pop * tree-chrec.c (operator_is_linear): Handle BIT_NOT_EXPR. (scev_is_linear_expression): Return false if the evolution is not affine multivariate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150298 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/tree-chrec.c | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c15abd7..2a06489 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2009-07-30 Sebastian Pop + * tree-chrec.c (operator_is_linear): Handle BIT_NOT_EXPR. + (scev_is_linear_expression): Return false if the evolution is not + affine multivariate. + +2009-07-30 Sebastian Pop + * tree-data-ref.c (graphite_find_data_references_in_stmt): New. * tree-data-ref.h (graphite_find_data_references_in_stmt): Declared. diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c index 7493504..caf7428 100644 --- a/gcc/tree-chrec.c +++ b/gcc/tree-chrec.c @@ -1411,7 +1411,7 @@ for_each_scev_op (tree *scev, bool (*cbck) (tree *, void *), void *data) case 2: for_each_scev_op (&TREE_OPERAND (*scev, 1), cbck, data); - + case 1: for_each_scev_op (&TREE_OPERAND (*scev, 0), cbck, data); @@ -1438,6 +1438,7 @@ operator_is_linear (tree scev) case NEGATE_EXPR: case SSA_NAME: case NON_LVALUE_EXPR: + case BIT_NOT_EXPR: CASE_CONVERT: return true; @@ -1461,6 +1462,10 @@ scev_is_linear_expression (tree scev) return !(tree_contains_chrecs (TREE_OPERAND (scev, 0), NULL) && tree_contains_chrecs (TREE_OPERAND (scev, 1), NULL)); + if (TREE_CODE (scev) == POLYNOMIAL_CHREC + && !evolution_function_is_affine_multivariate_p (scev, CHREC_VARIABLE (scev))) + return false; + switch (TREE_CODE_LENGTH (TREE_CODE (scev))) { case 3: @@ -1471,7 +1476,7 @@ scev_is_linear_expression (tree scev) case 2: return scev_is_linear_expression (TREE_OPERAND (scev, 0)) && scev_is_linear_expression (TREE_OPERAND (scev, 1)); - + case 1: return scev_is_linear_expression (TREE_OPERAND (scev, 0)); -- 2.7.4