diff options
author | Harsha Jagasia <harsha.jagasia@amd.com> | 2008-11-03 16:43:02 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2008-11-03 16:43:02 +0000 |
commit | 669540aa7297bf95ccbf772890c14e726ab1f2ea (patch) | |
tree | 440c21c8ac130fa7e70f68cf8d3d71d50fd7e22b /gcc/graphite.c | |
parent | 2b8aee8e6df674cf70cab38d2a7e182afabb0f2f (diff) | |
download | gcc-669540aa7297bf95ccbf772890c14e726ab1f2ea.zip gcc-669540aa7297bf95ccbf772890c14e726ab1f2ea.tar.gz gcc-669540aa7297bf95ccbf772890c14e726ab1f2ea.tar.bz2 |
re PR tree-optimization/37684 ([graphite] basic block containing VDEF of a scalar does not dominate basic block containing VUSE of the same scalar)
2008-11-03 Harsha Jagasia <harsha.jagasia@amd.com>
PR tree-optimization/37684
* gcc.dg/graphite/pr37684.c: New.
* graphite.c (exclude_component_ref): New.
(is_simple_operand): Call exclude_component_ref.
From-SVN: r141551
Diffstat (limited to 'gcc/graphite.c')
-rw-r--r-- | gcc/graphite.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/graphite.c b/gcc/graphite.c index a14dd14..90d8230 100644 --- a/gcc/graphite.c +++ b/gcc/graphite.c @@ -864,6 +864,33 @@ loop_affine_expr (basic_block scop_entry, struct loop *loop, tree expr) || evolution_function_is_affine_multivariate_p (scev, n)); } +/* Return false if the tree_code of the operand OP or any of its operands + is component_ref. */ + +static bool +exclude_component_ref (tree op) +{ + int i; + int len; + + if (op) + { + if (TREE_CODE (op) == COMPONENT_REF) + return false; + else + { + len = TREE_OPERAND_LENGTH (op); + for (i = 0; i < len; ++i) + { + if (!exclude_component_ref (TREE_OPERAND (op, i))) + return false; + } + } + } + + return true; +} + /* Return true if the operand OP is simple. */ static bool @@ -879,7 +906,7 @@ is_simple_operand (loop_p loop, gimple stmt, tree op) && !stmt_simple_memref_p (loop, stmt, op))) return false; - return true; + return exclude_component_ref (op); } /* Return true only when STMT is simple enough for being handled by |