diff options
author | Dehao Chen <dehao@google.com> | 2012-10-08 16:45:21 +0000 |
---|---|---|
committer | Dehao Chen <dehao@gcc.gnu.org> | 2012-10-08 16:45:21 +0000 |
commit | 16fdb75f788f9fe3d26853188a4c186efd5aef44 (patch) | |
tree | 675e200d78e6ed4df9b534e2184161059261b725 /gcc/testsuite/g++.dg/predict-loop-exit-3.C | |
parent | 2512a443d6c09f42c24dca5dfd4173cdef39c3b1 (diff) | |
download | gcc-16fdb75f788f9fe3d26853188a4c186efd5aef44.zip gcc-16fdb75f788f9fe3d26853188a4c186efd5aef44.tar.gz gcc-16fdb75f788f9fe3d26853188a4c186efd5aef44.tar.bz2 |
predict.c (predict_loops): Predict for short-circuit conditions.
gcc:
2012-10-08 Dehao Chen <dehao@google.com>
* predict.c (predict_loops): Predict for short-circuit conditions.
(predict_extra_loop_exits): New Function.
testsuite:
2012-10-08 Dehao Chen <dehao@google.com>
* g++.dg/predict-loop-exit-1.C: New.
* g++.dg/predict-loop-exit-2.C: New.
* g++.dg/predict-loop-exit-3.C: New.
From-SVN: r192215
Diffstat (limited to 'gcc/testsuite/g++.dg/predict-loop-exit-3.C')
-rw-r--r-- | gcc/testsuite/g++.dg/predict-loop-exit-3.C | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/predict-loop-exit-3.C b/gcc/testsuite/g++.dg/predict-loop-exit-3.C new file mode 100644 index 0000000..9afc78e --- /dev/null +++ b/gcc/testsuite/g++.dg/predict-loop-exit-3.C @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ + +int g; +int foo(); +void test() { + while (foo() && (g < 10 || g > 20)) + g++; + return; +} + +/* { dg-final { scan-tree-dump-times "loop exit heuristics:" 3 "profile_estimate"} } */ +/* { dg-final { cleanup-tree-dump "profile_estimate" } } */ |