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

Using standalone tools


We can also exercise the compilation workflow described previously through the usage of LLVM standalone tools, linking the output of one tool into the output of another. Although this slows downs the compilation due to the use of the disk to write intermediary files, it is an interesting didactic exercise to observe the compilation pipeline. This also allows you to fine-tune the parameters given to intermediary tools. Some of these tools are as follows:

  • opt: This is a tool that is aimed at optimizing a program at the IR level. The input must be an LLVM bitcode file (encoded LLVM IR) and the generated output file must have the same type.

  • llc: This is a tool that converts the LLVM bitcode to a target-machine assembly language file or object file via a specific backend. You can pass arguments to select an optimization level, to turn on debugging options, and to enable or disable target-specific optimizations.

  • llvm-mc: This tool is able to assemble instructions and generate...