Book Image

Getting started with LLVM core libraries

Book Image

Getting started with LLVM core libraries

Overview of this book

Table of Contents (17 chapters)
Getting Started with LLVM Core Libraries
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Overview


The choice of the compiler IR is a very important decision. It determines how much information the optimizations will have to make the code run faster. On one hand, a very high-level IR allows optimizers to extract the original source code intent with ease. On the other hand, a low-level IR allows the compiler to generate code tuned for a particular hardware more easily. The more information you have about the target machine, the more opportunities you have to explore machine idiosyncrasies. Moreover, the task at lower levels must be done with care. As the compiler translates the program to a representation that is closer to machine instructions, it becomes increasingly difficult to map program fragments to the original source code. Furthermore, if the compiler design is exaggerated using a representation that represents a specific target machine very closely, it becomes awkward to generate code for other machines that have different constructs.

This design trade-off has led to different...