售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
LLVM Cookbook
Table of Contents
LLVM Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. LLVM Design and Use
Introduction
Understanding modular design
Getting ready
How to do it...
How it works...
There's more...
See also
Cross-compiling Clang/LLVM
Getting ready
How to do it...
How it works...
Converting a C source code to LLVM assembly
Getting ready
How to do it...
How it works...
See also
Converting IR to LLVM bitcode
Getting Ready
How to do it...
How it works...
There's more...
See also
Converting LLVM bitcode to target machine assembly
Getting ready
How to do it...
How it works...
There's more...
Converting LLVM bitcode back to LLVM assembly
Getting ready
How to do it...
How it works...
Transforming LLVM IR
Getting ready
How to do it...
How it works...
There's more...
Linking LLVM bitcode
Getting ready
How to do it...
How it works...
Executing LLVM bitcode
Getting ready
How to do it...
How it works...
See also
Using the C frontend Clang
Getting ready
How to do it…
How it works...
See also
Using the GO frontend
Getting ready
How to do it…
How it works…
See also
Using DragonEgg
Getting ready
How to do It…
See also
2. Steps in Writing a Frontend
Introduction
Defining a TOY language
How to do it…
Implementing a lexer
Getting ready
How to do it…
How it works…
See also
Defining Abstract Syntax Tree
Getting ready
How to do it…
How it works…
See also
Implementing a parser
Getting ready
How to do it…
How it works…
See also
Parsing simple expressions
Getting ready
How to do it…
How it works…
Parsing binary expressions
Getting ready
How to do it…
See also
Invoking a driver for parsing
How to do it…
How it works…
See also
Running lexer and parser on our TOY language
Getting ready
How to do it…
How it works…
See also
Defining IR code generation methods for each AST class
Getting ready
How to do it…
How it works…
Generating IR code for expressions
How to do it…
See also
Generating IR code for functions
How to do it…
How it works…
See also
Adding IR optimization support
How to do it…
See also
3. Extending the Frontend and Adding JIT Support
Introduction
Handling decision making paradigms – if/then/else constructs
Getting ready
How to do it...
How it works…
See also
Generating code for loops
Getting ready
How to do it...
How it works...
See also
Handling user-defined operators – binary operators
Getting ready
How to do it...
How it works...
See also
Handling user-defined operators – unary operators
Getting ready
How to do it...
How it works...
See also
Adding JIT support
How to do it...
How it works…
4. Preparing Optimizations
Introduction
Various levels of optimization
Getting ready...
How to do it…
How it works…
See Also
Writing your own LLVM pass
Getting ready
How to do it…
How it works
See also
Running your own pass with the opt tool
How to do it…
How it works…
See also
Using another pass in a new pass
Getting ready
How to do it…
How it works…
There's more…
Registering a pass with pass manager
Getting ready
How to do it…
How it works…
See Also
Writing an analysis pass
Getting ready
How to do it…
How it works…
Writing an alias analysis pass
Getting ready
How to do it...
How it works…
See also
Using other analysis passes
Getting ready…
How to do it…
How it works…
See also
5. Implementing Optimizations
Introduction
Writing a dead code elimination pass
Getting ready
How to do it…
How it works…
See also
Writing an inlining transformation pass
Getting ready
How to do it…
How it works...
Writing a pass for memory optimization
Getting ready
How to do it…
How it works…
See also
Combining LLVM IR
Getting started
How to do it…
How it works…
See also
Transforming and optimizing loops
Getting ready
How to do it…
How it works…
Reassociating expressions
Getting Ready
How to do it…
How it works …
Vectorizing IR
Getting ready
How to do it...
How it works…
See also…
Other optimization passes
Getting ready…
How to do it…
How it works…
See also
6. Target-independent Code Generator
Introduction
The life of an LLVM IR instruction
C Code to LLVM IR
IR optimization
LLVM IR to SelectionDAG
SelectionDAG legalization
Conversion from target-independent DAG to machine DAG
Scheduling instructions
Register allocation
Code emission
Visualizing LLVM IR CFG using GraphViz
Getting ready
How to do it…
See also
Describing targets using TableGen
Getting ready
How to do it
How it works
See also
Defining an instruction set
Getting ready
How to do it…
How it works…
See also
Adding a machine code descriptor
How it's done…
How it works…
Implementing the MachineInstrBuilder class
How to do it…
How it works…
Implementing the MachineBasicBlock class
How to do it…
How it works…
See also
Implementing the MachineFunction class
How to do it…
How it works…
See also
Writing an instruction selector
How to do it…
How it works…
Legalizing SelectionDAG
How to do it…
How it works…
Optimizing SelectionDAG
How to do it…
How it works…
See also
Selecting instruction from the DAG
How to do it…
How it works…
See also
Scheduling instructions in SelectionDAG
How to do it…
How it works…
See also
7. Optimizing the Machine Code
Introduction
Eliminating common subexpression from machine code
How to do it…
How it works…
See more
Analyzing live intervals
Getting ready
How to do it…
How it works…
See also
Allocating registers
Getting ready
How to do it…
How it works…
See also
Inserting the prologue-epilogue code
How to do it…
How it works…
Code emission
How to do it…
Tail call optimization
Getting ready
How to do it…
How it works…
Sibling call optimisation
Getting ready
How to do it…
How it works…
8. Writing an LLVM Backend
Introduction
A sample backend
Defining registers and registers sets
Getting ready
How to do it…
How it works…
See also
Defining the calling convention
How to do it…
How it works…
See also
Defining the instruction set
How to do it…
How it works…
See also
Implementing frame lowering
Getting ready
How to do it…
How it works…
See also
Printing an instruction
Getting ready
How to do it…
How it works…
Selecting an instruction
Getting ready
How to do it…
How it works…
See also
Adding instruction encoding
How to do it…
How it works…
See also
Supporting a subtarget
How to do it…
See also
Lowering to multiple instructions
How to do it…
How it works…
See also
Registering a target
How to do it…
How it works…
See also
9. Using LLVM for Various Useful Projects
Introduction
Exception handling in LLVM
Getting ready...
How to do it…
How it works…
See also
Using sanitizers
Getting ready
How to do it…
How it works…
See also…
Writing the garbage collector with LLVM
Getting ready
How to do it…
How it works…
See also
Converting LLVM IR to JavaScript
Getting ready
How to do it…
See more
Using the Clang Static Analyzer
Getting ready
How to do it…
How it works…
See also
Using bugpoint
Getting ready
How to do it…
How it works…
See also
Using LLDB
Getting ready
How to do it…
See also
Using LLVM utility passes
Getting ready
How to do it...
See also
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