SlideShare a Scribd company logo
1 of 29
The LLVM Compiler System
     LLVM: Low Level Virtual Machine




               Chris Lattner
           clattner@apple.com

     OSCON - Open Source Convention
              July 27, 2007
LLVM Talk Overview
  The LLVM Approach to Compilers
•
• The LLVM C/C++/ObjC Compiler
• OpenGL in Mac OS X 10.5, Powered by LLVM
• Using LLVM with Scripting Languages




                                             http://llvm.org/
Open Source Compiler Technology
    “Scripting” Language Interpreters: Python, Ruby, Perl, Javascript, etc
•
        Traditionally interpreted at runtime, used by highly dynamic languages
    –


    Java and .NET Virtual Machines
•
        Run time compilation for any language that can target the JVM
    –


    GCC: C/C++/ObjC/Ada/FORTRAN/Java Compiler
•
        Static optimization and code generation at build time
    –




                                                                                 http://llvm.org/
OSS Compiler Technology Strengths 1/2
    Scripting/Dynamic Language Strengths:
•
      Interpreters are extremely portable and small (code size)
    –
    – Many interesting advanced compilation models (pypy, Parrot, jrubyc, etc)
    – Dynamic languages are very expressive and powerful




    Java Virtual Machine Strengths:
•
      JVM bytecode is portable, JVMs available for many systems
    –
    – Many languages can be compiled to JVM
    – Provides runtime/JIT optimization, high level optimizations




                                                                            http://llvm.org/
OSS Compiler Technology Strengths 2/2
    GCC Strengths:
•
      Support for important languages like C/C++
    –
      – Other projects can emit C/C++ code and compile with GCC
    – Good code generation/optimization
    – Supports many different CPUs




    Common strengths:
•
      Each has a large and vibrant community!
    –
    – We support tons of existing code written in many languages!




               With so many strengths, what could be wrong?
                                                                    http://llvm.org/
OSS Compiler Technology Weaknesses 1/2
    Common Problem:
•
        The tools only work together at a very coarse grain
    –



            Ruby            Python

             Ruby       Python
                                     PyPy          C, C++,
            Interp      Interp                                Java         ...
                                                   Ada, ...
                                        C code



                                                 GCC                 JVM


   Each arrow/box is a completely separate project from the others
–
  – Very little sharing (e.g.) between ruby and python interpreter
– Advanced optimizer projects don’t share code (e.g. jrubyc vs shedskin)

                                                                                 http://llvm.org/
OSS Compiler Technology Weaknesses 2/2
    Scripting Language Weaknesses:
•
        Efficient execution: poor “low level” performance, memory use
    –


    Java Virtual Machine Weaknesses:
•
      Must use all of JVM or none of it: GC, JIT, class library, etc
    –
    – Forced to mold your language into the Java object model
    – Huge memory footprint and startup time


    GCC Weaknesses:
•
      Old code-base and architecture: Very steep learning curve
    –
    – Doesn’t support modern compiler techniques (JIT, cross file optimization)
    – Slow compile times




          Each approach has mostly disjoint strengths and weaknesses!       http://llvm.org/
LLVM Vision and Approach
    Primary mission: build a set of modular compiler components that:
•
        ... implement aggressive and modern techniques
    –
        ... integrate well with each other
    –
        ... have few dependencies on each other
    –
        ... are language- and target-independent where possible
    –
        ... integrate closely with existing tools where possible
    –


    Secondary mission: Build compilers that use these components
•




                                                             LTO ...
                X86      PPC      CBE              GCC
                                          clang

                            Code
                                                                   IPO ...
                                        JIT
          DWARF Target                        Optzn linker
                            gen

                                                                             ...
     BC IO LL IO System Core                                           GC
                                         Support xforms analysis
                                                                               http://llvm.org/
Value of a library-based approach
    Reduces the time & cost to construct a particular compiler
•
        A new compiler = glue code plus any components not yet available
    •

    Components are shared across different compilers
•
        Improvements made for one compiler benefits the others
    •

    Allows choice of the right component for the job
•
        Don’t force “one true register allocator” scheduler, or optimization order
                                                ,
    •


    Examples:
•
    – First MacOS OpenGL JIT built in two weeks:
      – Required building “OpenGL to LLVM” converter
      – Replaced existing JIT, much better optimizations and performance
    – Initial bringup of llvm-gcc4 took 2-3 months (GCC is very complex!)
      – Required building “GCC tree to LLVM” converter
      – Including support for many targets, aggressive optimizations, etc

                                  Key LLVM Feature:
                              IR is small, simple, easy to
                                                                                     http://llvm.org/
                            understand, and is well defined
Example Client: llvm-gcc4
        C/C++/ObjC/...
Standard GCC 4.x Design
    Standard compiler organization: front-end, optimizer, codegen
•
      Parser and front-ends work with language-specific “trees”
    –
    – Optimizers use trees in “GIMPLE” form, modern SSA techniques, etc.
    – RTL code generator use antiquated compiler algorithms/data structures


    C
             Language              tree-ssa               Code
    C++                                                                 .s file
             Front-end            Optimizer             Generator
    ObjC
     ...
                                   GIMPLE                  RTL
             AST “tree”

  Pros: Excellent front-ends, support for many processors, defacto standard
–
– Cons: Very slow, memory hungry, hard to retarget, no JIT, no LTO, no
  aggressive optimizations, ...




                                                                              http://llvm.org/
llvm-gcc4 Design
    Use GCC front-end with LLVM optimizer and code generator
