1 |
On Tue, Dec 09, 2003 at 11:17:23PM +0100, John Nilsson wrote: |
2 |
> >Thats the express purpose that genflags was created for, to provide |
3 |
> >users with a known good set of high-performance CFLAGS so they didn't |
4 |
> >need to mess around with it too much. |
5 |
> Still there is no room for improvement when dealing with system wide |
6 |
> optimization. |
7 |
Your wording here is unclear, I think you mean to say that there IS room for |
8 |
improvement over system wide constant CFLAGS? |
9 |
|
10 |
> >strip-flags to remove problematic flags on a per ebuild basis is the |
11 |
> >best solution. I do agree that unstable gcc settings are a big |
12 |
> >problem, eg in a recent bug it turned out the submitter's system (an |
13 |
> >older Pentium I) couldn't handle -O3 without flaking out. Reduce it |
14 |
> >to -O2 and the box went fine (both for compiling and already compiled |
15 |
> >packages). |
16 |
> This is a bug in GCC. While a workaround may be a quick solution for |
17 |
> Gentoo, one shouldn't base the whole system on bugs. |
18 |
No it isn't a bug in GCC, it's a bug with the user's specific hardware. |
19 |
I have an older Pentium I system that runs just fine with -O3 and the |
20 |
user's specified CFLAGS. I didn't force everybody to use -O2, I just got |
21 |
that user to change his own system down to -O2. |
22 |
|
23 |
> >again, genflags was created for this. I've considered a sequel to |
24 |
> >genflags based on the genetic optimization of compiler flags as |
25 |
> >mentioned on Slashdot a while ago, but for lack of time, i'm not even |
26 |
> >looking at doing it now. |
27 |
> You might want to chek: |
28 |
> http://www.coyotegulch.com/potential/gccga/gccga.html |
29 |
This is the original item I was referencing, but you still run into the |
30 |
problem that you need to run things on a system basis to get effective |
31 |
results. |
32 |
|
33 |
http://www.coyotegulch.com/acovea/index.html is the rest of the article, |
34 |
|
35 |
> http://www.rocklinux.net/packages/ccbench.html |
36 |
This basically brute forces the genetic algorithms, with absolutely no |
37 |
thought as to the net effects on the results of the given flags, eg, on |
38 |
my home server (an AthlonXP 2400+), it returns these results: |
39 |
gcc -O3 -march=athlon -fomit-frame-pointer -funroll-loops |
40 |
-frerun-loop-opt -funroll-all-loops -fschedule-insns |
41 |
|
42 |
Of that, '-frerun-loop-opt' and '-fschedule-insns' are redundant as they |
43 |
are implied by -O3. |
44 |
|
45 |
-fomit-frame-pointer and I can't debug code properly anymore, and if I |
46 |
try to use -funroll-all-loops to compile mysql, even with it's |
47 |
--with-low-memory option, gcc wants 600mb of memory to compile it's |
48 |
sql_yacc.cc. |
49 |
|
50 |
> I meant by evolution: the process of users submiting patches to improve |
51 |
> individual ebuilds. |
52 |
What improves the performance of a given application on one machine does |
53 |
NOT nessicary improve it on another machine. |
54 |
|
55 |
Read the gcc manpage and see: |
56 |
-fprofile-arcs |
57 |
-fbranch-probabilities |
58 |
(also read http://gcc.gnu.org/news/profiledriven.html) |
59 |
|
60 |
Just adding these to ccbench doubles the amount of time taken to |
61 |
test (as you must compile with -fprofile-arcs, run, compile with |
62 |
-fbranch-probabilities, run again). It also provides some extremely |
63 |
interesting and varying results. The bubblesort test for example, |
64 |
improves between +15% and +300% depending on the other compiler flags. |
65 |
Towers of Hanoi goes from -20% to +50%. |
66 |
|
67 |
If users submitted _good_ non-interactive testcases for every ebuild, it |
68 |
wouldn't difficult to apply -fprofile-arcs/branch-probabilities and or |
69 |
acovea to most packages at all, apart from the massive increase in |
70 |
compile time. |
71 |
|
72 |
> >Stable and high-performance is an per-system definition, as evidenced |
73 |
> >by the bug I mentioned with -O3. |
74 |
> And should as such be fixed... in gcc. If gcc cant optimize correct |
75 |
> knowing the cache size of the cpu, gcc is broken. Fix gcc. |
76 |
Again, it isn't a gcc bug, it's an issue with a specific machine (not |
77 |
even a class of systems or cpus). |
78 |
|
79 |
Lets take a tangent on this whole issue for a moment. Ignoring the |
80 |
implementation concerns, the end goal of your GLEP is this: |
81 |
The basic gain you want, is for the support of per-package CFLAG |
82 |
modifications (inside the ebuilds), for the purpose of performance |
83 |
optimization. |
84 |
|
85 |
Do I have this correct? |
86 |
|
87 |
-- |
88 |
Robin Hugh Johnson |
89 |
E-Mail : robbat2@××××××××××××××.net |
90 |
Home Page : http://www.orbis-terrarum.net/?l=people.robbat2 |
91 |
ICQ# : 30269588 or 41961639 |
92 |
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85 |