LLVM techniques, tips, and best practices clang and middle-end Libraries: design powerful and reliable compilers using the latest libraries and tools from LLVM
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Birmingham
Packt Publishing Limited
2021
|
Ausgabe: | First published |
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | xii, 350 Seiten Illustrationen, Diagramme |
ISBN: | 9781838824952 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV048383983 | ||
003 | DE-604 | ||
005 | 20220824 | ||
007 | t | ||
008 | 220801s2021 a||| |||| 00||| eng d | ||
020 | |a 9781838824952 |9 978-1-83882-495-2 | ||
035 | |a (OCoLC)1344261132 | ||
035 | |a (DE-599)HBZHT020930909 | ||
040 | |a DE-604 |b ger |e rda | ||
041 | 0 | |a eng | |
049 | |a DE-739 | ||
084 | |a ST 255 |0 (DE-625)143629: |2 rvk | ||
100 | 1 | |a Hsu, Min-Yih |d ca. 20./21. Jh. |e Verfasser |0 (DE-588)1266259937 |4 aut | |
245 | 1 | 0 | |a LLVM techniques, tips, and best practices clang and middle-end Libraries |b design powerful and reliable compilers using the latest libraries and tools from LLVM |c Min-Yih Hsu |
250 | |a First published | ||
264 | 1 | |a Birmingham |b Packt Publishing Limited |c 2021 | |
300 | |a xii, 350 Seiten |b Illustrationen, Diagramme | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
610 | 2 | 7 | |a Compiler |0 (DE-588)1065285353 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Übersetzerbau |0 (DE-588)4121803-6 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Compiler |0 (DE-588)1065285353 |D b |
689 | 0 | 1 | |a Übersetzerbau |0 (DE-588)4121803-6 |D s |
689 | 0 | |5 DE-604 | |
856 | 4 | 2 | |m Digitalisierung UB Passau - ADAM Catalogue Enrichment |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033762782&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-033762782 |
Datensatz im Suchindex
_version_ | 1804184266737713152 |
---|---|
adam_text | Table of Contents Preface Section 1: Build System and LLVM-Specific Tooling 1 Saving Resources When Building LLVM Technical requirements Cutting down building resources with better tooling 4 Replacing GNU Make with Ninja Avoiding the use of the BFD linker 5 6 Tweaking CMake arguments 7 Choosing the right build type Avoiding building all targets 7 8 5 9 9 Building as shared libraries Splitting the debug info Building an optimized version of llvmtblgen Using the new PassManagerand Clang 10 10 Using GN for a faster turnaround time Summary Further reading 11 13 14 2 Exploring LLVM s Build System Features Technical requirements Exploring a glossary of LLVM s important CMake directives Using the CMake function to add new libraries Using the CMake function to add executables and tools 16 16 16 20 Using the CMake function to add Pass plugins 20 Understanding CMake integration for out-of-tree projects Summary 21 24
ii Table of Contents 3 Testing with LLVM LIT Technical requirements 26 Using LIT in out-of-tree projects 26 Writing FileCheck directives 36 Exploring the TestSuite framework 42 Preparing for our example project Importing code into llvm-test-suite 42 43 Summary Further reading 46 46 Technical requirements 48 Introduction to TableGen syntax 48 Printing a recipe via the TableGen backend 60 Layout and records Bang operators Multiclass The DAG data type 50 51 52 53 TableGen s high-level workflow Writing the TableGen backend integrating the RecipePrinter TableGen backend 62 63 55 Summary Further reading 70 70 Preparing for our example project Writing LIT configurations LIT internals 27 29 32 Learning useful FileChecktricks 34 Preparing for our example project 34 4 TableGen Development Writing a donut recipe in TableGen 67 Section 2: Frontend Development 5 Exploring Clang s Architecture Technical requirements Learning Clang s subsystems and their roles 74 LLVM, assemblers, and linkers 75 Exploring Clang s tooling features and extension options 81 Driver 76 80
Table of Contents iii 81 82 83 Summary Further reading 88 Developing custom preprocessor plugins and callbacks The FrontendAction class Clang plugins LibTooling and Clang Tools 85 85 6 Extending the Preprocessor Technical requirements Working with SourceLocation and SourceManager Introducing SourceLocation Introducing SourceManager 89 89 90 Learning preprocessor and lexer essentials 91 Understanding the role of the preprocessor and lexer in Clang Understanding Token Handling macros 92 93 97 The project goal and preparation Implementing a custom pragma handler Implementing custom preprocessor callbacks Summary Exercises 99 100 103 105 108 109 7 Handling AST Technical requirements Learning about AST in Clang 112 113 In-memory structure of Clang AST Types in Clang AST ASTMatcher 113 116 118 Writing AST plugins Project overview Printing diagnostic messages Creating the AST plugin Summary 125 128 132 144 125 8 Working with Compiler Flags and Toolchains Technical requirements Understanding drivers and toolchains in Clang Adding custom driver flags 146 147 150 Project overview Declaring custom driver flags Translating custom driver flags Passing flags to the frontend 150 152 155 161
iv Table of Contents Adding a custom toolchain Project overview Creating the toolchain and adding a custom include path 163 164 Creating a custom assembling stage Creating a custom linking stage Verifying the custom toolchain 167 Summary Exercises 170 173 177 178 179 Section 3: Middle-End Development 9 Working with Pa ss Μ a nager and AnalysisManager Technical requirements Writing an LLVM Pass for the new PassManager 184 Learning instrumentations in the new PassManager 185 Printing Pass pipeline details Printing changes to the IR after each Pass Bisecting the Pass pipeline Project overview Writing the StrictOpt Pass 186 189 Working with the new AnalysisManager 196 Overview of the project Writing the HaltAnalyzer Pass 196 198 Summary Questions 202 203 205 207 208 209 10 Processing LLVM IR Technical requirements Learning LLVM IR basics Iterating different İR units Iterating instructions Iterating basic blocks Iterating the call graph Learning about GraphTraits Working with values and instructions Understanding SSA 212 213 216 216 219 224 225 Working with values Working with instructions Working with loops Learning about loop representation in LLVM Learning about loop infrastructure in LLVM Summary 229 229 232 235 242 243 247 254
Table of Contents v 11 Gearing Up with Support Utilities Technical requirements Printing diagnostic messages Collecting statistics Using the Statistic class Using an optimization remark Adding time measurements Using the Timer class Collecting the time trace 256 257 Introducing the Error class 260 261 Learning about the Expected and ErrorOr classes 264 շ՜7շ 273 Error-handling utilities in LLVM The Expected class 279 280 285 285 The ErrorOr class 287 Summary 289 276 12 Learning LLVM IR Instrumentation Technical requirements Developing a sanitizer An example of using an address sanitizer Creating a loop counter sanitizer Working with PGO 292 293 շց3 introduction to instrumentation-based PGO 317 Introduction to sampling-based PGO 318 Using profiling data analyses 329 296 Summary 316 Assessments Other Books You May Enjoy Index 334
|
adam_txt |
Table of Contents Preface Section 1: Build System and LLVM-Specific Tooling 1 Saving Resources When Building LLVM Technical requirements Cutting down building resources with better tooling 4 Replacing GNU Make with Ninja Avoiding the use of the BFD linker 5 6 Tweaking CMake arguments 7 Choosing the right build type Avoiding building all targets 7 8 5 9 9 Building as shared libraries Splitting the debug info Building an optimized version of llvmtblgen Using the new PassManagerand Clang 10 10 Using GN for a faster turnaround time Summary Further reading 11 13 14 2 Exploring LLVM's Build System Features Technical requirements Exploring a glossary of LLVM's important CMake directives Using the CMake function to add new libraries Using the CMake function to add executables and tools 16 16 16 20 Using the CMake function to add Pass plugins 20 Understanding CMake integration for out-of-tree projects Summary 21 24
ii Table of Contents 3 Testing with LLVM LIT Technical requirements 26 Using LIT in out-of-tree projects 26 Writing FileCheck directives 36 Exploring the TestSuite framework 42 Preparing for our example project Importing code into llvm-test-suite 42 43 Summary Further reading 46 46 Technical requirements 48 Introduction to TableGen syntax 48 Printing a recipe via the TableGen backend 60 Layout and records Bang operators Multiclass The DAG data type 50 51 52 53 TableGen's high-level workflow Writing the TableGen backend integrating the RecipePrinter TableGen backend 62 63 55 Summary Further reading 70 70 Preparing for our example project Writing LIT configurations LIT internals 27 29 32 Learning useful FileChecktricks 34 Preparing for our example project 34 4 TableGen Development Writing a donut recipe in TableGen 67 Section 2: Frontend Development 5 Exploring Clang's Architecture Technical requirements Learning Clang's subsystems and their roles 74 LLVM, assemblers, and linkers 75 Exploring Clang's tooling features and extension options 81 Driver 76 80
Table of Contents iii 81 82 83 Summary Further reading 88 Developing custom preprocessor plugins and callbacks The FrontendAction class Clang plugins LibTooling and Clang Tools 85 85 6 Extending the Preprocessor Technical requirements Working with SourceLocation and SourceManager Introducing SourceLocation Introducing SourceManager 89 89 90 Learning preprocessor and lexer essentials 91 Understanding the role of the preprocessor and lexer in Clang Understanding Token Handling macros 92 93 97 The project goal and preparation Implementing a custom pragma handler Implementing custom preprocessor callbacks Summary Exercises 99 100 103 105 108 109 7 Handling AST Technical requirements Learning about AST in Clang 112 113 In-memory structure of Clang AST Types in Clang AST ASTMatcher 113 116 118 Writing AST plugins Project overview Printing diagnostic messages Creating the AST plugin Summary 125 128 132 144 125 8 Working with Compiler Flags and Toolchains Technical requirements Understanding drivers and toolchains in Clang Adding custom driver flags 146 147 150 Project overview Declaring custom driver flags Translating custom driver flags Passing flags to the frontend 150 152 155 161
iv Table of Contents Adding a custom toolchain Project overview Creating the toolchain and adding a custom include path 163 164 Creating a custom assembling stage Creating a custom linking stage Verifying the custom toolchain 167 Summary Exercises 170 173 177 178 179 Section 3: "Middle-End" Development 9 Working with Pa ss Μ a nager and AnalysisManager Technical requirements Writing an LLVM Pass for the new PassManager 184 Learning instrumentations in the new PassManager 185 Printing Pass pipeline details Printing changes to the IR after each Pass Bisecting the Pass pipeline Project overview Writing the StrictOpt Pass 186 189 Working with the new AnalysisManager 196 Overview of the project Writing the HaltAnalyzer Pass 196 198 Summary Questions 202 203 205 207 208 209 10 Processing LLVM IR Technical requirements Learning LLVM IR basics Iterating different İR units Iterating instructions Iterating basic blocks Iterating the call graph Learning about GraphTraits Working with values and instructions Understanding SSA 212 213 216 216 219 224 225 Working with values Working with instructions Working with loops Learning about loop representation in LLVM Learning about loop infrastructure in LLVM Summary 229 229 232 235 242 243 247 254
Table of Contents v 11 Gearing Up with Support Utilities Technical requirements Printing diagnostic messages Collecting statistics Using the Statistic class Using an optimization remark Adding time measurements Using the Timer class Collecting the time trace 256 257 Introducing the Error class 260 261 Learning about the Expected and ErrorOr classes 264 շ՜7շ 273 Error-handling utilities in LLVM The Expected class 279 280 285 285 The ErrorOr class 287 Summary 289 276 12 Learning LLVM IR Instrumentation Technical requirements Developing a sanitizer An example of using an address sanitizer Creating a loop counter sanitizer Working with PGO 292 293 շց3 introduction to instrumentation-based PGO 317 Introduction to sampling-based PGO 318 Using profiling data analyses 329 296 Summary 316 Assessments Other Books You May Enjoy Index 334 |
any_adam_object | 1 |
any_adam_object_boolean | 1 |
author | Hsu, Min-Yih ca. 20./21. Jh |
author_GND | (DE-588)1266259937 |
author_facet | Hsu, Min-Yih ca. 20./21. Jh |
author_role | aut |
author_sort | Hsu, Min-Yih ca. 20./21. Jh |
author_variant | m y h myh |
building | Verbundindex |
bvnumber | BV048383983 |
classification_rvk | ST 255 |
ctrlnum | (OCoLC)1344261132 (DE-599)HBZHT020930909 |
discipline | Informatik |
discipline_str_mv | Informatik |
edition | First published |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01502nam a2200349 c 4500</leader><controlfield tag="001">BV048383983</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20220824 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">220801s2021 a||| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781838824952</subfield><subfield code="9">978-1-83882-495-2</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)1344261132</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)HBZHT020930909</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rda</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-739</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 255</subfield><subfield code="0">(DE-625)143629:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Hsu, Min-Yih</subfield><subfield code="d">ca. 20./21. Jh.</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)1266259937</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">LLVM techniques, tips, and best practices clang and middle-end Libraries</subfield><subfield code="b">design powerful and reliable compilers using the latest libraries and tools from LLVM</subfield><subfield code="c">Min-Yih Hsu</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">First published</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Birmingham</subfield><subfield code="b">Packt Publishing Limited</subfield><subfield code="c">2021</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">xii, 350 Seiten</subfield><subfield code="b">Illustrationen, Diagramme</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="610" ind1="2" ind2="7"><subfield code="a">Compiler</subfield><subfield code="0">(DE-588)1065285353</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Übersetzerbau</subfield><subfield code="0">(DE-588)4121803-6</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Compiler</subfield><subfield code="0">(DE-588)1065285353</subfield><subfield code="D">b</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">Übersetzerbau</subfield><subfield code="0">(DE-588)4121803-6</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Passau - ADAM Catalogue Enrichment</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033762782&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-033762782</subfield></datafield></record></collection> |
id | DE-604.BV048383983 |
illustrated | Illustrated |
index_date | 2024-07-03T20:19:41Z |
indexdate | 2024-07-10T09:36:37Z |
institution | BVB |
isbn | 9781838824952 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-033762782 |
oclc_num | 1344261132 |
open_access_boolean | |
owner | DE-739 |
owner_facet | DE-739 |
physical | xii, 350 Seiten Illustrationen, Diagramme |
publishDate | 2021 |
publishDateSearch | 2021 |
publishDateSort | 2021 |
publisher | Packt Publishing Limited |
record_format | marc |
spelling | Hsu, Min-Yih ca. 20./21. Jh. Verfasser (DE-588)1266259937 aut LLVM techniques, tips, and best practices clang and middle-end Libraries design powerful and reliable compilers using the latest libraries and tools from LLVM Min-Yih Hsu First published Birmingham Packt Publishing Limited 2021 xii, 350 Seiten Illustrationen, Diagramme txt rdacontent n rdamedia nc rdacarrier Compiler (DE-588)1065285353 gnd rswk-swf Übersetzerbau (DE-588)4121803-6 gnd rswk-swf Compiler (DE-588)1065285353 b Übersetzerbau (DE-588)4121803-6 s DE-604 Digitalisierung UB Passau - ADAM Catalogue Enrichment application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033762782&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Hsu, Min-Yih ca. 20./21. Jh LLVM techniques, tips, and best practices clang and middle-end Libraries design powerful and reliable compilers using the latest libraries and tools from LLVM Compiler (DE-588)1065285353 gnd Übersetzerbau (DE-588)4121803-6 gnd |
subject_GND | (DE-588)1065285353 (DE-588)4121803-6 |
title | LLVM techniques, tips, and best practices clang and middle-end Libraries design powerful and reliable compilers using the latest libraries and tools from LLVM |
title_auth | LLVM techniques, tips, and best practices clang and middle-end Libraries design powerful and reliable compilers using the latest libraries and tools from LLVM |
title_exact_search | LLVM techniques, tips, and best practices clang and middle-end Libraries design powerful and reliable compilers using the latest libraries and tools from LLVM |
title_exact_search_txtP | LLVM techniques, tips, and best practices clang and middle-end Libraries design powerful and reliable compilers using the latest libraries and tools from LLVM |
title_full | LLVM techniques, tips, and best practices clang and middle-end Libraries design powerful and reliable compilers using the latest libraries and tools from LLVM Min-Yih Hsu |
title_fullStr | LLVM techniques, tips, and best practices clang and middle-end Libraries design powerful and reliable compilers using the latest libraries and tools from LLVM Min-Yih Hsu |
title_full_unstemmed | LLVM techniques, tips, and best practices clang and middle-end Libraries design powerful and reliable compilers using the latest libraries and tools from LLVM Min-Yih Hsu |
title_short | LLVM techniques, tips, and best practices clang and middle-end Libraries |
title_sort | llvm techniques tips and best practices clang and middle end libraries design powerful and reliable compilers using the latest libraries and tools from llvm |
title_sub | design powerful and reliable compilers using the latest libraries and tools from LLVM |
topic | Compiler (DE-588)1065285353 gnd Übersetzerbau (DE-588)4121803-6 gnd |
topic_facet | Compiler Übersetzerbau |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033762782&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT hsuminyih llvmtechniquestipsandbestpracticesclangandmiddleendlibrariesdesignpowerfulandreliablecompilersusingthelatestlibrariesandtoolsfromllvm |