Old loop optimizer in 4.0?
Zdenek Dvorak
rakdver@atrey.karlin.mff.cuni.cz
Sat Sep 25 17:25:00 GMT 2004
Hello,
I would like to know what is the public opinion on what to do
with the old loop optimizer in 4.0. Basically there are three
possibilities:
1) Leave it enabled.
2) Leave it in, but disable it by default.
3) Remove it completely.
Some facts:
The possibility 3) has the nice property of getting rid of the last
pass in the middleend that does not work with CFG, but makes comparing
the old and new loop optimizer more difficult. Also some optimization
are missing in new loop optimizer:
1) Array prefetching. We have speculative prefecthing that may replace
it partially, but can only be used with profile feedback. Array
prefetching is also mostly redundant on modern processors with
hardware prefetching (in fact spoils the code sometimes, for example
did it on x86_64 SPECs the last time I checked). lno-branch loop
prefetching is not quite ready yet (while it works nicely on
micro-benchmarks, it spoils the code for SPECs quite a lot).
2) Loop reversal. Should be trivial to implement with the tree-linear
code, I guess. Redundant with doloop optimization on some platforms.
Below are some benchmark comparisons from x86_64. Base is -O2, peak
is -O2 -fno-loop-optimize -fmove-loop-invariants (i.e. old loop
optimizer disabled, loop invariant motion in new rtl loop optimizer
enabled).
(The wupwise failure is probably some misscompilation due to
-fmove-loop-invariants, I haven't checked yet).
Zdenek
164.gzip 1400 193 726* 1400 193 726*
175.vpr 1400 187 749* 1400 188 745*
176.gcc 1100 116 952* 1100 116 952*
181.mcf 1800 440 409* 1800 445 405*
186.crafty 1000 74.3 1346* 1000 72.7 1376*
197.parser 1800 326 551* 1800 323 556*
252.eon 1300 103 1267* 1300 102 1279*
253.perlbmk 1800 178 1009* 1800 182 989*
254.gap 1100 144 762* 1100 142 772*
255.vortex 1900 169 1126* 1900 165 1149*
256.bzip2 1500 194 773* 1500 194 773*
300.twolf 3000 350 858* 3000 367 818*
Est. SPECint_base2000 835
Est. SPECint2000 834
168.wupwise 1600 200 799 *
171.swim 3100 451 688 * 3100 451 687 *
172.mgrid 1800 552 326 * 1800 486 370 *
173.applu 2100 349 602 * 2100 348 603 *
177.mesa 1400 135 1036 * 1400 137 1024 *
178.galgel X X
179.art 2600 278 937 * 2600 274 951 *
183.equake 1300 156 831 * 1300 157 827 *
187.facerec 1900 290 654 * 1900 307 619 *
188.ammp 2200 248 888 * 2200 251 878 *
189.lucas 2000 235 852 * 2000 232 863 *
191.fma3d X X
200.sixtrack X X
301.apsi 2600 341 762 * 2600 346 750 *
Est. SPECfp_base2000 733
Est. SPECfp2000 731
More information about the Gcc
mailing list