Endre søk
RefereraExporteraLink to record
Permanent link

Direct link
Referera
Referensformat
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Annet format
Fler format
Språk
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Annet språk
Fler språk
Utmatningsformat
  • html
  • text
  • asciidoc
  • rtf
Constraint-Based Register Allocation and Instruction Scheduling
KTH, Skolan för elektroteknik och datavetenskap (EECS), Datavetenskap, Programvaruteknik och datorsystem, SCS. RISE SICS (Swedish Institute of Computer Science).ORCID-id: 0000-0002-2806-7333
2018 (engelsk)Doktoravhandling, med artikler (Annet vitenskapelig)
Abstract [en]

Register allocation (mapping variables to processor registers or memory) and instruction scheduling (reordering instructions to improve latency or throughput) are central compiler problems. This dissertation proposes a combinatorial optimization approach to these problems that delivers optimal solutions according to a model, captures trade-offs between conflicting decisions, accommodates processor-specific features, and handles different optimization criteria.

The use of constraint programming and a novel program representation enables a compact model of register allocation and instruction scheduling. The model captures the complete set of global register allocation subproblems (spilling, assignment, live range splitting, coalescing, load-store optimization, multi-allocation, register packing, and rematerialization) as well as additional subproblems that handle processor-specific features beyond the usual scope of conventional compilers.

The approach is implemented in Unison, an open-source tool used in industry and research that complements the state-of-the-art LLVM compiler. Unison applies general and problem-specific constraint solving methods to scale to medium-sized functions, solving functions of up to 647 instructions optimally and improving functions of up to 874 instructions. The approach is evaluated experimentally using different processors (Hexagon, ARM and MIPS), benchmark suites (MediaBench and SPEC CPU2006), and optimization criteria (speed and code size reduction). The results show that Unison generates code of slightly to significantly better quality than LLVM, depending on the characteristics of the targeted processor (1% to 9.3% mean estimated speedup; 0.8% to 3.9% mean code size reduction). Additional experiments for Hexagon show that its estimated speedup has a strong monotonic relationship to the actual execution speedup, resulting in a mean speedup of 5.4% across MediaBench applications.

The approach contributed by this dissertation is the first of its kind that is practical (it captures the complete set of subproblems, scales to medium-sized functions, and generates executable code) and effective (it generates better code than the LLVM compiler, fulfilling the promise of combinatorial optimization). It can be applied to trade compilation time for code quality beyond the usual optimization levels, explore and exploit processor-specific features, and identify improvement opportunities in conventional compilers.

Abstract [sv]

Registerallokering (tilldelning av programvariabler till processorregister eller minne) och instruktionsschemaläggning (omordning av instruktioner för att förbättra latens eller genomströmning) är centrala kompilatorproblem. Denna avhandling presenterar en kombinatorisk optimeringsmetod för dessa problem. Metoden, som är baserad på en formell modell, är kraftfull nog att ge optimala lösningar och göra avvägningar mellan motstridiga optimeringsval. Den kan till fullo uttnyttja processorspecifika funktioner och uttrycka olika optimeringsmål.

Användningen av villkorsprogrammering och en ny programrepresentation möjliggör en kompakt modell av registerallokering och instruktionsschemaläggning. Modellen omfattar samtliga delproblem som ingår i global registerallokering: spilling, tilldelning, live range splitting, coalescing, load-store-optimering, flertilldelning, registerpackning och rematerialisering. Förutom dessa, kan den också integrera processorspecifika egenskaper som går utanför vad konventionella kompilatorer hanterar.

Metoden implementeras i Unison, ett öppen-källkods-verktyg som används inom industri- och forskningsvärlden och utgör ett komplement till LLVM-kompilatorn. Unison tillämpar allmänna och problemspecifika villkorslösningstekniker för att skala till medelstora funktioner, lösa funktioner med upp till 647 instruktioner optimalt och förbättra funktioner på upp till 874 instruktioner. Metoden utvärderas experimentellt för olika målprocessorer (Hexagon, ARM och MIPS), benchmark-sviter (MediaBench och SPEC CPU2006) och optimeringsmål (hastighet och kodstorlek). Resultaten visar att Unison genererar kod av något till betydligt bättre kvalitet än LLVM. Den uppskattade hastighetsförbättringen varierar mellan 1% till 9.3% och kodstorleksreduktionen mellan 0.8% till~3.9%, beroende på målprocessor. Ytterligare experiment för Hexagon visar att dess uppskattade hastighetsförbättring har ett starkt monotoniskt förhållande till den faktiska exekveringstiden, vilket resulterar i en 5.4% genomsnittlig hastighetsförbättring för MediaBench-applikationer.

Denna avhandling beskriver den första praktiskt användbara kombinatoriska optimeringsmetoden för integrerad registerallokering och instruktionsschemaläggning. Metoden är praktiskt användbar då den hanterar samtliga ingående delproblem, genererar exekverbar maskinkod och skalar till medelstora funktioner. Den är också effektiv då den genererar bättre maskinkod än LLVM-kompilatorn. Metoden kan tillämpas för att byta kompileringstid mot kodkvalitet utöver de vanliga optimeringsnivåerna, utforska och utnyttja processorspecifika egenskaper samt identifiera förbättringsmöjligheter i konventionella kompilatorer.

sted, utgiver, år, opplag, sider
Stockholm: KTH Royal Institute of Technology, 2018. , s. 60
Serie
TRITA-EECS-AVL ; 2018:48
Serie
SICS Dissertation Series, ISSN 1101-1335 ; 78
Emneord [en]
constraint programming, combinatorial optimization, register allocation, instruction scheduling, compiler construction
HSV kategori
Forskningsprogram
Informations- och kommunikationsteknik
Identifikatorer
URN: urn:nbn:se:kth:diva-232192ISBN: 978-91-7729-853-3 (tryckt)OAI: oai:DiVA.org:kth-232192DiVA, id: diva2:1232941
Disputas
2018-09-03, Sal Ka-208, Electrum, Kistagången 16, Kista, Stockholm, 13:15 (engelsk)
Opponent
Veileder
Merknad

QC 20180716

Tilgjengelig fra: 2018-07-16 Laget: 2018-07-13 Sist oppdatert: 2022-06-26bibliografisk kontrollert
Delarbeid
1. Survey on Combinatorial Register Allocation and Instruction Scheduling
Åpne denne publikasjonen i ny fane eller vindu >>Survey on Combinatorial Register Allocation and Instruction Scheduling
2018 (engelsk)Inngår i: ACM Computing Surveys, ISSN 0360-0300, E-ISSN 1557-7341Artikkel i tidsskrift (Fagfellevurdert) In press
Abstract [en]

Register allocation (mapping variables to processor registers or memory) and instruction scheduling (reordering instructions to increase instruction-level parallelism) are essential tasks for generating efficient assembly code in a compiler. In the last three decades, combinatorial optimization has emerged as an alternative to traditional, heuristic algorithms for these two tasks. Combinatorial optimization approaches can deliver optimal solutions according to a model, can precisely capture trade-offs between conflicting decisions, and are more flexible at the expense of increased compilation time.

This paper provides an exhaustive literature review and a classification of combinatorial optimization approaches to register allocation and instruction scheduling, with a focus on the techniques that are most applied in this context: integer programming, constraint programming, partitioned Boolean quadratic programming, and enumeration. Researchers in compilers and combinatorial optimization can benefit from identifying developments, trends, and challenges in the area; compiler practitioners may discern opportunities and grasp the potential benefit of applying combinatorial optimization.

sted, utgiver, år, opplag, sider
ACM Press, 2018
HSV kategori
Forskningsprogram
Datalogi
Identifikatorer
urn:nbn:se:kth:diva-232189 (URN)
Forskningsfinansiär
Swedish Research Council, 621-2011-6229
Merknad

Not duplicate with DiVA 1348978.

Not duplicate with DiVA 758112.

QC 20180823

Tilgjengelig fra: 2018-07-13 Laget: 2018-07-13 Sist oppdatert: 2022-06-26bibliografisk kontrollert
2. Constraint-Based Register Allocation and Instruction Scheduling
Åpne denne publikasjonen i ny fane eller vindu >>Constraint-Based Register Allocation and Instruction Scheduling
2012 (engelsk)Inngår i: Principles and Practice of Constraint Programming: 18th International Conference, CP 2012, Québec City, QC, Canada, October 8-12, 2012. Proceedings / [ed] Michela Milano, Springer, 2012, s. 750-766Konferansepaper, Publicerat paper (Fagfellevurdert)
Abstract [en]

