This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi, The problem has been previously discussed under following threads http://gcc.gnu.org/ml/gcc/2003-12/msg00700.html http://gcc.gnu.org/ml/gcc/2004-01/msg00042.html After little thought and some experimentation, I realized that peephole2 is not the solution to this problem. Peepholes work on the patterns of insns and hence the insn chain can't be traversed for recombinations. At the same time, I agree that recording insns at the time of split and hacking peephole is fragile. I'd like to advocate defining the target hook for recombining splits in split_all_insns (). If an INSN is split, the target hook is called with PREV_INSN (INSN) and the last insn generated in split as arguments. The target can check for each insn in split sequence as possible candidate for recombination. The default value for the target hook is 0, so it would not burden the targets which do not override it. Certainly, it might help the targets which got interested towards recombining splits. I implemented the hook on SH4 target. I'm combining only ADD insns, since that is requirement for SH. There are a hoard of other operations possible. The attached patch is fully tested with GCC testsuite and stress-1.17. I'm getting the following size gains with -O2 -ml -m4 switches. Stress Mainline With Split %age Testcase GCC Recombination Gain -------- -------- ------------- ----- ls_step.i 3968 3744 5.64 gentest.c 1184 1120 5.4 decode.i 1380 1316 4.63 dct64.i 1792 1728 3.57 navion_gear.i 1912 1848 3.35 ls_accel.i 3232 3136 2.97 scanline.i 2304 2240 2.77 vorbis_mdct.i 2688 2624 2.38 layer3.i 19952 19568 1.92 clip.i 14012 13788 1.6 tonal.i 10928 10768 1.46 layer2.i 2400 2368 1.33 g_misc.i 22140 21852 1.3 slalom.i 9376 9280 1.02 Other test cases showing below 1% improvement are: attstub.i, avl.i, compress.i, gems.i, g_func.i, imdecode.i, index.c, l3psy.i, linpackc.i, lndsub.i, ls_aux.i, mathutil.i, player.i, quantize.i, rengine.i, revolt.i, segment.i, shear.i, slib.i, smallft.i, sound.i, xvalg.i Please review the attached patch and let me know your valuable comments. I'd be thankful. Regards and Thanks, Rakesh Kumar
Attachment:
ChangeLog
Description: Binary data
Attachment:
patch_recombine
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |