LLVM Essentials(Paperback)

Suyog Sarda, Mayur Pandey

  • 出版商: Packt Publishing
  • 出版日期: 2015-12-09
  • 售價: $1,140
  • 貴賓價: 9.5$1,083
  • 語言: 英文
  • 頁數: 166
  • 裝訂: Paperback
  • ISBN: 1785280805
  • ISBN-13: 9781785280801
  • 相關分類: Compiler
  • 立即出貨 (庫存=1)

買這商品的人也買了...

相關主題

商品描述

Become familiar with the LLVM infrastructure and start using LLVM libraries to design a compiler

About This Book

  • Learn to use the LLVM libraries to emit intermediate representation (IR) from high-level language
  • Build your own optimization pass for better code generation
  • Understand AST generation and use it in a meaningful way

Who This Book Is For

This book is intended for those who already know some of the concepts of compilers and want to quickly get familiar with the LLVM infrastructure and the rich set of libraries that it provides.

What You Will Learn

  • Get an introduction to LLVM modular design and LLVM tools
  • Convert frontend code to LLVM IR
  • Implement advanced LLVM IR paradigms
  • Understand the LLVM IR Optimization Pass Manager infrastructure and write an optimization pass
  • Absorb LLVM IR transformations
  • Understand the steps involved in converting LLVM IR to Selection DAG
  • Implement a custom target using the LLVM infrastructure
  • Get a grasp of C's frontend clang, an AST dump, and static analysis

In Detail

LLVM is currently the point of interest for many firms, and has a very active open source community. It provides us with a compiler infrastructure that can be used to write a compiler for a language. It provides us with a set of reusable libraries that can be used to optimize code, and a target-independent code generator to generate code for different backends. It also provides us with a lot of other utility tools that can be easily integrated into compiler projects.

This book details how you can use the LLVM compiler infrastructure libraries effectively, and will enable you to design your own custom compiler with LLVM in a snap.

We start with the basics, where you'll get to know all about LLVM. We then cover how you can use LLVM library calls to emit intermediate representation (IR) of simple and complex high-level language paradigms. Moving on, we show you how to implement optimizations at different levels, write an optimization pass, generate code that is independent of a target, and then map the code generated to a backend. The book also walks you through CLANG, IR to IR transformations, advanced IR block transformations, and target machines.

By the end of this book, you'll be able to easily utilize the LLVM libraries in your own projects.

Style and approach

This book deals with topics sequentially, increasing the difficulty level in a step-by-step approach. Each topic is explained with a detailed example, and screenshots are included to help you understand the examples.

商品描述(中文翻譯)

熟悉LLVM基礎架構並開始使用LLVM庫來設計編譯器

關於本書
- 學習使用LLVM庫從高階語言中生成中間表示(IR)
- 構建自己的優化過程以獲得更好的代碼生成
- 理解AST生成並以有意義的方式使用它

本書適合對編譯器概念有一定了解並希望快速熟悉LLVM基礎架構和其提供的豐富庫集的讀者。

你將學到什麼
- 介紹LLVM模塊化設計和LLVM工具
- 將前端代碼轉換為LLVM IR
- 實現高級LLVM IR範例
- 理解LLVM IR優化過程管理器基礎架構並編寫優化過程
- 掌握LLVM IR轉換
- 理解將LLVM IR轉換為Selection DAG的步驟
- 使用LLVM基礎架構實現自定義目標
- 瞭解C的前端Clang、AST轉儲和靜態分析

詳細內容
LLVM目前是許多公司關注的焦點,並且擁有非常活躍的開源社區。它為我們提供了一個編譯器基礎架構,可用於編寫語言的編譯器。它還為我們提供了一組可重用的庫,用於優化代碼,以及一個獨立於目標的代碼生成器,用於為不同的後端生成代碼。它還為我們提供了許多其他實用工具,可以輕鬆集成到編譯器項目中。

本書詳細介紹了如何有效使用LLVM編譯器基礎架構庫,並使您能夠在短時間內使用LLVM設計自己的自定義編譯器。

我們從基礎知識開始,您將了解有關LLVM的一切。然後,我們介紹如何使用LLVM庫調用來生成簡單和複雜高階語言範例的中間表示(IR)。接著,我們向您展示如何在不同層次上實現優化,編寫優化過程,生成與目標無關的代碼,然後將生成的代碼映射到後端。本書還介紹了CLANG、IR到IR轉換、高級IR塊轉換和目標機器。

通過閱讀本書,您將能夠輕鬆地在自己的項目中使用LLVM庫。

風格和方法
本書按順序介紹主題,以逐步增加的難度進行。每個主題都有詳細的示例,並包含屏幕截圖,以幫助您理解示例。