Presentation is loading. Please wait.

Presentation is loading. Please wait.

October 6, 2004.Software Technology Forum 1 The Renaissance of Compiler Development Com piler optimizations motivated by embedded systems Tibor Gyimóthy.

Similar presentations


Presentation on theme: "October 6, 2004.Software Technology Forum 1 The Renaissance of Compiler Development Com piler optimizations motivated by embedded systems Tibor Gyimóthy."— Presentation transcript:

1 October 6, 2004.Software Technology Forum 1 The Renaissance of Compiler Development Com piler optimizations motivated by embedded systems Tibor Gyimóthy University of Szeged

2 Software Technology Forum2 October 6, 2004. Open Source Laboratory at the University of Szeged

3 Software Technology Forum3 October 6, 2004. Open Source Laboratory at the University of Szeged Beszédes Árpád Ferenc Rudolf Gergely Tamás Gyimóthy Tibor Jász Judit Havasi Ferenc Kiss Ákos Lóki Gábor Patrik Kluba Siket István Siket Péter Sógor Zoltán Tóth Gábor Vidács László

4 Software Technology Forum4 October 6, 2004. The Dragon book

5 Software Technology Forum5 October 6, 2004. Good quality compilers

6 Software Technology Forum6 October 6, 2004. New challenges:embedded processors

7 Software Technology Forum7 October 6, 2004. Low energy computation System-wide optimizations are required for energy-saving. Software design has significant impact on the energy consumption of the processor. Accurate energy models of the hardware modules are required for power analysis at system level.

8 Software Technology Forum8 October 6, 2004. Low energy computation(cont.) Instruction level optimizations include reordering instructions to reduce switching,reduction of memory operands etc. The register relabeling technique reorders the register labels of the generated code. A sample trace and a power model are used to obtain new labels (The Pennsylvania State University).

9 Software Technology Forum9 October 6, 2004. Low energy computation(cont.) ARM is the most popular processor for the embedded domain. The 32 bit ARM processor also supports the 16 bit Thumb instruction set. By using Thumb code the I-cache activity (energy) can be reduced. However,the restricted Thumb instruction set may lead to the loss in performance. Profile guided algorithms were proposed for generating mixed ARM and Thumb code (The University of Arizona)

10 Software Technology Forum10 October 6, 2004. Low energy computation(cont.) System-level power optimizing data-flow transformations are applied for multimedia applications(IMEC,Leuven,Belgium) Main aim is to reduce the power consumption due to data storage and transfers (significant part of the total power budget of the system). Performance and code size must be taken into account as well.

11 Software Technology Forum11 October 6, 2004. Low energy computation(cont.) Tradional compiler approaches focusing only on speed are not sufficient for multimedia applications. The power cost model is linear with respect to the acces frequency and the dependence on the memory size is determined by a polynomial function. Code transformations are applied to the original source code (C). The method reduces the size of the array signals and the acceses to array signals. Very large power savings can be achived without introducing significant performance penalties.

12 Software Technology Forum12 October 6, 2004. Low energy computation(cont.) Closely related to the code size reduction  Executing fewer instructions  Accessing external memory less frequently Agressive code size optimization techniques Post-link time optimizations

13 Software Technology Forum13 October 6, 2004. Code size reductions in GCC A survey paper in ACM Computing Surveys,2003 Magic switches & patches Local factoring Sequence abstraction CSiBE- Code Size Benchmark GCC improvement for Symbian

14 Software Technology Forum14 October 6, 2004. Magic switches & patches Function inlining Tree-to-rtl extension Optimizing large jump tables Extending move and compare parallelization Crossjumping cleanup

15 Software Technology Forum15 October 6, 2004. Local factoring Code motion techniques  Strategy: Move identical instructions from basic blocks to their common predecessor and successor Data and register dependence must not be altered  Implemented: Code hoisting  moving the code to an earlier place in the execution path Code sinking  moving the code to a later execution place

16 Software Technology Forum16 October 6, 2004. Code Hoisting

17 Software Technology Forum17 October 6, 2004. Code sinking

18 Software Technology Forum18 October 6, 2004. Sequence abstraction Sequence Abstraction  Works on SESE code fragments  Strategy: Find region of identical instructions which can be turned into procedures Replace all occurrences with calls to the newly created subroutine

19 Software Technology Forum19 October 6, 2004. Sequence abstraction(cont)

20 Software Technology Forum20 October 6, 2004. Sequence abstraction  RTL implementation: Compilation unit: function No need to create a procedure, create only a call to a labelled representative code region

21 Software Technology Forum21 October 6, 2004. CSiBE-GCC Code Size Benchmark www.inf.u-szeged.hu/CSiBE Introduced in 2003 ‘de facto’ a standard size benchmark for GCC Continuous monitoring the impact of the new patches on the code size New version: compilation time and performance More and more GCC developers are using CSiBE in their daily work

22 Software Technology Forum22 October 6, 2004. CSiBE(cont)

23 Software Technology Forum23 October 6, 2004. CSiBE(cont)

24 Software Technology Forum24 October 6, 2004. CSiBE(cont)

25 Software Technology Forum25 October 6, 2004. Overall tendency of the code size 1.3% 4.3% 5.1% 7.2% 1.3% 4.3% 5.1% 7.2%

26 Software Technology Forum26 October 6, 2004. GCC improvement for Symbian The official Symbian build is based on GCC 2.9, from the year 1998. The GCC 2.95.3 was extended to support the Symbian target. The modified compiler reduces the code size and improves the performance as well (5-10%).

27 Software Technology Forum27 October 6, 2004. Post-link time optimization Interprocedural versions of the classical compiler optimization techniques are used for binary-rewriting of machine code(whole system optimization,Squeeze—Debray et al,ATOM—Univ.of Szeged). Techniques:  Interprocedural control flow analysis,constant propagation,register liveness analysis  Redundant code-elimination  Unreachable-code elimination  Dead-code elimination  Strength-code elimination  Local factoring  Procedural abstraction

28 Software Technology Forum28 October 6, 2004. Some open issues in the GCC development There is a need for effective size optimization methods on Tree-SSA level. The sequence abstraction approach can be extended to the unit-at time level. The post-link time optimization methods can be integrated into GCC.

29 Software Technology Forum29 October 6, 2004. Conclusions Open source software is widely used in the industry There is a need for machine–level programmers Challenge:many people will use their programs

30 Software Technology Forum30 October 6, 2004. Effective compilers for embedded processors


Download ppt "October 6, 2004.Software Technology Forum 1 The Renaissance of Compiler Development Com piler optimizations motivated by embedded systems Tibor Gyimóthy."

Similar presentations


Ads by Google