This paper introduces a constraint model and solving techniques for code generation in a compiler back-end. It contributes a new model for global register allocation that combines several advanced aspects: multiple register banks (subsuming spilling to memory), coalescing, and packing. The model is extended to include instruction scheduling and bundling. The paper introduces a decomposition scheme exploiting the underlying program structure and exhibiting robust behavior for functions with thousands of instructions. Evaluation shows that code quality is on par with LLVM, a state-of-the-art compiler infrastructure.

The paper makes important contributions to the applicability of constraint programming as well as compiler construction: essential concepts are unified in a high-level model that can be solved by readily available modern solvers. This is a significant step towards basing code generation entirely on a high-level model and by this facilitates the construction of correct, simple, flexible, robust, and high-quality code generators.

sted, utgiver, år, opplag, sider
Springer, 2012
Serie
Lecture Notes in Computer Science, ISSN 0302-9743 ; 7514
Emneord
Computer programming, Constraint theory, Flocculation, Network components
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-104554 (URN)10.1007/978-3-642-33558-7_54 (DOI)2-s2.0-84868266938 (Scopus ID)978-3-642-33557-0 (ISBN)978-3-642-33558-7 (ISBN)
Konferanse
18th International Conference on Principles and Practice of Constraint Programming, CP 2012; Quebec City, QC; 8 October 2012 through 12 October 2012
Merknad

QC 20121212

Tilgjengelig fra: 2012-11-05 Laget: 2012-11-05 Sist oppdatert: 2022-06-24bibliografisk kontrollert
3. Combinatorial Spill Code Optimization and Ultimate Coalescing
Åpne denne publikasjonen i ny fane eller vindu >>Combinatorial Spill Code Optimization and Ultimate Coalescing
2014 (engelsk)Inngår i: SIGPLAN notices, ISSN 0362-1340, E-ISSN 1558-1160, Vol. 49, nr 5, s. 23-32Artikkel i tidsskrift (Fagfellevurdert) Published
Abstract [en]

This paper presents a novel combinatorial model that integrates global register allocation based on ultimate coalescing, spill code optimization, register packing, and multiple register banks with instruction scheduling (including VLIW). The model exploits alternative temporaries that hold the same value as a new concept for ultimate coalescing and spill code optimization. The paper presents Unison as a code generator based on the model and advanced solving techniques using constraint programming. Thorough experiments using MediaBench and a processor (Hexagon) that are typical for embedded systems demonstrate that Unison: is robust and scalable; generates faster code than LLVM (up to 4 1 % with a mean improvement of 7 %); possibly generates optimal code (for 2 9 % of the experiments); effortlessly supports different optimization criteria (code size on par with LLVM). Unison is significant as it addresses the same aspects as traditional code generation algorithms, yet is based on a simple integrated model and robustly can generate optimal code.

Emneord
spill code optimization, ultimate coalescing, combinatorial optimization, register allocation, instruction scheduling
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-154398 (URN)10.1145/2597809.2597815 (DOI)000341937800004 ()2-s2.0-84905660668 (Scopus ID)
Forskningsfinansiär
Swedish Research Council, VR 621-2011-6229
Merknad

QC 20141021

Tilgjengelig fra: 2014-10-21 Laget: 2014-10-20 Sist oppdatert: 2022-06-23bibliografisk kontrollert
4. Combinatorial Register Allocation and Instruction Scheduling
Åpne denne publikasjonen i ny fane eller vindu >>Combinatorial Register Allocation and Instruction Scheduling
2018 (engelsk)Rapport (Annet vitenskapelig)
Abstract [en]

This paper introduces a combinatorial optimization approach to register allocation and instruction scheduling, two central compiler problems. Combinatorial optimization has the potential to solve these problems optimally and to exploit processor-specific features readily. Our approach is the first to leverage this potential in practice: it captures the complete set of program transformations used in state-of-the-art compilers, scales to medium-sized functions of up to 1000 instructions, and generates executable code. This level of practicality is reached by using constraint programming, a particularly suitable combinatorial optimization technique. Unison, the implementation of our approach, is open source, used in industry, and integrated with the LLVM toolchain.

