Sun . 19 Aug 2019
TR | RU | UK | KK | BE |


llvm, llvm compiler
The LLVM compiler infrastructure project formerly Low Level Virtual Machine is a "collection of modular and reusable compiler and toolchain technologies"3 used to develop compiler front ends and back ends

LLVM is written in C++ and is designed for compile-time, link-time, run-time, and "idle-time" optimization of programs written in arbitrary programming languages Originally implemented for C and C++, the language-agnostic design of LLVM has since spawned a wide variety of front ends: languages with compilers that use LLVM include ActionScript, Ada, C#,456 Common Lisp, Crystal, D, Delphi, Fortran, OpenGL Shading Language, Halide, Haskell, Java bytecode, Julia, Lua, Objective-C, Pony,7 Python, R, Ruby, Rust, CUDA, Scala,8 and Swift

The LLVM project started in 2000 at the University of Illinois at Urbana–Champaign, under the direction of Vikram Adve and Chris Lattner LLVM was originally developed as a research infrastructure to investigate dynamic compilation techniques for static and dynamic programming languages LLVM was released under the University of Illinois/NCSA Open Source License,2 a permissive free software licence In 2005, Apple Inc hired Lattner and formed a team to work on the LLVM system for various uses within Apple's development systems9 LLVM is an integral part of Apple's latest development tools for macOS and iOS10 Since 2013, Sony has been using LLVM's primary front end Clang compiler in the software development kit SDK of its PS4 console11

The name LLVM was originally an initialism for Low Level Virtual Machine, but this became increasingly less apt as LLVM became an "umbrella project" that included a variety of other compiler and low-level tool technologies, so the project abandoned the initialism12 Now, LLVM is a brand that applies to the LLVM umbrella project, the LLVM intermediate representation IR, the LLVM debugger, the LLVM C++ Standard Library with full support of C++11 and C++1413, etc LLVM is administered by the LLVM Foundation Its president is compiler engineer Tanya Lattner14

The Association for Computing Machinery presented Adve, Lattner, and Evan Cheng with the 2012 ACM Software System Award for LLVM15


  • 1 Overview and description
  • 2 Components
    • 21 Front ends: programming language support
      • 211 Standard library support
    • 22 LLVM intermediate representation
    • 23 Back ends: instruction set and microarchitecture support
      • 231 LLVM MC
    • 24 Integrated linker: lld
    • 25 Debugger
  • 3 Revision history31
  • 4 See also
  • 5 References
  • 6 External links

Overview and descriptionedit

LLVM can provide the middle layers of a complete compiler system, taking intermediate representation IR code from a compiler and emitting an optimized IR This new IR can then be converted and linked into machine-dependent assembly language code for a target platform LLVM can accept the IR from the GNU Compiler Collection GCC toolchain, allowing it to be used with a wide array of extant compilers written for that project

LLVM can also generate relocatable machine code at compile-time or link-time or even binary machine code at run-time

LLVM supports a language-independent instruction set and type system16 Each instruction is in static single assignment form SSA, meaning that each variable called a typed register is assigned once and then frozen This helps simplify the analysis of dependencies among variables LLVM allows code to be compiled statically, as it is under the traditional GCC system, or left for late-compiling from the IR to machine code via just-in-time compilation JIT, similar to Java The type system consists of basic types such as integer or floating point numbers and five derived types: pointers, arrays, vectors, structures, and functions A type construct in a concrete language can be represented by combining these basic types in LLVM For example, a class in C++ can be represented by a mix of structures, functions and arrays of function pointers

The LLVM JIT compiler can optimize unneeded static branches out of a program at runtime, and thus is useful for partial evaluation in cases where a program has many options, most of which can easily be determined unneeded in a specific environment This feature is used in the OpenGL pipeline of Mac OS X Leopard v105 to provide support for missing hardware features17 Graphics code within the OpenGL stack was left in intermediate representation, and then compiled when run on the target machine On systems with high-end graphics processing units GPUs, the resulting code was quite thin, passing the instructions onto the GPU with minimal changes On systems with low-end GPUs, LLVM would compile optional procedures that run on the local central processing unit CPU that emulate instructions that the GPU cannot run internally LLVM improved performance on low-end machines using Intel GMA chipsets A similar system was developed under the Gallium3D LLVMpipe, and incorporated into the GNOME shell to allow it to run without a proper 3D hardware driver loaded18

For run-time performance of the compiled programs, GCC formerly outperformed LLVM by 10% on average1920 Newer results indicate that LLVM has now caught up with GCC in this area, and is now compiling binaries of approximately equal performance21


LLVM has become an umbrella project containing multiple components

Front ends: programming language supportedit

LLVM was originally written to be a replacement for the existing code generator in the GCC stack,22 and many of the GCC front ends have been modified to work with it LLVM currently supports compiling of Ada, C, C++, D, Delphi, Fortran, Haskell, Objective-C and Swift using various front ends, some derived from version 401 and 42 of the GNU Compiler Collection GCC

