1 / 30

The Renaissance of Compiler Development

The Renaissance of Compiler Development. Com piler optimizations motivated by embedded systems Tibor Gyimóthy University of Szeged. 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.

hoshiko
Télécharger la présentation

The Renaissance of Compiler Development

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Renaissance of Compiler Development Compiler optimizations motivated by embedded systems Tibor Gyimóthy University of Szeged Software Technology Forum

  2. Open Source Laboratory at the University of Szeged Software Technology Forum

  3. 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ó Open Source Laboratory at the University of Szeged Software Technology Forum

  4. The Dragon book Software Technology Forum

  5. Good quality compilers Software Technology Forum

  6. New challenges:embedded processors Software Technology Forum

  7. 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. Software Technology Forum

  8. 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). Software Technology Forum

  9. 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) Software Technology Forum

  10. 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. Software Technology Forum

  11. 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. Software Technology Forum

  12. 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 Software Technology Forum

  13. 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 Software Technology Forum

  14. Magic switches & patches • Function inlining • Tree-to-rtl extension • Optimizing large jump tables • Extending move and compare parallelization • Crossjumping cleanup Software Technology Forum

  15. 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 Software Technology Forum

  16. Code Hoisting Software Technology Forum

  17. Code sinking Software Technology Forum

  18. 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 Software Technology Forum

  19. Sequence abstraction(cont) Software Technology Forum

  20. Sequence abstraction • RTL implementation: • Compilation unit: function • No need to create a procedure, create only a call to a labelled representative code region Software Technology Forum

  21. 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 Software Technology Forum

  22. CSiBE(cont) Software Technology Forum

  23. CSiBE(cont) Software Technology Forum

  24. CSiBE(cont) Software Technology Forum

  25. Overall tendency of the code size 1.3% 1.3% 4.3% 5.1% 4.3% 5.1% 7.2% 7.2% Software Technology Forum

  26. 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%). Software Technology Forum

  27. 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 Software Technology Forum

  28. 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. Software Technology Forum

  29. 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 Software Technology Forum

  30. Effective compilers for embedded processors Software Technology Forum

More Related