summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-05 18:07:43 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-05 18:07:43 +0000
commitf3830c7c61629f6c8d548e0b0765b5d991449b3a (patch)
treecfeafcc33d51ab68e1c5e4385dfbe70b56fbca72 /gcc/tree-ssa-loop-niter.c
parent7722eea5f397d40e8e0d4f5a3d2ed60c8eb9fc73 (diff)
downloadgcc-f3830c7c61629f6c8d548e0b0765b5d991449b3a.tar.gz
PR tree-optimization/21846
* tree-cfg.c (replace_uses_by): Update information stored at loops. * tree-flow.h (substitute_in_loop_info): Declare. * tree-scalar-evolution.c (initialize_scalar_evolutions_analyzer): Ensure that chrec_dont_know and chrec_known have a type. * tree-ssa-loop-niter.c (substitute_in_loop_info): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100631 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 38f7b42d46c..78f14e9accf 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -1600,3 +1600,21 @@ free_numbers_of_iterations_estimates (struct loops *loops)
free_numbers_of_iterations_estimates_loop (loop);
}
}
+
+/* Substitute value VAL for ssa name NAME inside expressions held
+ at LOOP. */
+
+void
+substitute_in_loop_info (struct loop *loop, tree name, tree val)
+{
+ struct nb_iter_bound *bound;
+
+ loop->nb_iterations = simplify_replace_tree (loop->nb_iterations, name, val);
+ loop->estimated_nb_iterations
+ = simplify_replace_tree (loop->estimated_nb_iterations, name, val);
+ for (bound = loop->bounds; bound; bound = bound->next)
+ {
+ bound->bound = simplify_replace_tree (bound->bound, name, val);
+ bound->additional = simplify_replace_tree (bound->additional, name, val);
+ }
+}