Widespread interest in LLVM has led to several efforts to develop new front ends for a variety of languages The one that has received the most attention is Clang, a new compiler supporting C, C++, and Objective-C Primarily supported by Apple, Clang is aimed at replacing the C/Objective-C compiler in the GCC system with a system that is more easily integrated with integrated development environments IDEs and has wider support for multithreading Support for OpenMP directives has been included in Clang since release 3823 Objective-C development under GCC was stagnant and Apple's changes to the language were supported in a separately maintained branchcitation needed

The Utrecht Haskell compiler can generate code for LLVM Though the generator is in the early stages of development, in many cases it has been more efficient than the C code generator24 The Glasgow Haskell Compiler GHC has a working LLVM backend that achieves a 30% speed-up of the compiled code relative to native code compiling via GHC or C code generation followed by compiling, missing only one of the many optimizing techniques implemented by the GHC25

Many other components are in various stages of development, including, but not limited to, the Rust compiler, a Java bytecode front end, a Common Intermediate Language CIL front end, the MacRuby implementation of Ruby 19, various front ends for Standard ML, and a new graph coloring register allocatorcitation needed

Standard library supportedit

LLVM supports its own standard library,citation needed but also an alternative C standard library, musl and as of 39 with initial support for ARM26

LLVM intermediate representationedit

LLVM IR is used eg, by radeonsi and by llvmpipe Both are part of Mesa 3D

The core of LLVM is the intermediate representation IR, a low-level programming language similar to assembly IR is a strongly typed reduced instruction set computing RISC instruction set which abstracts away details of the target For example, the calling convention is abstracted through call and ret instructions with explicit arguments Also, instead of a fixed set of registers, IR uses an infinite set of temporaries of the form %0, %1, etc LLVM supports three isomorphic forms of IR: a human-readable assembly format, a C++ object format suitable for frontends, and a dense bitcode format for serializing A simple "Hello, world!" program in the assembly format:

@str = internal constant 14 x i8 c"hello, world\0A\00" declare i32 @printfi8, define i32 @maini32 %argc, i8 %argv nounwind


Back ends: instruction set and microarchitecture supportedit

At version 34, LLVM supports many instruction sets, including ARM, Qualcomm Hexagon, MIPS, Nvidia Parallel Thread Execution PTX; called NVPTX in LLVM documentation, PowerPC, AMD TeraScale,28 AMD Graphics Core Next GCN, SPARC, z/Architecture called SystemZ in LLVM documentation, x86/x86-64, and XCore Some features are not available on some platforms Most features are present for x86/x86-64, z/Architecture, ARM, and PowerPC29


The LLVM machine code MC subproject is LLVM's framework for translating machine instructions between textual forms and machine code Formerly, LLVM relied on the system assembler, or one provided by a toolchain, to translate assembly into machine code LLVM MC's integrated assembler supports most LLVM targets, including x86, x86-64, ARM, and ARM64 For some targets, including the various MIPS instruction sets, integrated assembly support is usable but still in the beta stage

Integrated linker: lldedit

The lld subproject is an attempt to develop a built-in, platform independent linker for LLVM30 Currently, Clang and LLVM must invoke the system or target linker to produce an executable This prevents Clang from using linker features not present on all supported versions of the linker for a platform30 lld aims to remove dependence on a third party linker


Main article: LLDB debugger

Revision history31edit

Revision history
Version Release date
391 23 December 2016
390 2 September 2016
381 11 July 2016
380 8 March 2016
371 5 January 2016
370 1 September 2015
362 16 Jul 2015
361 26 May 2015
360 27 February 2015
352 2 April 2015
351 20 January 2015
350 3 September 2014
342 19 June 2014
341 7 May 2014
340 2 January 2014
33 17 June 2013
32 20 December 2012
31 22 May 2012
30 1 December 2011
29 6 April 2011
28 5 October 2010
27 27 April 2010
26 23 October 2009
25 2 March 2009
24 9 November 2008
23 9 June 2008
22 11 February 2008
21 26 September 2007
20 23 May 2007
19 19 November 2006
18 9 August 2006
17 20 April 2006
16 8 November 2005
15 18 May 2005
14 9 December 2004
13 13 August 2004
12 19 March 2004
11 17 December 2003
10 24 October 2003

