target cost model tuning for x86

Tobias Burnus burnus@net-b.de
Fri Sep 7 15:13:00 GMT 2007


Jagasia, Harsha wrote:
> This patch defines the cost-model target-specific costs for x86 (only
> AMD K8 for now). I looked at some Polyhedron benchmarks to arrive at the
> costs. I also made some small fixes to the cost model itself.

I did a small test (Polyhedron testsuite) on an AMD Athlon64 X2 4800+ with

a) NoCM: No cost model
b) CM.old: Before the patch
c) CM.new: With the patch

(a) and (b) were run several times; (c) only once. In principle only
this single-thread was consuming CPU time.

The basic options were:
gfortran -march=opteron -ffast-math -funroll-loops -ftree-vectorize
-ftree-loop-linear -msse3 -O3

         NoCM   CM.old CM.new
ac	 13.93  13.96  13.88
aermod	 36.06  36.08  35.60
air	 14.18  14.16  14.23
capacita 82.86  82.96  82.67
channel  12.95  12.83  12.63
doduc    44.01  42.07  41.30
fatigue  12.33  11.88  11.51
gas_dyn  11.82  11.75  11.48
induct   49.12  48.47  50.68 (see below)
linpk    26.35  26.31  25.96
mdbx     24.51  24.45  24.21
nf       29.91  29.84  29.44
protein  65.63  65.67  65.32
rnflow   37.24  37.04  36.86
test_fpu 20.19  19.91  19.87
tfft      7.85   7.72   7.64
----------------------------
Geo.Mean 24.60  24.37  24.19

Thus the tuning for k8 seems to help; compared with NoCM, CM.old is
about 1% faster while CM.new is about 1.7% faster.

For induct I rechecked by running "time ./a.out > /dev/null"
For NoCM:
real    0m48.820s
user    0m48.799s
real    0m48.772s
user    0m48.739s
For CM.new:
real    0m50.670s
user    0m50.643s
real    0m50.585s
user    0m50.547s

Thus this program is indeed about 4% slower than without cost model and
5% slower than with the old cost model.

Tobias



More information about the Gcc-patches mailing list