Chapter 6. Target-independent Code Generator

In this chapter, we will cover the following recipes:

  • The life of an LLVM IR instruction
  • Visualizing the LLVM IR CFG using GraphViz
  • Describing the target using TableGen
  • Defining an instruction set
  • Adding a machine code descriptor
  • Implementing the MachineInstrBuilder class
  • Implementing the MachineBasicBlock class
  • Implementing the MachineFunction class
  • Writing an instruction selector
  • Legalizing SelectionDAG
  • Optimizing SelectionDAG
  • Selecting instructions from the DAG
  • Scheduling instructions in SelectionDAG

Introduction

After optimizing the LLVM IR, it needs to be converted into machine instructions for execution. The machine-independent code generator interface gives an abstract layer that helps convert IR into machine ...

Get LLVM Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.