See alsoedit

  • Free software portal
  • C--
  • Amsterdam Compiler Kit ACK
  • LLDB debugger
  • GNU lightning
  • GNU Compiler Collection GCC
  • Pure programming language
  • OpenCL
  • Emscripten
  • TenDRA Distribution Format
  • Architecture Neutral Distribution Format ANDF
  • Comparison of application virtual machines
  • SPIR-V
  • University of Illinois at Urbana Champaign discoveries & innovations


  1. ^ Wennborg, Hans 2 September 2016 "LLVM 39 Release" llvm-announce Mailing list Retrieved 3 September 2016 
  2. ^ a b "License", LLVM: Frequently Asked Questions, llvmorg, retrieved 27 January 2012 
  3. ^ "The LLVM Compiler Infrastructure Project" Retrieved 2016-03-11 
  4. ^ Announcing LLILC - A new LLVM-based Compiler for NET, retrieved 17 April 2015 
  5. ^ Mono LLVM, retrieved 10 March 2013 
  6. ^ LLVM, Chris Lattner, in The architecture of Open Source Applications, edited by Amy Brown, Greg Wilson, 2011
  7. ^ "The LLVM Compiler Infrastructure Project" llvmorg Retrieved 2016-05-25 
  8. ^ Reedy, Geoff 24 September 2012 "Compiling Scala to LLVM" St Louis, Missouri, United States Retrieved 19 February 2013 
  9. ^ Adam Treat 19 February 2005, mkspecs and patches for LLVM compile of Qt4, retrieved 27 January 2012 
  10. ^ "Apple LLVM Compiler", Developer Tools, Apple, retrieved 27 January 2012 
  11. ^ Developer Toolchain for ps4 PDF, retrieved 24 February 2015 
  12. ^ Lattner, Chris 21 December 2011 "The name of LLVM" llvm-dev Mailing list Retrieved 2 March 2016 
  13. ^ ""libc++" C++ Standard Library" 
  14. ^ Chris Lattner 3 April 2014 "The LLVM Foundation" LLVM Project Blog 
  15. ^ "ACM Awards" ACM 
  16. ^ "LLVM Language Reference Manual" Retrieved 16 April 2012 
  17. ^ Chris Lattner 15 August 2006 "A cool use of LLVM at Apple: the OpenGL stack" llvm-dev Mailing list Retrieved 1 March 2016 
  18. ^ Michael Larabel, "GNOME Shell Works Without GPU Driver Support", phoronix, 6 November 2011
  19. ^ V Makarov "SPEC2000: Comparison of LLVM-29 and GCC461 on x86" Retrieved 3 October 2011 
  20. ^ V Makarov "SPEC2000: Comparison of LLVM-29 and GCC461 on x86_64" Retrieved 3 October 2011 
  21. ^ Michael Larabel 27 December 2012 "LLVM/Clang 32 Compiler Competing With GCC" Retrieved 31 March 2013 
  22. ^ Lattner, Chris; Vikram Adve May 2003 Architecture For a Next-Generation GCC First Annual GCC Developers' Summit Retrieved 6 September 2009 
  23. ^ "Clang 38 Release Notes" Retrieved 24 August 2016 
  24. ^ "Compiling Haskell To LLVM" Retrieved 22 February 2009 
  25. ^ "LLVM Project Blog: The Glasgow Haskell Compiler and LLVM" Retrieved 13 August 2010 
  26. ^ http://llvmorg/releases/390/docs/ReleaseNoteshtml
  27. ^ For the full documentation, refer to llvmorg/docs/LangRefhtml
  28. ^ Stellard, Tom 26 March 2012 "LLVMdev RFC: R600, a new backend for AMD GPUs" llvm-dev Mailing list 
  29. ^ Target-specific Implementation Notes: Target Feature Matrix // The LLVM Target-Independent Code Generator, LLVM site
  30. ^ a b "lld - The LLVM Linker" The LLVM Project Retrieved 8 September 2014 
  31. ^ http://llvmorg/releases/

External linksedit

  • Official website
  • LLVM Project Blog
  • LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation, a published paper by Chris Lattner, Vikram Adve
  • LLVM Language Reference Manual, describes the LLVM intermediate representation
  • LLVM - 20 and beyond! on YouTube
  • Discussion of LLVM by John Siracusa at Ars Technica
  • LLVMLinux Wiki
  • The Design of LLVM by Chris Lattner, Dr Dobb's Journal, May 2012

llvm, llvm clang, llvm compiler, llvm fortran, llvm git, llvm ir, llvm tutorial, llvm vs gcc, llvm windows,

LLVM Information about


  • user icon

    LLVM beatiful post thanks!


LLVM viewing the topic.
LLVM what, LLVM who, LLVM explanation

There are excerpts from wikipedia on this article and video

Random Posts

The San Francisco Examiner

The San Francisco Examiner

The San Francisco Examiner is a longtime daily newspaper distributed in and around San Francisco, Ca...
Frederator Films

Frederator Films

Frederator Films is an animation studio founded by Fred Seibert as part of Frederator Studios, with ...
John Hasbrouck Van Vleck

John Hasbrouck Van Vleck

John Hasbrouck Van Vleck March 13, 1899 – October 27, 1980 was an American physicist and mathematici...
Christian Lacroix

Christian Lacroix

Christian Marie Marc Lacroix French pronunciation: ​kʁistjɑ̃ lakʁwa; born 16 May 1951 is a Fren...

Random Posts (



Wargame (from the English. "Wargame" - Russian. "War game") - a kind of strategi
Umudova, Nargiz Mamedaga Kyzy

Umudova, Nargiz Mamedaga Kyzy

Nargiz Umudova Azerb Nåğárgiz Umudova; born June 20, 1989, Baku, USSR - Azerbaijan chess player, gra
Nikolskoe (Gorshechensky district)

Nikolskoe (Gorshechensky district)

Nikolskoye - a village in the Gorshechensky district of the Kursk region of Russia The administrativ
Apartment zero

Apartment zero

Thriller Drama Director Martin Donovan Producer Martin Donovan David Kepp Screenwriter Marti