An extensive evaluation of estimated speed, code size, and scalability confirms that Unison generates better code than LLVM while scaling to medium-sized functions. The evaluation uses systematically selected benchmarks from MediaBench and SPEC CPU2006 and different processor architectures (Hexagon, ARM, MIPS). Mean estimated speedup ranges from 1% to 9.3% and mean code size reduction ranges from 0.8% to 3.9% for the different architectures. Executing the generated code on Hexagon confirms that the estimated speedup indeed results in actual speedup. Given a fixed time limit, Unison solves optimally functions of up to 647 instructions, delivers improved solutions for functions of up to 874 instructions, and achieves more than 85% of the potential speed for 90% of the functions on Hexagon.

The results in this paper show that our combinatorial approach can be used in practice to trade compilation time for code quality beyond the usual compiler optimization levels, fully exploit processor-specific features, and identify improvement opportunities in existing heuristic algorithms.

HSV kategori
Forskningsprogram
Datalogi
Identifikatorer
urn:nbn:se:kth:diva-232118 (URN)
Merknad

QC 20180822

Tilgjengelig fra: 2018-07-11 Laget: 2018-07-11 Sist oppdatert: 2024-03-15bibliografisk kontrollert
5. Register allocation and instruction scheduling in Unison
Åpne denne publikasjonen i ny fane eller vindu >>Register allocation and instruction scheduling in Unison
2016 (engelsk)Inngår i: Proceedings of CC 2016: The 25th International Conference on Compiler Construction, Association for Computing Machinery (ACM), 2016, s. 263-264Konferansepaper, Publicerat paper (Fagfellevurdert)
Abstract [en]

This paper describes Unison, a simple, flexible, and potentially optimal software tool that performs register allocation and instruction scheduling in integration using combinatorial optimization. The tool can be used as an alternative or as a complement to traditional approaches, which are fast but complex and suboptimal. Unison is most suitable whenever high-quality code is required and longer compilation times can be tolerated (such as in embedded systems or library releases), or the targeted processors are so irregular that traditional compilers fail to generate satisfactory code.

sted, utgiver, år, opplag, sider
Association for Computing Machinery (ACM), 2016
Emneord
Combinatorial optimization, Instruction scheduling, Register allocation
HSV kategori
Identifikatorer
urn:nbn:se:kth:diva-183393 (URN)10.1145/2892208.2892237 (DOI)000389808800026 ()2-s2.0-84966560429 (Scopus ID)9781450342414 (ISBN)
Konferanse
25th International Conference on Compiler Construction, CC 2016, Barcelona, Spain, 17 March 2016 through 18 March 2016
Merknad

QC 20161122

Tilgjengelig fra: 2016-03-09 Laget: 2016-03-09 Sist oppdatert: 2024-03-15bibliografisk kontrollert

Open Access i DiVA

fulltext(662 kB)1947 nedlastinger
Filinformasjon
Fil FULLTEXT01.pdfFilstørrelse 662 kBChecksum SHA-512
e7713b70142e3c1a8eef6f316d83db59dad71bf23ed8637de493b5505edf485df9e01c735ed90a0afa0bf790505471c6a7268e97c43d754fb0aa452bbb2a6ba0
Type fulltextMimetype application/pdf

Person

Castañeda Lozano, Roberto

Søk i DiVA

Av forfatter/redaktør
Castañeda Lozano, Roberto
Av organisasjonen

Søk utenfor DiVA

GoogleGoogle Scholar
Totalt: 1952 nedlastinger
Antall nedlastinger er summen av alle nedlastinger av alle fulltekster. Det kan for eksempel være tidligere versjoner som er ikke lenger tilgjengelige

isbn
urn-nbn

Altmetric

isbn
urn-nbn
Totalt: 3487 treff
RefereraExporteraLink to record
Permanent link

Direct link
Referera
Referensformat
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Annet format
Fler format
Språk
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Annet språk
Fler språk
Utmatningsformat
  • html
  • text
  • asciidoc
  • rtf