•
      Reuses parser, runtime libraries, and some GIMPLE lowering
    –
    – Requires a new GCC “tree to llvm” converter




    C
             Language                LLVM                 LLVM Code
                          LLVM IR               LLVM IR
    C++                                                                .s file
             Front-end              Optimizer             Generator
    ObjC
     ...
                                    LLVM IR               LLVM CG IR
             AST “tree”




                                                                             http://llvm.org/
LLVM optimizer features used by llvm-gcc
    Aggressive and fast optimizer built on modern techniques
•
      SSA-based optimizer for light-weight (fast) and aggressive xforms
    –
    – Aggressive loop optimizations: unrolling, unswitching, mem promotion, ...
    – Many InterProcedural (cross function) optimizations: inlining, dead arg
      elimination, global variable optimization, IP constant prop, EH optzn, ...
    C
             Language                  LLVM                    LLVM Code
                           LLVM IR                   LLVM IR
    C++                                                                    .s file
             Front-end                Optimizer                Generator
    ObjC
     ...


                             Standard Scalar
                              Optimizations

                                         Loop
                                     Optimizations

                                        Interprocedural
                                         Optimizations


                                                                                 http://llvm.org/
Other LLVM features used by llvm-gcc
    LLVM Code Generator
•
        Modern retargetable code generator, easier to retarget than GCC
    –

    Write LLVM IR to disk for codegen after compile time:
•
        link-time, install-time, run-time
    –


    C
                Language                 LLVM                   LLVM Code
                              LLVM IR               LLVM IR
    C++                                                                            .s file
                Front-end               Optimizer               Generator
    ObjC
     ...

                                                                    JIT
                                                LLVM IR




                                                    DISK                  LTO

                                                                              Code           exe
                                                                 Ship
                                                                              Gen            file

                                                              Install Time Code Generation
                                                                                         http://llvm.org/
Link-Time Optimization (LTO)
       Link-time is a natural place for interprocedural optimizations
   •
         Cross-module optimization is natural and trivial (no makefile changes)
       –
       – LLVM is safe with partial programs (dynamically loaded code, libraries, etc)
       – LTO has been available since LLVM 1.0!




   Any                LLVM
              LLVM
Front-end            Optimizer

                                                 LLVM              LLVM              Code
   Any                LLVM
              LLVM                                        LLVM                LLVM
                                                                                                   ...
                                                 Linker           Optimizer          Gen
Front-end            Optimizer
                                      IR in .o                   Link Time
   Any                LLVM
              LLVM
                                        files
Front-end            Optimizer

   Compile Time
                                                                                     http://llvm.org/
Example Client: OpenGL JIT
     OpenGL Vertex/Pixel Shaders
OpenGL Pixel/Vertex Shaders
    Small program, provided at run-time, to be run on each vertex/pixel:
•
      Written in one of a few high-level graphics languages (e.g. GLSL)
    –
    – Executed millions of times, extremely performance sensitive

    Ideally, these are executed on the graphics card:
•
        What if hardware doesn’t support some feature? (e.g. laptop gfx)
    –
        – Interpret or JIT on main CPU

                   void main() {
                     vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Vertex);
                     vec3 tnorm      = normalize(gl_NormalMatrix * gl_Normal);
                     vec3 lightVec   = normalize(LightPosition - ecPosition);
                     vec3 reflectVec = reflect(-lightVec, tnorm);
                     vec3 viewVec    = normalize(-ecPosition);
                     float diffuse   = max(dot(lightVec, tnorm), 0.0);
                     float spec      = 0.0;
                     if (diffuse > 0.0) {
                         spec = max(dot(reflectVec, viewVec), 0.0);
                         spec = pow(spec, 16.0);
                     }
                     LightIntensity = DiffuseContribution * diffuse +
                                      SpecularContribution * spec;
                     MCposition     = gl_Vertex.xy;
                     gl_Position    = ftransform();
                   }

                                                                                 http://llvm.org/
                                      GLSL Vertex Shader
MacOS OpenGL Before LLVM
    Custom JIT for X86-32 and PPC-32:
•
    – Very simple codegen: Glued chunks of Altivec or SSE code
    – Little optimization across operations (e.g. scheduling)
    – Very fragile, hard to understand and change (hex opcodes)


    OpenGL Interpreter:
•
    – JIT didn’t support all OpenGL features: fallback to interpreter
    – Interpreter was very slow, 100x or worse than JIT



                                 GFX Card
              OpenGL
    GLSL
                                 Custom JIT
               Parser
    Text

                                 Interpreter
                        OpenGL
                          AST
                                                                   http://llvm.org/
OpenGL JIT built with LLVM Components




                                 OpenGL to              LLVM                  LLVM
              OpenGL
GLSL
               Parser
Text
                                   LLVM                Optimizer               JIT
                                             LLVM IR                LLVM IR
                        OpenGL
                          AST




       At runtime, build LLVM IR for program, optimize, JIT:
   •
         Result supports any target LLVM supports (+ PPC64, X86-64 in MacOS 10.5)
       –
       – Generated code is as good as an optimizing static compiler

     Other LLVM improvements to optimizer/codegen improves OpenGL
   •
   • Key question: How does the “OpenGL to LLVM” stage work?    http://llvm.org/
Structure of an Interpreter
    Simple opcode-based dispatch loop:
