Message ID | 000001d0c915$33423ea0$99c6bbe0$@arm.com |
---|---|
State | New |
Headers | show |
On Tue, Jul 28, 2015 at 11:09 AM, Bin Cheng <bin.cheng@arm.com> wrote: > Hi, > This is an obvious change to bypass following iterations if expr has already > been simplified into constant in function > simplify_using_loop_initial_conditions. > > Is it OK? Ok. Thanks, Richard. > Thanks, > bin > > 2015-07-28 Bin Cheng <bin.cheng@arm.com> > > * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Break > Loop if EXPR is simplified to const values.
Index: gcc/tree-ssa-loop-niter.c =================================================================== --- gcc/tree-ssa-loop-niter.c (revision 225859) +++ gcc/tree-ssa-loop-niter.c (working copy) @@ -1815,6 +1815,10 @@ simplify_using_initial_conditions (struct loop *lo if (e->flags & EDGE_FALSE_VALUE) cond = invert_truthvalue (cond); expr = tree_simplify_using_condition (cond, expr); + /* Break if EXPR is simplified to const values. */ + if (expr && (integer_zerop (expr) || integer_nonzerop (expr))) + break; + ++cnt; }