What is LLVM?
abhinav Ashok kumar
Curating Insights & Innovating in GPU Compiler | Performance Analyst at Qualcomm | LLVM Contributor | Maintain News Letter | AI/ML in Compiler
This is an introduction to understand what is the?LLVM?compiler infrastructure. This blog should be enough for the engineer who want to know what to get familiar with llvm (Low Level Virtual Machine)is.
LLVM is a compiler framework which is designed to support transparent, lifelong program analysis and transformation for arbitrary programs, by providing high-level information to compiler transformations at compile-time, link-time, run-time, and in idle time between runs. LLVM defines a common, low-level code representation in Static Single Assignment (SSA) form, with several novel features: a simple, language-independent type-system that exposes the primitives commonly used to implement high-level language features; an instruction for typed address arithmetic; and a simple mechanism that can be used to implement the exception handling features of high-level languages (and setjmp/longjmp in C) uniformly and efficiently.
LLVM is nicely written: its architecture is?way?more modular than other compilers framework .
?LLVM have become an industrial-strength compiler framework where lots of Proprietary compiler use LLVM as a backend.
Modern applications are increasing in size, change their behavior significantly during execution, support dynamic extensions and upgrades, and often have components written in multiple different languages. While some applications have small hot spots, others spread their execution time evenly throughout the application . In order to maximize the efficiency of all of these programs, we believe that program analysis and transformation must be performed throughout the lifetime of a program. Such “lifelong code optimization” techniques encompass inter-procedural optimizations performed at link-time (to preserve the benefits of separate compilation), machine-dependent optimizations at install time on each system, dynamic optimization at runtime, and profile-guided optimization between runs (“idle time”) using profile information collected from the end-user.
LLVM — Low-Level Virtual Machine — a compiler framework that aims to make lifelong program analysis and transformation available for arbitrary software, and in a manner that is transparent to programmers. LLVM achieves this through two parts:
(a) code representation with several novel features that serves as a common representation for analysis, transformation, and code distribution;
领英推荐
(b) compiler design that exploits this representation to provide a combination of capabilities that is not available in any previous compilation approach we know of.
There are:
The?back end, which generates actual machine code. The backend of LLVM features a target-independent code generator that may create output for several types of target CPUs — including X86, PowerPC, ARM, and SPARC. The backend may also be used to generate code targeted at SPUs of the Cell processor or GPUs to support the execution of compute kernels.
In upcoming tutorial we will discuss about how to get start with the LLVM.