•

      while (...) {
        ...
       switch (cur_opcode) {
       case dotproduct: result = opengl_dot(lhs, rhs); break;
       case texturelookup: result = opengl_texlookup(lhs, rhs); break;
       case ...

    One function per operation, written in C:
•
      double opengl_dot(vec3 LHS, vec3 RHS) {
        #ifdef ALTIVEC
          ... altivec intrinsics ...
        #elif SSE
                                       Key Advantage of an Interpreter:
          ... sse intrinsics ...
                                        Easy to understand and debug,
        #else
                                       easy to write each operation (each
          ... generic c code ...
                                            operation is just C code)
         #endif
      }
    In a high-level language like GLSL, each op can be hundreds of LOC
•
                                                                            http://llvm.org/
OpenGL to LLVM Implementation
                                    Bytecode          Bytecode
           C Code
 Opcode
                                               DISK
                       llvm-gcc                              Ship
Functions

                            OpenGL Build Time



                                           OpenGL to                        LLVM                 LLVM
                        OpenGL
    GLSL
                         Parser              LLVM                          Optimizer              JIT
                                                                 LLVM IR               LLVM IR
                                  OpenGL
                                    AST




               At OpenGL build time, compile each opcode to LLVM bytecode:
           •
                   Same code used by the interpreter: easy to understand/change/optimize
               –



                                                                                                  http://llvm.org/
OpenGL to LLVM: At runtime
   1.Translate OpenGL AST into LLVM call instructions: one per operation
   2.Use the LLVM inliner to inline opcodes from precompiled bytecode
   3.Optimize/codegen as before




                                    OpenGL to                        LLVM                      LLVM
                OpenGL
GLSL
                 Parser               LLVM                          Optimizer                   JIT
                                                        LLVM IR                      LLVM IR
                          OpenGL
                            AST
                                              OpenGL
                                              to LLVM
...                                                      ...
vec3 viewVec = normalize(-ecPosition);                  %tmp1 = call opengl_negate(ecPosition)
float diffuse = max(dot(lightVec, tnorm), 0.0);         %viewVec = call opengl_normalize(%tmp1);
 ...                                                    %tmp2 = call opengl_dot(%lightVec, %tnorm)
                                                        %diffuse = call opengl_max(%tmp2, 0.0);
                                                         ...

                                                                  LLVM Inliner
                                          Optimize,
                                                       ...
                                          Codegen
                                                      %tmp1 = sub <4 x float> <0,0,0,0>, %ecPosition
                                                      %tmp3 = shuffle <4 x float> %tmp1, ...;
               PPC              X86                   %tmp4 = mul <4 x float> %tmp3, %tmp3
                                                       ...
                                                                                                http://llvm.org/
Benefits of this approach
    Key features:
•
      Each opcode is written/debugged for a simple interpreter, in standard C
    –
      – Retains all advantages of an interpreter: debugability, understandability, etc
      – Easy to make algorithmic changes to opcodes
    – OpenGL runtime is independent of opcode implementation


    Primary contributions to Mac OS:
•
      Support for PPC64/X86-64
    –
    – Much better performance: optimizations, regalloc, scheduling, etc
      – No fallback to interpreter needed!
    – OpenGL group doesn’t maintain their own JIT!




                                                                                  http://llvm.org/
Example Client:
  a Scripting Language
Loosely based on “pypy” Python Compiler
LLVM and Dynamic Languages
    Dynamic languages are very different than C:
•
      Extremely polymorphic, reflective, dynamically extensible
    –
    – Standard compiler optzns don’t help much if “+” is a dynamic method call


    Observation: in many important cases, dynamism is eliminable
•
        Solution: Use dataflow and static analysis to infer types:
    –

                     ‘i’ starts as an integer
                                   ++ on integer returns integer
                var i;
                for (i = 0; i < 10; ++i)
                  ... A[i] ...
                            i isn’t modified anywhere else

  We proved “i” is always an integer: change its type to integer instead of object
–
– Operations on “i” are now not dynamic
  – Faster, can be optimized by LLVM (e.g. loop unrolling)
                                                                             http://llvm.org/
Advantages and Limitations of Static Analysis
    Works on unmodified programs in scripting languages:
•
        No need for user annotations, no need for sub-languages
    –


    Many approaches for doing the analysis (with cost/benefit tradeoffs)
•


    Most of the analyses could work with many scripting languages:
•
        Parameterize the model with info about the language operations
    –


    Limitation: cannot find all types in general!
•
        That’s ok though, the more we can prove, the faster it goes
    –




                                                                         http://llvm.org/
Scripting Language Performance
    Ahead-of-Time Compilation provides:
•
      Reduced memory footprint (no ASTs in memory)
    –
    – Eliminate (if no ‘eval’) or reduce use of interpreter at runtime (save code size)
    – Much better performance if type inference is successful

    JIT compilation provides:
•
      Full support for optimizing eval’d code (e.g. json objects in javascript)
    –
    – Runtime “type profiling” for speculative optimizations



    LLVM provides:
•
  Both of the above, with one language -> llvm translator
–
– Install-time codegen
– Continuously improving set of optimizations and targets
– Ability to inline & optimize code from different languages
  – inline your runtime library into the client code?



                                                                                  http://llvm.org/
Call for help!
          OSS community needs to unite work on various scripting languages
        –
          – Common module to represent/type infer an arbitrary dynamic language
        – Who will provide this? parrot? pypy? llvm itself someday?


Ruby Python Perl Javascript ...                    C
                                   C, C++,Ada               GLSL, ARB VP, ...

  Common Dynamic Language
                                                                            What Next?
                                                clang CFE
                                    llvm-gcc                    OpenGL
 Representation + Type Inference




                                          LLVM

                 LTO JIT Install Time Cross Lang Debugger
                          Codegen       Optzn     Support
                    IPO                                                         http://llvm.org/
LLVM Summary
           LLVM is a set of modular compiler components:
       •
             Spend your time working on interesting the higher level pieces!
           –
           – LLVM can be used to make great compilers!


           LLVM components are language- and target-independent:
       •
             Does not force use of JIT, GC, or a particular object model
           –
           – Code from different languages can be linked together and optimized


           LLVM provides aggressive functionality and is industrial strength:
       •
             Interprocedural optimization, link-time, install-time optimization today!
           –
           – LLVM has compiled and optimized millions of lines of code




           Other: Check out the New LLVM C Frontend: http://clang.llvm.org/
       •



                                      http://llvm.org/
clattner@apple.com                                                                       http://llvm.org/

More Related Content

What's hot

Debugging of (C)Python applications
Debugging of (C)Python applicationsDebugging of (C)Python applications
Debugging of (C)Python applicationsRoman Podoliaka
 
10 Reasons Why Java Now Rocks More Than Ever
10 Reasons Why Java Now Rocks More Than Ever10 Reasons Why Java Now Rocks More Than Ever
10 Reasons Why Java Now Rocks More Than EverGeert Bevin
 
Dalvik Vm &amp; Jit
Dalvik Vm &amp; JitDalvik Vm &amp; Jit
Dalvik Vm &amp; JitAnkit Somani
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systemssosorry
 
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...corehard_by
 
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...Mark West
 
Os Paesdosreistutorial
Os PaesdosreistutorialOs Paesdosreistutorial
Os Paesdosreistutorialoscon2007
 
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019corehard_by
 
Introduction to Android by Demian Neidetcher
Introduction to Android by Demian NeidetcherIntroduction to Android by Demian Neidetcher
Introduction to Android by Demian NeidetcherMatthew McCullough
 
Polyglot Applications with GraalVM
Polyglot Applications with GraalVMPolyglot Applications with GraalVM
Polyglot Applications with GraalVMjexp
 
Java compilation
Java compilationJava compilation
Java compilationMike Kucera
 
Understanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profitUnderstanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profitPascal Rapicault
 
Entwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscriptEntwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscriptBill Buchan
 
Inside Android's Dalvik VM - NEJUG Nov 2011
Inside Android's Dalvik VM - NEJUG Nov 2011Inside Android's Dalvik VM - NEJUG Nov 2011
Inside Android's Dalvik VM - NEJUG Nov 2011Doug Hawkins
 
Porting C++ apps to FLASCC
Porting C++ apps to FLASCCPorting C++ apps to FLASCC
Porting C++ apps to FLASCCPavel Nakaznenko
 
Intoduction to java
Intoduction to javaIntoduction to java
Intoduction to javajalinder123
 

What's hot (19)

Debugging of (C)Python applications
Debugging of (C)Python applicationsDebugging of (C)Python applications
Debugging of (C)Python applications
 
10 Reasons Why Java Now Rocks More Than Ever
10 Reasons Why Java Now Rocks More Than Ever10 Reasons Why Java Now Rocks More Than Ever
10 Reasons Why Java Now Rocks More Than Ever
 
Dalvik Vm &amp; Jit
Dalvik Vm &amp; JitDalvik Vm &amp; Jit
Dalvik Vm &amp; Jit
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
 
Android NDK
Android NDKAndroid NDK
Android NDK
 
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
 
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
 
Os Paesdosreistutorial
Os PaesdosreistutorialOs Paesdosreistutorial
Os Paesdosreistutorial
 
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
 
Introduction to Android by Demian Neidetcher
Introduction to Android by Demian NeidetcherIntroduction to Android by Demian Neidetcher
Introduction to Android by Demian Neidetcher
 
Os Ramani
Os RamaniOs Ramani
Os Ramani
 
Polyglot Applications with GraalVM
Polyglot Applications with GraalVMPolyglot Applications with GraalVM
Polyglot Applications with GraalVM
 
Java compilation
Java compilationJava compilation
Java compilation
 
Understanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profitUnderstanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profit
 
Entwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscriptEntwicker camp2007 calling-the-c-api-from-lotusscript
Entwicker camp2007 calling-the-c-api-from-lotusscript
 
Inside Android's Dalvik VM - NEJUG Nov 2011
Inside Android's Dalvik VM - NEJUG Nov 2011Inside Android's Dalvik VM - NEJUG Nov 2011
Inside Android's Dalvik VM - NEJUG Nov 2011
 
Porting C++ apps to FLASCC
Porting C++ apps to FLASCCPorting C++ apps to FLASCC
Porting C++ apps to FLASCC
 
Intoduction to java
Intoduction to javaIntoduction to java
Intoduction to java
 
.NET Vs J2EE
.NET Vs J2EE.NET Vs J2EE
.NET Vs J2EE
 

Viewers also liked

Inversion socialmente responsable.
Inversion socialmente responsable.Inversion socialmente responsable.
Inversion socialmente responsable.José María
 
Intelligent commodity tips for smart traders
Intelligent commodity tips for smart tradersIntelligent commodity tips for smart traders
Intelligent commodity tips for smart tradersRiya jain
 
SAFER Recruitment and Retention In Brief
SAFER Recruitment and Retention In BriefSAFER Recruitment and Retention In Brief
SAFER Recruitment and Retention In BriefPraetorian Digital
 
Tics en power
Tics en powerTics en power
Tics en powerjespu
 
R Manasa_Software_Tester_Exp_3 years
R Manasa_Software_Tester_Exp_3 yearsR Manasa_Software_Tester_Exp_3 years
R Manasa_Software_Tester_Exp_3 yearsReddyvari Manasa
 
Equipment show of SysPCB
Equipment show of SysPCBEquipment show of SysPCB
Equipment show of SysPCBNicole Luo
 
Os Madsen Block
Os Madsen BlockOs Madsen Block
Os Madsen Blockoscon2007
 
наказ весняні канікули 2015 2016_ущільнення
наказ весняні канікули 2015 2016_ущільненнянаказ весняні канікули 2015 2016_ущільнення
наказ весняні канікули 2015 2016_ущільненняshevchenkoskool
 
La ciutat de Barcelona
La ciutat de BarcelonaLa ciutat de Barcelona
La ciutat de BarcelonaCarlaOrdonez5
 

Viewers also liked (13)

Inversion socialmente responsable.
Inversion socialmente responsable.Inversion socialmente responsable.
Inversion socialmente responsable.
 
Intelligent commodity tips for smart traders
Intelligent commodity tips for smart tradersIntelligent commodity tips for smart traders
Intelligent commodity tips for smart traders
 
SAFER Recruitment and Retention In Brief
SAFER Recruitment and Retention In BriefSAFER Recruitment and Retention In Brief
SAFER Recruitment and Retention In Brief
 
Tics en power
Tics en powerTics en power
Tics en power
 
R Manasa_Software_Tester_Exp_3 years
R Manasa_Software_Tester_Exp_3 yearsR Manasa_Software_Tester_Exp_3 years
R Manasa_Software_Tester_Exp_3 years
 
Equipment show of SysPCB
Equipment show of SysPCBEquipment show of SysPCB
Equipment show of SysPCB
 
Why humans are complex organisms
Why humans are complex organismsWhy humans are complex organisms
Why humans are complex organisms
 
симпозіум арнольд рерінг львів 2016
симпозіум арнольд рерінг львів 2016симпозіум арнольд рерінг львів 2016
симпозіум арнольд рерінг львів 2016
 
final interviwe skill
final interviwe skillfinal interviwe skill
final interviwe skill
 
Os Madsen Block
Os Madsen BlockOs Madsen Block
Os Madsen Block
 
Accessibility First
Accessibility FirstAccessibility First
Accessibility First
 
наказ весняні канікули 2015 2016_ущільнення
наказ весняні канікули 2015 2016_ущільненнянаказ весняні канікули 2015 2016_ущільнення
наказ весняні канікули 2015 2016_ущільнення
 
La ciutat de Barcelona
La ciutat de BarcelonaLa ciutat de Barcelona
La ciutat de Barcelona
 

Similar to Os Lattner

차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVMJung Kim
 
.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3aminmesbahi
 
C++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browserC++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browserAndre Weissflog
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5David Voyles
 
Haskell Symposium 2010: An LLVM backend for GHC
Haskell Symposium 2010: An LLVM backend for GHCHaskell Symposium 2010: An LLVM backend for GHC
Haskell Symposium 2010: An LLVM backend for GHCdterei
 
Introduction to the LLVM Compiler System
Introduction to the LLVM  Compiler SystemIntroduction to the LLVM  Compiler System
Introduction to the LLVM Compiler Systemzionsaint
 
Better Kafka Performance Without Changing Any Code | Simon Ritter, Azul
Better Kafka Performance Without Changing Any Code | Simon Ritter, AzulBetter Kafka Performance Without Changing Any Code | Simon Ritter, Azul
Better Kafka Performance Without Changing Any Code | Simon Ritter, AzulHostedbyConfluent
 
Better Kafka Performance Without Changing Any Code | Simon Ritter, Azul
Better Kafka Performance Without Changing Any Code | Simon Ritter, AzulBetter Kafka Performance Without Changing Any Code | Simon Ritter, Azul
Better Kafka Performance Without Changing Any Code | Simon Ritter, AzulHostedbyConfluent
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpretersRAJU KATHI
 
mRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System DevelopmentmRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System DevelopmentKazuhiro Koga 古賀一博
 
Open arkcompiler
Open arkcompilerOpen arkcompiler
Open arkcompileryiwei yang
 
Introduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutionsIntroduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutionsQuontra Solutions
 
Apache Big Data Europe 2016
Apache Big Data Europe 2016Apache Big Data Europe 2016
Apache Big Data Europe 2016Tim Ellison
 
Persistent Memory Programming with Pmemkv
Persistent Memory Programming with PmemkvPersistent Memory Programming with Pmemkv
Persistent Memory Programming with PmemkvIntel® Software
 
FOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VMFOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VMCharlie Gracie
 
Ml also helps generic compiler ?
Ml also helps generic compiler ?Ml also helps generic compiler ?
Ml also helps generic compiler ?Ryo Takahashi
 
Exploring the Programming Models for the LUMI Supercomputer
Exploring the Programming Models for the LUMI Supercomputer Exploring the Programming Models for the LUMI Supercomputer
Exploring the Programming Models for the LUMI Supercomputer George Markomanolis
 
High-Performance Computing with C++
High-Performance Computing with C++High-Performance Computing with C++
High-Performance Computing with C++JetBrains
 

Similar to Os Lattner (20)

차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
 
.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3
 
C++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browserC++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browser
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
 
Haskell Symposium 2010: An LLVM backend for GHC
Haskell Symposium 2010: An LLVM backend for GHCHaskell Symposium 2010: An LLVM backend for GHC
Haskell Symposium 2010: An LLVM backend for GHC
 
Introduction to the LLVM Compiler System
Introduction to the LLVM  Compiler SystemIntroduction to the LLVM  Compiler System
Introduction to the LLVM Compiler System
 
Better Kafka Performance Without Changing Any Code | Simon Ritter, Azul
Better Kafka Performance Without Changing Any Code | Simon Ritter, AzulBetter Kafka Performance Without Changing Any Code | Simon Ritter, Azul
Better Kafka Performance Without Changing Any Code | Simon Ritter, Azul
 
Better Kafka Performance Without Changing Any Code | Simon Ritter, Azul
Better Kafka Performance Without Changing Any Code | Simon Ritter, AzulBetter Kafka Performance Without Changing Any Code | Simon Ritter, Azul
Better Kafka Performance Without Changing Any Code | Simon Ritter, Azul
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler Construction
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpreters
 
mRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System DevelopmentmRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System Development
 
Open arkcompiler
Open arkcompilerOpen arkcompiler
Open arkcompiler
 
Introduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutionsIntroduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutions
 
Compilers
CompilersCompilers
Compilers
 
Apache Big Data Europe 2016
Apache Big Data Europe 2016Apache Big Data Europe 2016
Apache Big Data Europe 2016
 
Persistent Memory Programming with Pmemkv
Persistent Memory Programming with PmemkvPersistent Memory Programming with Pmemkv
Persistent Memory Programming with Pmemkv
 
FOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VMFOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VM
 
Ml also helps generic compiler ?
Ml also helps generic compiler ?Ml also helps generic compiler ?
Ml also helps generic compiler ?
 
Exploring the Programming Models for the LUMI Supercomputer
Exploring the Programming Models for the LUMI Supercomputer Exploring the Programming Models for the LUMI Supercomputer
Exploring the Programming Models for the LUMI Supercomputer
 
High-Performance Computing with C++
High-Performance Computing with C++High-Performance Computing with C++
High-Performance Computing with C++
 

More from oscon2007

J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Touroscon2007
 
Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5oscon2007
 
Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifmoscon2007
 
Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Moleoscon2007
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashearsoscon2007
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swposcon2007
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Mythsoscon2007
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholisticoscon2007
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillipsoscon2007
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdatedoscon2007
 

More from oscon2007 (20)

J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 
Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5
 
Os Borger
Os BorgerOs Borger
Os Borger
 
Os Harkins
Os HarkinsOs Harkins
Os Harkins
 
Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifm
 
Os Bunce
Os BunceOs Bunce
Os Bunce
 
Yuicss R7
Yuicss R7Yuicss R7
Yuicss R7
 
Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Mole
 
Os Fogel
Os FogelOs Fogel
Os Fogel
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashears
 
Os Tucker
Os TuckerOs Tucker
Os Tucker
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swp
 
Os Furlong
Os FurlongOs Furlong
Os Furlong
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Myths
 
Os Kimsal
Os KimsalOs Kimsal
Os Kimsal
 
Os Pruett
Os PruettOs Pruett
Os Pruett
 
Os Alrubaie
Os AlrubaieOs Alrubaie
Os Alrubaie
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholistic
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillips
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdated
 

Recently uploaded

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Recently uploaded (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

Os Lattner

  • 1. The LLVM Compiler System LLVM: Low Level Virtual Machine Chris Lattner clattner@apple.com OSCON - Open Source Convention July 27, 2007
  • 2. LLVM Talk Overview The LLVM Approach to Compilers • • The LLVM C/C++/ObjC Compiler • OpenGL in Mac OS X 10.5, Powered by LLVM • Using LLVM with Scripting Languages http://llvm.org/
  • 3. Open Source Compiler Technology “Scripting” Language Interpreters: Python, Ruby, Perl, Javascript, etc • Traditionally interpreted at runtime, used by highly dynamic languages – Java and .NET Virtual Machines • Run time compilation for any language that can target the JVM – GCC: C/C++/ObjC/Ada/FORTRAN/Java Compiler • Static optimization and code generation at build time – http://llvm.org/
  • 4. OSS Compiler Technology Strengths 1/2 Scripting/Dynamic Language Strengths: • Interpreters are extremely portable and small (code size) – – Many interesting advanced compilation models (pypy, Parrot, jrubyc, etc) – Dynamic languages are very expressive and powerful Java Virtual Machine Strengths: • JVM bytecode is portable, JVMs available for many systems – – Many languages can be compiled to JVM – Provides runtime/JIT optimization, high level optimizations http://llvm.org/
  • 5. OSS Compiler Technology Strengths 2/2 GCC Strengths: • Support for important languages like C/C++ – – Other projects can emit C/C++ code and compile with GCC – Good code generation/optimization – Supports many different CPUs Common strengths: • Each has a large and vibrant community! – – We support tons of existing code written in many languages! With so many strengths, what could be wrong? http://llvm.org/
  • 6. OSS Compiler Technology Weaknesses 1/2 Common Problem: • The tools only work together at a very coarse grain – Ruby Python Ruby Python PyPy C, C++, Interp Interp Java ... Ada, ... C code GCC JVM Each arrow/box is a completely separate project from the others – – Very little sharing (e.g.) between ruby and python interpreter – Advanced optimizer projects don’t share code (e.g. jrubyc vs shedskin) http://llvm.org/
  • 7. OSS Compiler Technology Weaknesses 2/2 Scripting Language Weaknesses: • Efficient execution: poor “low level” performance, memory use – Java Virtual Machine Weaknesses: • Must use all of JVM or none of it: GC, JIT, class library, etc – – Forced to mold your language into the Java object model – Huge memory footprint and startup time GCC Weaknesses: • Old code-base and architecture: Very steep learning curve – – Doesn’t support modern compiler techniques (JIT, cross file optimization) – Slow compile times Each approach has mostly disjoint strengths and weaknesses! http://llvm.org/
  • 8. LLVM Vision and Approach Primary mission: build a set of modular compiler components that: • ... implement aggressive and modern techniques – ... integrate well with each other – ... have few dependencies on each other – ... are language- and target-independent where possible – ... integrate closely with existing tools where possible – Secondary mission: Build compilers that use these components • LTO ... X86 PPC CBE GCC clang Code IPO ... JIT DWARF Target Optzn linker gen ... BC IO LL IO System Core GC Support xforms analysis http://llvm.org/
  • 9. Value of a library-based approach Reduces the time & cost to construct a particular compiler • A new compiler = glue code plus any components not yet available • Components are shared across different compilers • Improvements made for one compiler benefits the others • Allows choice of the right component for the job • Don’t force “one true register allocator” scheduler, or optimization order , • Examples: • – First MacOS OpenGL JIT built in two weeks: – Required building “OpenGL to LLVM” converter – Replaced existing JIT, much better optimizations and performance – Initial bringup of llvm-gcc4 took 2-3 months (GCC is very complex!) – Required building “GCC tree to LLVM” converter – Including support for many targets, aggressive optimizations, etc Key LLVM Feature: IR is small, simple, easy to http://llvm.org/ understand, and is well defined
  • 10. Example Client: llvm-gcc4 C/C++/ObjC/...
  • 11. Standard GCC 4.x Design Standard compiler organization: front-end, optimizer, codegen • Parser and front-ends work with language-specific “trees” – – Optimizers use trees in “GIMPLE” form, modern SSA techniques, etc. – RTL code generator use antiquated compiler algorithms/data structures C Language tree-ssa Code C++ .s file Front-end Optimizer Generator ObjC ... GIMPLE RTL AST “tree” Pros: Excellent front-ends, support for many processors, defacto standard – – Cons: Very slow, memory hungry, hard to retarget, no JIT, no LTO, no aggressive optimizations, ... http://llvm.org/
  • 12. llvm-gcc4 Design Use GCC front-end with LLVM optimizer and code generator • Reuses parser, runtime libraries, and some GIMPLE lowering – – Requires a new GCC “tree to llvm” converter C Language LLVM LLVM Code LLVM IR LLVM IR C++ .s file Front-end Optimizer Generator ObjC ... LLVM IR LLVM CG IR AST “tree” http://llvm.org/
  • 13. LLVM optimizer features used by llvm-gcc Aggressive and fast optimizer built on modern techniques • SSA-based optimizer for light-weight (fast) and aggressive xforms – – Aggressive loop optimizations: unrolling, unswitching, mem promotion, ... – Many InterProcedural (cross function) optimizations: inlining, dead arg elimination, global variable optimization, IP constant prop, EH optzn, ... C Language LLVM LLVM Code LLVM IR LLVM IR C++ .s file Front-end Optimizer Generator ObjC ... Standard Scalar Optimizations Loop Optimizations Interprocedural Optimizations http://llvm.org/
  • 14. Other LLVM features used by llvm-gcc LLVM Code Generator • Modern retargetable code generator, easier to retarget than GCC – Write LLVM IR to disk for codegen after compile time: • link-time, install-time, run-time – C Language LLVM LLVM Code LLVM IR LLVM IR C++ .s file Front-end Optimizer Generator ObjC ... JIT LLVM IR DISK LTO Code exe Ship Gen file Install Time Code Generation http://llvm.org/
  • 15. Link-Time Optimization (LTO) Link-time is a natural place for interprocedural optimizations • Cross-module optimization is natural and trivial (no makefile changes) – – LLVM is safe with partial programs (dynamically loaded code, libraries, etc) – LTO has been available since LLVM 1.0! Any LLVM LLVM Front-end Optimizer LLVM LLVM Code Any LLVM LLVM LLVM LLVM ... Linker Optimizer Gen Front-end Optimizer IR in .o Link Time Any LLVM LLVM files Front-end Optimizer Compile Time http://llvm.org/
  • 16. Example Client: OpenGL JIT OpenGL Vertex/Pixel Shaders
  • 17. OpenGL Pixel/Vertex Shaders Small program, provided at run-time, to be run on each vertex/pixel: • Written in one of a few high-level graphics languages (e.g. GLSL) – – Executed millions of times, extremely performance sensitive Ideally, these are executed on the graphics card: • What if hardware doesn’t support some feature? (e.g. laptop gfx) – – Interpret or JIT on main CPU void main() { vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Vertex); vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal); vec3 lightVec = normalize(LightPosition - ecPosition); vec3 reflectVec = reflect(-lightVec, tnorm); vec3 viewVec = normalize(-ecPosition); float diffuse = max(dot(lightVec, tnorm), 0.0); float spec = 0.0; if (diffuse > 0.0) { spec = max(dot(reflectVec, viewVec), 0.0); spec = pow(spec, 16.0); } LightIntensity = DiffuseContribution * diffuse + SpecularContribution * spec; MCposition = gl_Vertex.xy; gl_Position = ftransform(); } http://llvm.org/ GLSL Vertex Shader
  • 18. MacOS OpenGL Before LLVM Custom JIT for X86-32 and PPC-32: • – Very simple codegen: Glued chunks of Altivec or SSE code – Little optimization across operations (e.g. scheduling) – Very fragile, hard to understand and change (hex opcodes) OpenGL Interpreter: • – JIT didn’t support all OpenGL features: fallback to interpreter – Interpreter was very slow, 100x or worse than JIT GFX Card OpenGL GLSL Custom JIT Parser Text Interpreter OpenGL AST http://llvm.org/
  • 19. OpenGL JIT built with LLVM Components OpenGL to LLVM LLVM OpenGL GLSL Parser Text LLVM Optimizer JIT LLVM IR LLVM IR OpenGL AST At runtime, build LLVM IR for program, optimize, JIT: • Result supports any target LLVM supports (+ PPC64, X86-64 in MacOS 10.5) – – Generated code is as good as an optimizing static compiler Other LLVM improvements to optimizer/codegen improves OpenGL • • Key question: How does the “OpenGL to LLVM” stage work? http://llvm.org/
  • 20. Structure of an Interpreter Simple opcode-based dispatch loop: • while (...) { ... switch (cur_opcode) { case dotproduct: result = opengl_dot(lhs, rhs); break; case texturelookup: result = opengl_texlookup(lhs, rhs); break; case ... One function per operation, written in C: • double opengl_dot(vec3 LHS, vec3 RHS) { #ifdef ALTIVEC ... altivec intrinsics ... #elif SSE Key Advantage of an Interpreter: ... sse intrinsics ... Easy to understand and debug, #else easy to write each operation (each ... generic c code ... operation is just C code) #endif } In a high-level language like GLSL, each op can be hundreds of LOC • http://llvm.org/
  • 21. OpenGL to LLVM Implementation Bytecode Bytecode C Code Opcode DISK llvm-gcc Ship Functions OpenGL Build Time OpenGL to LLVM LLVM OpenGL GLSL Parser LLVM Optimizer JIT LLVM IR LLVM IR OpenGL AST At OpenGL build time, compile each opcode to LLVM bytecode: • Same code used by the interpreter: easy to understand/change/optimize – http://llvm.org/
  • 22. OpenGL to LLVM: At runtime 1.Translate OpenGL AST into LLVM call instructions: one per operation 2.Use the LLVM inliner to inline opcodes from precompiled bytecode 3.Optimize/codegen as before OpenGL to LLVM LLVM OpenGL GLSL Parser LLVM Optimizer JIT LLVM IR LLVM IR OpenGL AST OpenGL to LLVM ... ... vec3 viewVec = normalize(-ecPosition); %tmp1 = call opengl_negate(ecPosition) float diffuse = max(dot(lightVec, tnorm), 0.0); %viewVec = call opengl_normalize(%tmp1); ... %tmp2 = call opengl_dot(%lightVec, %tnorm) %diffuse = call opengl_max(%tmp2, 0.0); ... LLVM Inliner Optimize, ... Codegen %tmp1 = sub <4 x float> <0,0,0,0>, %ecPosition %tmp3 = shuffle <4 x float> %tmp1, ...; PPC X86 %tmp4 = mul <4 x float> %tmp3, %tmp3 ... http://llvm.org/
  • 23. Benefits of this approach Key features: • Each opcode is written/debugged for a simple interpreter, in standard C – – Retains all advantages of an interpreter: debugability, understandability, etc – Easy to make algorithmic changes to opcodes – OpenGL runtime is independent of opcode implementation Primary contributions to Mac OS: • Support for PPC64/X86-64 – – Much better performance: optimizations, regalloc, scheduling, etc – No fallback to interpreter needed! – OpenGL group doesn’t maintain their own JIT! http://llvm.org/
  • 24. Example Client: a Scripting Language Loosely based on “pypy” Python Compiler
  • 25. LLVM and Dynamic Languages Dynamic languages are very different than C: • Extremely polymorphic, reflective, dynamically extensible – – Standard compiler optzns don’t help much if “+” is a dynamic method call Observation: in many important cases, dynamism is eliminable • Solution: Use dataflow and static analysis to infer types: – ‘i’ starts as an integer ++ on integer returns integer var i; for (i = 0; i < 10; ++i) ... A[i] ... i isn’t modified anywhere else We proved “i” is always an integer: change its type to integer instead of object – – Operations on “i” are now not dynamic – Faster, can be optimized by LLVM (e.g. loop unrolling) http://llvm.org/
  • 26. Advantages and Limitations of Static Analysis Works on unmodified programs in scripting languages: • No need for user annotations, no need for sub-languages – Many approaches for doing the analysis (with cost/benefit tradeoffs) • Most of the analyses could work with many scripting languages: • Parameterize the model with info about the language operations – Limitation: cannot find all types in general! • That’s ok though, the more we can prove, the faster it goes – http://llvm.org/
  • 27. Scripting Language Performance Ahead-of-Time Compilation provides: • Reduced memory footprint (no ASTs in memory) – – Eliminate (if no ‘eval’) or reduce use of interpreter at runtime (save code size) – Much better performance if type inference is successful JIT compilation provides: • Full support for optimizing eval’d code (e.g. json objects in javascript) – – Runtime “type profiling” for speculative optimizations LLVM provides: • Both of the above, with one language -> llvm translator – – Install-time codegen – Continuously improving set of optimizations and targets – Ability to inline & optimize code from different languages – inline your runtime library into the client code? http://llvm.org/
  • 28. Call for help! OSS community needs to unite work on various scripting languages – – Common module to represent/type infer an arbitrary dynamic language – Who will provide this? parrot? pypy? llvm itself someday? Ruby Python Perl Javascript ... C C, C++,Ada GLSL, ARB VP, ... Common Dynamic Language What Next? clang CFE llvm-gcc OpenGL Representation + Type Inference LLVM LTO JIT Install Time Cross Lang Debugger Codegen Optzn Support IPO http://llvm.org/
  • 29. LLVM Summary LLVM is a set of modular compiler components: • Spend your time working on interesting the higher level pieces! – – LLVM can be used to make great compilers! LLVM components are language- and target-independent: • Does not force use of JIT, GC, or a particular object model – – Code from different languages can be linked together and optimized LLVM provides aggressive functionality and is industrial strength: • Interprocedural optimization, link-time, install-time optimization today! – – LLVM has compiled and optimized millions of lines of code Other: Check out the New LLVM C Frontend: http://clang.llvm.org/ • http://llvm.org/ clattner@apple.com http://llvm.org/