This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Tweak loop peeling limits
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com,rakdver at atrey dot karlin dot mff dot cuni dot cz, zack at codesourcery dot com
- Date: Sun, 8 Feb 2004 23:07:18 +0100
- Subject: Tweak loop peeling limits
Hi,
while looking for reason of performance rgressions in some tests relative to
hammer branch, I noticed that loop unrolling limit has been increased from 60
to 200. With current heuristics the loop is unrolled only when the expected
number of iteration is at least twice as many as number of copies of loop we
decide to make based on the limit.
It is expected that rest of loops are better to be peeled, however the limit of
peelings is still set to 120, that means that we have some loops that are
not unrolled nor peeled.
For SPEC, GCC, parser, gap, bzip, wupwise, apply, art, apsi all have hot loops
with this property. Increasing the peeling limit improves all of them except
for art and gap with overall improvement of 0.5% for SPECint and 1% for SPECfp
when profile feedback is available.
I unfortunately managed to remove the code size stats, but the difference were
within 1% limit for all of the benchmarks, sometimes positive, sometimes
negative. apsi increased over 1% but it was mostly because it is very
small benchmark overall.
OK for 3.4 branch and mainline?
Honza
2004-02-08 Jan Hubicka <jh@suse.cz>
* params.def (max-peeled-insns, max-completely-peeled-insns,
max-once-peeled-insns): Set to 400.
Index: params.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/params.def,v
retrieving revision 1.33.4.1
diff -c -3 -p -r1.33.4.1 params.def
*** params.def 17 Jan 2004 00:05:20 -0000 1.33.4.1
--- params.def 8 Feb 2004 21:58:11 -0000
*************** DEFPARAM(PARAM_MAX_UNROLL_TIMES,
*** 153,159 ****
DEFPARAM(PARAM_MAX_PEELED_INSNS,
"max-peeled-insns",
"The maximum number of insns of a peeled loop",
! 120)
/* The maximum number of peelings of a single loop. */
DEFPARAM(PARAM_MAX_PEEL_TIMES,
"max-peel-times",
--- 153,159 ----
DEFPARAM(PARAM_MAX_PEELED_INSNS,
"max-peeled-insns",
"The maximum number of insns of a peeled loop",
! 400)
/* The maximum number of peelings of a single loop. */
DEFPARAM(PARAM_MAX_PEEL_TIMES,
"max-peel-times",
*************** DEFPARAM(PARAM_MAX_PEEL_TIMES,
*** 163,169 ****
DEFPARAM(PARAM_MAX_COMPLETELY_PEELED_INSNS,
"max-completely-peeled-insns",
"The maximum number of insns of a completely peeled loop",
! 120)
/* The maximum number of peelings of a single loop that is peeled completely. */
DEFPARAM(PARAM_MAX_COMPLETELY_PEEL_TIMES,
"max-completely-peel-times",
--- 163,169 ----
DEFPARAM(PARAM_MAX_COMPLETELY_PEELED_INSNS,
"max-completely-peeled-insns",
"The maximum number of insns of a completely peeled loop",
! 400)
/* The maximum number of peelings of a single loop that is peeled completely. */
DEFPARAM(PARAM_MAX_COMPLETELY_PEEL_TIMES,
"max-completely-peel-times",
*************** DEFPARAM(PARAM_MAX_COMPLETELY_PEEL_TIMES
*** 173,179 ****
DEFPARAM(PARAM_MAX_ONCE_PEELED_INSNS,
"max-once-peeled-insns",
"The maximum number of insns of a peeled loop that rolls only once",
! 200)
/* The maximum number of insns of an unswitched loop. */
DEFPARAM(PARAM_MAX_UNSWITCH_INSNS,
--- 173,179 ----
DEFPARAM(PARAM_MAX_ONCE_PEELED_INSNS,
"max-once-peeled-insns",
"The maximum number of insns of a peeled loop that rolls only once",
! 400)
/* The maximum number of insns of an unswitched loop. */
DEFPARAM(PARAM_MAX_UNSWITCH_INSNS,