Factoring algorithms on rtl ?
Gábor Lóki
loki@inf.u-szeged.hu
Tue Feb 17 12:14:00 GMT 2004
Hi,
at this moment gcc generates many similar or identical rtl instructions
when optimizing for size. I think some code factoring algorithms could
help in this problem. Specifically we are working on:
- local prefix/suffix factoring
- local common insns sequences abtraction
- function abstraction
For the first method, I'm working on a very simple algorithm to
eliminate identical local prefix insns of a basic blocks on rtl.
The attached patch finds those basic blocks of which the first insns
are indentical, and factor out them into the end of parent basic blocks.
This is done only if it has no side effects and the count of original
insns - marked for factoring - is greater than the count of parent basic
blocks.
This version of the patch only contains the local prefix factoring
algorithms, but I hope the suffix version of this algorithms will be
finished very soon.
I measured the size with CSiBE, and found about 0,1%/0,66% code size
save for arm/i386 targets with -Os. Bootstrapped on i386-linux and
regtested on arm-elf, i386-linux with no new failures.
This patch is only in a very experimental phase. I think it is not ready
for commit, but I would be happy to get some comments about it.
Is it acceptable for 3.5.x? Is this work useful at all?
Regards,
GĂĄbor LĂłki
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fact.patch
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20040217/8e5d4c46/attachment.ksh>
More information about the Gcc
mailing list