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]

[PATCH] - local factoring on RTL


Hello,

The attached patch contains the code hoisting algorithm for RTL. The
following simple example demonstrates how it works:

if (A) {B; C; D; E; F;}
else   {G; D; B; H;}

Now assume that B and D do not depend on any of the preceding statements.
Then we get the following:

B; D;
if (A) {C; E; F;}
else   {G; H;}

The algorithm is similar to the code hoisting algorithm for
TREE-SSA(http://gcc.gnu.org/ml/gcc-patches/2004-07/msg02476.html), but
this one works on RTL. We've sent another patch earlier in this topic,
which is similar to this one, but the discussions about that path died
away.
(http://gcc.gnu.org/ml/gcc-patches/2004-03/msg01907.html)

Since then the algorithm became more accurate, as it is shown by the results:
  arm-elf: 0,176%
  i686-linux: 0,218%
(Measured on CSiBE v2.0.1. The figures represent code size reduction
compared to the mainline.)

The patch was bootstraped and regtested on arm-elf and i686-linux with no
new failures.

I really would like to know whether there is anybody else interested in
this type of algorithms? Unfortunately, no patches connected to code
factoring have been reviewed. We have lots of ideas how to improve the
algorithms - i.e. how to decrease the generated code size -, but it makes
no sense to get into coding if nobody is interested. Could you please tell
me what to do to get our patches accepted?

Best regards,
  Judit Jasz



2004-10-21 Judit Jasz <jasy@inf.u-szeged.hu>

     * rtl-lfact.c: New file for rtl hoisting
     * fact-common.h: Same
     * Makefile.in: Add it
     * common.opt: Same
     * opts.c: Same
     * timevar.def: Same
     * passes.c Add rest_of_factoring function decl. and call

Attachment: rtl_hoisting.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]