Add sequence abstraction on tree, add sinking part of local factoring on Tree-SSA.
Some more details about the algorithms and some preliminary results added. To do list published.
The branch is now open. Checkout the cfo-branch branch by following the instructions found in the CVS documentation.
Code factoring is the name of a class of useful optimization techniques developed especially for code size reduction. These approaches aim to reduce size by restructuring the code.
The goal of this project is to add a new extension for improving the code size optimization of GCC with code factoring methods (code motion and merging algorithms). The implementation currently resides on the branch.
Checkout the cfo-branch branch following the instructions found in the CVS documentation.
When posting to the development lists, please mark messages and patches with [cfo] in the subject. The usual contribution and testing rules apply. This branch is maintained by Gabor Loki.
The project includes the following two code factoring algorithms:
// Original source // After local factoring { { I1; // <= HOIST if ( cond ) if ( cond ) { { I0; I0; I1; // <= HOIST I2; // <= SINK I3; // <= SINK } } else else { { I1; // <= HOIST I4; I4; I5; I5; I2; // <= SINK I3; // <= SINK } } I2; // <= SINK I3; // <= SINK } }
// Original source // After sequence abstraction { { void *jump_label; ... ... jump_label = &&exit_0; entry_0: I0; I0; I1; I1; I2; I2; I3; I3; goto *jump_label; exit_0: ... ... jump_label = &&exit_1; goto entry_0; I0; I1; I2; I3; exit_1: ... ... jump_label = &&exit_2; goto entry_0; I0; I1; I2; I3; exit_2: ... ... jump_label = &&exit_3; goto entry_0; I0; I1; I2; I3; exit_3: ... ... } }
Both algorithms have an opportunity of working on two different levels (Tree and RTL). Both have their own advantages and disadvantages. This project holds both types for future investigations.
For more information about code factoring see the GCC Summit Proceedings (2004).
Currently the following algorithms are implemented on the branch:
-frtl-lfact
)-ftree-lfact
)-frtl-seqabstr
)-ftree-seqabstr
)The following results have been prepared using the CSiBE benchmark with respect to the mainline at the last merge (2005-07-11).
Code size save | Compilation time multiplier | |||
---|---|---|---|---|
Target | arm-elf | i686-linux | arm-elf | i686-linux |
Sequence abstraction on RTL | 1.07% | 1.43% | 1.94 | 1.26 |
Sequence abstraction on Tree | 0.34% | 0.18% | 1.25 | 1.25 |
Local factoring on RTL | 0.11% | 0.19% | 1.01 | 0.99 |
Local factoring on Tree-SSA | 0.31% | 0.24% | 1.02 | 1.01 |
Overall | 1.96% | 1.94% | 2.08 | 1.49 |
Please send FSF & GNU inquiries & questions to gnu@gnu.org. There are also other ways to contact the FSF.
These pages are maintained by the GCC team.
For questions related to the use of GCC, please consult these web pages and the GCC manuals. If that fails, the gcc-help@gcc.gnu.org mailing list might help.Copyright (C) Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
Last modified 2006-06-21 |