diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-23 15:15:58 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-23 15:15:58 +0000 |
commit | d9459f6b9e27edcf999b5c06b87e21f8f24fd26f (patch) | |
tree | 0f15c07165dd8eb1e94225c4f167441e61fadd00 /gcc/testsuite/gcc.dg/tree-prof | |
parent | 2ce72210eb2873827782238c8c88b1d5a2baa8ad (diff) | |
download | gcc-d9459f6b9e27edcf999b5c06b87e21f8f24fd26f.tar.gz |
* gcc.dg/tree-prof/peel-1.c: New testcase.
* loop-unroll.c (decide_peel_simple): Simple peeling makes sense even
with simple loops; bound number of branches only when FDO is not
available.
(decide_unroll_stupid): Mention that num_loop_branches heuristics
is off.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192718 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-prof')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/peel-1.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-prof/peel-1.c b/gcc/testsuite/gcc.dg/tree-prof/peel-1.c new file mode 100644 index 00000000000..baa601dc1ec --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-prof/peel-1.c @@ -0,0 +1,25 @@ +/* { dg-options "-O3 -fdump-rtl-loop2_unroll -fno-unroll-loops -fpeel-loops" } */ +void abort(); + +int a[1000]; +int +__attribute__ ((noinline)) +t() +{ + int i; + for (i=0;i<1000;i++) + if (!a[i]) + return 1; + abort (); +} +main() +{ + int i; + for (i=0;i<1000;i++) + t(); + return 0; +} +/* { dg-final-use { scan-rtl-dump "Considering simply peeling loop" "loop2_unroll" } } */ +/* In fact one peeling is enough; we however mispredict number of iterations of the loop + at least until loop_ch is schedule ahead of profiling pass. */ +/* { dg-final-use { cleanup-rtl-dump "Decided to simply peel the loop 2 times" } } */ |