diff options
author | Zdenek Dvorak <dvorakz@suse.cz> | 2006-01-06 21:22:56 +0100 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2006-01-06 20:22:56 +0000 |
commit | a6f778b21e8ed7c51e7b7fea73e2105c0996095c (patch) | |
tree | 2f80a9e9f7dc377dcb9bdd829e0f2a5a8d6c28d9 /gcc/tree-scalar-evolution.h | |
parent | 782e98753b7ce46cc3fa79253d57b3365149fa54 (diff) | |
download | gcc-a6f778b21e8ed7c51e7b7fea73e2105c0996095c.zip gcc-a6f778b21e8ed7c51e7b7fea73e2105c0996095c.tar.gz gcc-a6f778b21e8ed7c51e7b7fea73e2105c0996095c.tar.bz2 |
re PR tree-optimization/18527 (cannot determine number of iterations for loops with <=)
PR tree-optimization/18527
* tree-ssa-loop-niter.c (number_of_iterations_cond,
number_of_iterations_special, number_of_iterations_exit):
Move base and step of an iv to a single structure. Add
no_overflow flag, and use it in # of iterations analysis.
* tree-scalar-evolution.c (analyze_scalar_evolution_in_loop): Add
folded_casts argument.
(simple_iv): Pass base and step in a structure. Set no_overflow
flag.
(scev_const_prop): Add argument to analyze_scalar_evolution_in_loop.
Evaluate expensiveness of computing # of iterations instead of
the final expression.
* tree-scalar-evolution.h (affine_iv): New structure.
(simple_iv): Declaration changed.
* tree-chrec.c (chrec_apply): Handle chrecs containing symbols.
* tree-ssa-loop-ivopts.c (determine_biv_step, find_givs_in_stmt_scev,
find_givs_in_stmt): Changed due to simple_iv change.
* gcc.dg/tree-ssa/loop-15.c: New test.
From-SVN: r109427
Diffstat (limited to 'gcc/tree-scalar-evolution.h')
-rw-r--r-- | gcc/tree-scalar-evolution.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/tree-scalar-evolution.h b/gcc/tree-scalar-evolution.h index 60878b1..0fecaee 100644 --- a/gcc/tree-scalar-evolution.h +++ b/gcc/tree-scalar-evolution.h @@ -32,7 +32,19 @@ extern tree analyze_scalar_evolution (struct loop *, tree); extern tree instantiate_parameters (struct loop *, tree); extern void gather_stats_on_scev_database (void); extern void scev_analysis (void); -extern bool simple_iv (struct loop *, tree, tree, tree *, tree *, bool); void scev_const_prop (void); +/* Affine iv. */ + +typedef struct +{ + /* Iv = BASE + STEP * i. */ + tree base, step; + + /* True if this iv does not overflow. */ + bool no_overflow; +} affine_iv; + +extern bool simple_iv (struct loop *, tree, tree, affine_iv *, bool); + #endif /* GCC_TREE_SCALAR_EVOLUTION_H */ |