Further on in this chapter, we will be looking into register allocation. Before we head to that, however, you must understand the concepts of live variable and live interval. By live intervals, we mean the range in which a variable is live, that is, from the point where a variable is defined to its last use. For this, we need to calculate the set of registers that are immediately dead after the instruction (the last use of a variable), and the set of registers that are used by the instruction but not after the instruction. We calculate live variable information for each virtual register and physical register in the function. Using SSA to sparsely compute the lifetime information for the virtual registers enables us to only track the physical registers within a block. Before register allocation, LLVM assumes that physical registers are live only within a single basic block. This enables it to perform a single, local analysis to resolve physical register lifetimes...
LLVM Cookbook
LLVM Cookbook
Overview of this book
Table of Contents (16 chapters)
LLVM Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
LLVM Design and Use
Steps in Writing a Frontend
Extending the Frontend and Adding JIT Support
Preparing Optimizations
Implementing Optimizations
Target-independent Code Generator
Optimizing the Machine Code
Writing an LLVM Backend
Using LLVM for Various Useful Projects
Index
Customer Reviews