In PR88760, there are a few disscussion about improve or tune unroller for
targets. And we would agree to enable unroller for small loops at O2 first.
And we could see performance improvement(~10%) for below code:
```
subroutine foo (i, i1, block)
integer :: i, i1
integer :: block(9, 9, 9)
block(i:9,1,i1) = block(i:9,1,i1) - 10
end subroutine foo
```
This kind of code occurs a few times in exchange2 benchmark.
Similar C code:
```
for (i = 0; i < n; i++)
arr[i] = arr[i] - 10;
```
On powerpcle, for O2 , enable -funroll-loops and limit
PARAM_MAX_UNROLL_TIMES=2 and PARAM_MAX_UNROLLED_INSNS=20, we can see >2%
overall improvement for SPEC2017.
This patch is only for rs6000 in which we see visible performance improvement.
gcc/
2019-10-25 Jiufu Guo <guojiufu@linux.ibm.com>
PR tree-optimization/88760
* config/rs6000/rs6000-common.c (rs6000_option_optimization_table):
Enable -funroll-loops for -O2 and above.
* config/rs6000/rs6000.c (rs6000_option_override_internal): Set
PARAM_MAX_UNROLL_TIMES to 2 and PARAM_MAX_UNROLLED_INSNS to 20, and
do not turn on web and rngreg implicitly, if the unroller is not
explicitly enabled.
gcc.testsuite/
2019-10-25 Jiufu Guo <guojiufu@linux.ibm.com>
PR tree-optimization/88760
* gcc.target/powerpc/small-loop-unroll.c: New test.
* c-c++-common/tsan/thread_leak2.c: Update test.
* gcc.dg/pr59643.c: Update test.
* gcc.target/powerpc/loop_align.c: Update test.
* gcc.target/powerpc/ppc-fma-1.c: Update test.
* gcc.target/powerpc/ppc-fma-2.c: Update test.
* gcc.target/powerpc/ppc-fma-3.c: Update test.
* gcc.target/powerpc/ppc-fma-4.c: Update test.
* gcc.target/powerpc/pr78604.c: Update test.
From-SVN: r277501
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| atomic_stack.c | Loading commit data... | |
| bitfield_race.c | Loading commit data... | |
| fd_pipe_race.c | Loading commit data... | |
| free_race.c | Loading commit data... | |
| free_race2.c | Loading commit data... | |
| mutexset1.c | Loading commit data... | |
| pr65400-1.c | Loading commit data... | |
| pr65400-2.c | Loading commit data... | |
| pr65400-3.c | Loading commit data... | |
| pr68260.c | Loading commit data... | |
| pr81275.c | Loading commit data... | |
| race_on_barrier.c | Loading commit data... | |
| race_on_barrier2.c | Loading commit data... | |
| race_on_mutex.c | Loading commit data... | |
| race_on_mutex2.c | Loading commit data... | |
| sanitize-thread-macro.c | Loading commit data... | |
| simple_race.c | Loading commit data... | |
| simple_stack.c | Loading commit data... | |
| sleep_sync.c | Loading commit data... | |
| step.c | Loading commit data... | |
| thread_leak.c | Loading commit data... | |
| thread_leak1.c | Loading commit data... | |
| thread_leak2.c | Loading commit data... | |
| tiny_race.c | Loading commit data... | |
| tls_race.c | Loading commit data... | |
| tsan_barrier.h | Loading commit data... | |
| write_in_reader_lock.c | Loading commit data... |