diff options
author | Bin Cheng <bin.cheng@arm.com> | 2015-08-21 10:09:48 +0000 |
---|---|---|
committer | Bin Cheng <amker@gcc.gnu.org> | 2015-08-21 10:09:48 +0000 |
commit | eff1e5afad295545d09985c705952242bc16c2ea (patch) | |
tree | a522662a8c0bd643147a2af4d6d39c9d79330140 | |
parent | 55b9e2fc7289e8d29e7db4ebedbe01eafff48547 (diff) | |
download | gcc-eff1e5afad295545d09985c705952242bc16c2ea.zip gcc-eff1e5afad295545d09985c705952242bc16c2ea.tar.gz gcc-eff1e5afad295545d09985c705952242bc16c2ea.tar.bz2 |
tree-ssa-loop-niter.c (simplify_using_initial_conditions): Break loop if EXPR is simplified to const value.
* tree-ssa-loop-niter.c (simplify_using_initial_conditions): Break
loop if EXPR is simplified to const value.
From-SVN: r227055
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c746e164..cb1ed43 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-08-21 Bin Cheng <bin.cheng@arm.com> + + * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Break + loop if EXPR is simplified to const value. + 2015-08-21 Yury Gribov <y.gribov@samsung.com> * sanitizer.def (BUILT_IN_UBSAN_HANDLE_NONNULL_ARG, diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 4e9a2ac..39d6807 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -2083,6 +2083,10 @@ simplify_using_initial_conditions (struct loop *loop, tree expr) 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; } |