In the previous chapter, we saw how to write a pass in LLVM. We also demonstrated writing a few analysis passes with an example of alias analysis. Those passes just read the source code and gave us information about it. In this chapter, we will go further and write transformation passes that will actually change the source code, trying to optimize it for the faster execution of code. In the first two recipes, we will show you how a transformation pass is written and how it changes the code. After that, we will see how we can make changes in the code of passes to tinker with the behavior of the passes.
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