2004-07-09 05:19:14 +02:00
|
|
|
/* Scalar evolution detector.
|
crtstuff.c, [...]: Update copyright.
* crtstuff.c, integrate.h, tree-scalar-evolution.h,
config/alpha/unicosmk.h, config/arc/arc.md,
config/arm/bpabi.h, config/arm/coff.h, config/arm/elf.h,
config/arm/ieee754-df.S, config/arm/ieee754-sf.S,
config/arm/netbsd.h, config/arm/pe.c, config/arm/pe.h,
config/arm/semi.h, config/arm/uclinux-elf.h,
config/arm/wince-pe.h, config/fr30/fr30.c,
config/rs6000/altivec.h: Update copyright.
From-SVN: r99447
2005-05-09 18:26:26 +02:00
|
|
|
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
2004-07-09 05:19:14 +02:00
|
|
|
Contributed by Sebastian Pop <s.pop@laposte.net>
|
|
|
|
|
|
|
|
This file is part of GCC.
|
|
|
|
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free
|
|
|
|
Software Foundation; either version 2, or (at your option) any later
|
|
|
|
version.
|
|
|
|
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
2005-06-25 04:02:01 +02:00
|
|
|
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
02110-1301, USA. */
|
2004-07-09 05:19:14 +02:00
|
|
|
|
|
|
|
#ifndef GCC_TREE_SCALAR_EVOLUTION_H
|
|
|
|
#define GCC_TREE_SCALAR_EVOLUTION_H
|
|
|
|
|
2004-07-12 21:31:16 +02:00
|
|
|
extern tree number_of_iterations_in_loop (struct loop *);
|
|
|
|
extern tree get_loop_exit_condition (struct loop *);
|
|
|
|
|
|
|
|
extern void scev_initialize (struct loops *loops);
|
|
|
|
extern void scev_reset (void);
|
|
|
|
extern void scev_finalize (void);
|
|
|
|
extern tree analyze_scalar_evolution (struct loop *, tree);
|
2004-07-09 05:19:14 +02:00
|
|
|
extern tree instantiate_parameters (struct loop *, tree);
|
2004-07-12 21:31:16 +02:00
|
|
|
extern void gather_stats_on_scev_database (void);
|
|
|
|
extern void scev_analysis (void);
|
re PR tree-optimization/18316 (Missed IV optimization)
PR tree-optimization/18316
PR tree-optimization/19126
* tree.c (build_int_cst_type): Avoid shift by size of type.
* tree-scalar-evolution.c (simple_iv): Add allow_nonconstant_step
argument.
* tree-scalar-evolution.h (simple_iv): Declaration changed.
* tree-ssa-loop-ivopts.c (struct iv_cand): Add depends_on
field.
(dump_cand): Dump depends_on information.
(determine_biv_step): Add argument to simple_iv call.
(contains_abnormal_ssa_name_p): Handle case expr == NULL.
(find_bivs, find_givs_in_stmt_scev): Do not require step to be a
constant.
(add_candidate_1): Record depends_on for candidates.
(tree_int_cst_sign_bit, constant_multiple_of): New functions.
(get_computation_at, get_computation_cost_at, may_eliminate_iv):
Handle ivs with nonconstant step.
(iv_ca_set_remove_invariants, iv_ca_set_add_invariants): New functions.
(iv_ca_set_no_cp, iv_ca_set_cp): Handle cand->depends_on.
(create_new_iv): Unshare the step before passing it to create_iv.
(free_loop_data): Free cand->depends_on.
(build_addr_strip_iref): New function.
(find_interesting_uses_address): Use build_addr_strip_iref.
(strip_offset_1): Split the recursive part from strip_offset.
Strip constant offset component_refs and array_refs.
(strip_offset): Split the recursive part to strip_offset_1.
(add_address_candidates): Removed.
(add_derived_ivs_candidates): Do not use add_address_candidates.
(add_iv_value_candidates): Add candidates with stripped constant
offset. Consider all candidates with initial value 0 important.
(struct affine_tree_combination): New.
(aff_combination_const, aff_combination_elt, aff_combination_scale,
aff_combination_add_elt, aff_combination_add,
tree_to_aff_combination, add_elt_to_tree, aff_combination_to_tree,
fold_affine_sum): New functions.
(get_computation_at): Use fold_affine_sum.
* tree-ssa-loop-manip.c (create_iv): Handle ivs with nonconstant step.
* tree-ssa-loop-niter.c (number_of_iterations_exit): Add argument
to simple_iv call.
* gcc.dg/tree-ssa/loop-8.c: New test.
From-SVN: r99059
2005-05-01 10:08:14 +02:00
|
|
|
extern bool simple_iv (struct loop *, tree, tree, tree *, tree *, bool);
|
2005-05-17 22:28:30 +02:00
|
|
|
void scev_const_prop (void);
|
2004-07-09 05:19:14 +02:00
|
|
|
|
|
|
|
#endif /* GCC_TREE_SCALAR_EVOLUTION_H */
|