SlideShare une entreprise Scribd logo
1  sur  64
Télécharger pour lire hors ligne
Build Programming Language
     Runtime with LLVM



Jim Huang ( 黃敬群 )
Developer & Co-founder, 0xlab
                                       jserv@0xlab.org

                                @ 1500 / March 27, 2011
150010 = 05DC16
• OSDC !
   • Open Source Developer Conference
   • 0x05DC
• About 0xlab
   • The meaning of open
   • 0x1ab16 = 42710 → 2009/04/27
• About me
   • http://about.me/jserv
  • 最大的專長就是培養興趣
Rights to copy
                                                                    © Copyright 2011 0xlab
                                                                           http://0xlab.org/
                                                                            contact@0xlab.org
Attribution – ShareAlike 3.0
You are free                                                  Corrections, suggestions, contributions and
                                                                               translations are welcome!
   to copy, distribute, display, and perform the work
   to make derivative works                                                Latest update:March 27, 2011
   to make commercial use of the work
Under the following conditions
      Attribution. You must give the original author credit.
      Share Alike. If you alter, transform, or build upon this work, you may distribute the
      resulting work only under a license identical to this one.
   For any reuse or distribution, you must make clear to others the license terms of this
   work.
   Any of these conditions can be waived if you get permission from the copyright holder.
Your fair use and other rights are in no way affected by the above.
License text: http://creativecommons.org/licenses/by-sa/3.0/legalcode
姊妹議程:
                             〈窮得只剩下 Compiler 〉
                                  OSDC.tw 2009
http://www.slideshare.net/jserv/what-can-compilers-do-for-us
姊妹議程:
                                   〈身騎 LLVM , 過三關:
                               淺談編譯器技術的嶄新應用〉
                                              TOSSUG 2009
            http://www.slideshare.net/jserv/llvm-introduction

                                           姊妹議程:
     〈 Applied Computer Science Concepts in Android 〉
                                    台大資訊系 2010
http://www.slideshare.net/jserv/applied-computer-science-concepts-in-android


                                           姊妹議程:
〈 from Source to Binary -- How GNU Toolchain Works 〉
                  臺北科技大學資訊工程所 2011/03/31
提綱   (1) Compilers on Rails 的時代
     (2) 探索 LLVM
     (3) 程式語言的變遷 (Low-Level 觀點 )
       傳統 -> 動態 -> 移動運算
     (4) LLVM 實例
Compilers on Rails 的時代
Compilers on Rails 的時代

[ 詞彙 ] on the rails: 正常運行 ; 在正常軌道
[ 啟發 ] Ruby on Rails:
 (1) convention over configuration
 (2) less software
 (3) programmer happiness ultimately leads to better productivity
隱藏在我們身邊的 Compiler
• Java / .Net ( 虛擬機器 +Just-In-Time compiler)
• 網路瀏覽器
   • Mozilla/Firefox (ActionMonkey/Tamarin)
   • WebKit (SquirrelFish)
   • Google Chrome (V8 engine)
• Web 應用程式: JSP/Servlet, SilverLight/.Net
• 移動通訊平台: Java ME, Android, iPhone,
  Portable Native Client
• 繪圖軟體: Adobe PixelBender, Shader
• 3D 高品質圖形處理: Gallium3D / OpenGL /
  Direct3D / RenderScript (Android)
傳統的 Compiler 流程
 Source Code           Assembly Code        Runnable Code




Compiler   Assembler    Loader     System        User




           Intermediate Code       Binary Code              DATA

IR (Intermediate Representation) 可說是 Compiler 的心臟

LLVM = Low Level Virtual Machine
以 color space 轉換來說,執行
                     以 color space 轉換來說,執行
   Specialize 技巧     時期得負擔大量且繁瑣的運算,
                     時期得負擔大量且繁瑣的運算,
                     如 BGRA 444R→ RGBA 8888
                     如 BGRA 444R→ RGBA 8888




Speedup depends on src/dest format:
 Speedup depends on src/dest format:
–– 5.4x speedup average, 19.3x speedup max
   5.4x speedup average, 19.3x speedup max
(13.3MB/s to 257.7MB/s)
 (13.3MB/s to 257.7MB/s)
Compiler 領導技術的時代
    • 運算模式已大幅改觀
    • Framework-driven
    • SIMD/vectorization, Cell, SMP/multi-core
    • 虛擬化 (Virtualization) 技術的時代
        → 更多元、更安全、更有效率地使用硬體
    • 資訊技術的雜交 (cross-over)
    • LLVM 的大一統宏願



案例:
Portable Native Client, OpenCL (GPGPU)
到處都有 VM
Java Virtual Machine (JVM)   Tamarin (ActionScript)
.NET Common Language         Valgrind (C++)
  Runtime (CLR)
                             Lua
Smalltalk
                             TrueType
Squeak
                             Dalvik
Parrot (Perl 6)
                             Adobe Flash (AVM2)
Python
                             p-code (USCD Pascal)
YARV (Ruby 1.9)
                             Zend
Rubinius

                                                      13
LLVM 可作為上述的編譯器應用的根基
探索 LLVM
LLVM
• Low-Level VM → bit-code
• 完整的編譯器基礎建設
   • 可重用的、用以建構編譯器的軟體元件
   • 允許更快更完整的打造新的編譯器
   • static compiler, JIT, trace-based optimizer, …
• 開放的編譯器框架
   • 多種程式語言支援
   • 高彈性的自由軟體授權模式 (BSD License)
   • 活躍的開發 (50% 開發者來自 Apple Inc.)
   • 豐富的編譯輸出: C, ARM, x86, PowerPC, …
豐富的工具集
Assemblers, automatic debugger, linker, code
generator, compiler driver, modular optimizer, …
Eric Schmidt 是 UNIX lex 共同作者
Eric Schmidt 是 UNIX lex 共同作者
GCC vs. LLVM
GCC                                      LLVM
C, C++, Obj-C, Fortran, Java, Ada, ...   C, C++, Obj-C
x86, ARM, MIPS, PowerPC, …

binutils (ld as)                         BSD-Style License

                                         JIT/Interpreter




Compiler Driver
Frontend   LLVM IR   Backend
Frontend   LLVM IR   Backend
CodeMark 參考數據
 Pentium4 3.0GHz Ubuntu: -Os -O3 -fast

 size: kbytes
10000                                                                                                                             40



9000      LLVM                                      GCC                                      Intel CC                             35


8000
                                                                                                                                  30

7000

                                                                                                                                  25
6000


5000                                                                                                                              20



4000
                                                                                                                                  15


3000
                                                                                                                                  10

2000

                                                                                                                                  5
1000


   0                                                                                                                              0
        clang-2.8 Os clang-2.6 O3 clang-2.8 fast gcc-4.4.3 Os gcc-4.4.3 O3 gcc-4.4.3 fast   icc-12 Os   icc-12 O3   icc-12 fast
看起來, LLVM 效能還不是最好,
  那為何我們還要關注?
LLVM 不只是個具工業強度的編譯器
美妙的 LLVM + Clang
Clang: LLVM 的程式語言前端

 C                                 x86 機械碼

                 Clang
C++       $ clang main.c mod.c     ARM 機械碼




Obj-C


               Clang driver

           libClang           ld

           libLLVM            as
Clang 與 LLVM 的關聯
         libClang                   libLLVM
 [C]                BitCode
main.c              main.bc
                                                      x86 組語
                                                       main.s
 [C]     Source →   BitCode                Code
                              Optimizer
mod.c     BitCode   mod.bc                Generator
Clang 功能示意
 [C]                         libClang               BitCode
main.c                                              main.bc
            lex
                                        codegen
 [C]                   AST                          BitCode
mod.c                                               mod.bc
          parse
                                        Analysis
                    Serialize/
         semantics Deserialize
                                 Checker Indexer




                   AST         AST                 IDE 整合
                  main.ast    mod.ast    輸出 / 解析    (Xcode)
BitCode + Optimizer
                                                  LTO: Link-Time Optimization
                                                  LTO: Link-Time Optimization
BitCode
main.bc                          Inter-precedual
                    BitCode
                     Linker
BitCode
                               Analysis Transforms
mod.bc    BitCode                                     BitCode        BitCode
           parser                                      writer       main.lto.bc
                    BitCode
                               Analysis Transforms




                        BitCode       BitCode
                       main.opt.bc   mod.opt.bc
LLVM Code Generation
                                         libLLVM

 BitCode                                              Machine
main.lto.bc                                           Analysis                  x86 組語
                BitCode                   Machine                                main.s
                          BitCode
                 parser                    Instr
                                                       Machine    Asm
                                                      Transforms Emitter

   Execution                            Transform
                          Transform                    Register
    Engine    CodeGen                    Machine
                          SDNode                      Allocation
  InterPreter                              Instr


                                                                          ARM.td
                                                                          InstrInfo
                                                                          Register
                          Instruction   Instruction             X86.td
                                                                         Subtarget
      [C++]                Selection    Scheduler              InstrInfo
                                                                           Frame
                                                               Register
     main.cpp    [C]                                                     Lowering x86
                                                              Subtarget         CallbackUtils
                main.c           SDNode                                 CallingConv
                                                                Frame            Transforms
                                                              Lowering
                          Selection DAG                      CallingConv
                          Selection DAG
先從 Hello World 開始
       • 完整的 Compiler Driver
              $ clang hello.c ­o hello
       • 生成 IR
              $ clang ­O3 ­emit­llvm hello.c ­c ­o hello.bc
       • 以 Just-In-Time compiler 模式執行 BitCode
              $ lli hello.bc




Getting Started with the LLVM System
Getting Started with the LLVM System
http://llvm.org/docs/GettingStarted.html
http://llvm.org/docs/GettingStarted.html
#include <stdio.h>
 #include <stdio.h>
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {
    printf("Hello world!n");
    printf("Hello world!n");
    return 0;
    return 0;
 }
 }


      函式 printf() 後方僅有一個
      函式 printf() 後方僅有一個                  • 反組譯 BitCode
      字串參數,前端預設將其
      字串參數,前端預設將其
          轉換為 puts()                          $ llvm­dis < hello.bc
           轉換為 puts()

  ; ModuleID = '<stdin>'
  ; ModuleID = '<stdin>'
  target datalayout = "e­p:32:32:32­...
  target datalayout = "e­p:32:32:32­...
  target triple = "i386­pc­linux­gnu"
  target triple = "i386­pc­linux­gnu"

  @str = internal constant [13 x i8] c"Hello world!00"
  @str = internal constant [13 x i8] c"Hello world!00"

  define i32 @main(i32 %argc, i8** nocapture %argv) nounwind {
  define i32 @main(i32 %argc, i8** nocapture %argv) nounwind {
  entry:
  entry:
    %puts = tail call i32 @puts(i8* getelementptr inbounds ([13 x i8]* @str, i32 0, i32 0))
    %puts = tail call i32 @puts(i8* getelementptr inbounds ([13 x i8]* @str, i32 0, i32 0))
    ret i32 0
    ret i32 0
  }
  }

  Declare i32 @puts(i8* nocapture) nounwind
  Declare i32 @puts(i8* nocapture) nounwind

        • 輸出 x86 後端組合語言
               $ llc hello.bc ­o hello.s
LLVM in Google Android 3.0 SDK
$ cd android­sdk­linux_x86/platform­tools
$ ./llvm­rs­cc ­­version
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.8svn
  Optimized build.
  Built Feb 16 2011 (19:26:29).
  Host: i386­unknown­linux
  Host CPU: penryn                 Android SDK (3.0 = API version 11)
                                   Android SDK (3.0 = API version 11)
                                   http://developer.android.com/sdk/
                                   http://developer.android.com/sdk/
  Registered Targets:
    arm    ­ ARM
    thumb  ­ Thumb
    x86    ­ 32­bit X86: Pentium­Pro and above
    x86­64 ­ 64­bit X86: EM64T and AMD64
$ ./llvm­rs­cc ­­help
OVERVIEW: RenderScript source compiler
                                                                31
LLVM in Google Android 3.0 SDK
    $ ./llvm­rs­cc ­­help
    OVERVIEW: RenderScript source compiler
    USAGE: llvm­rs­cc [options] <inputs>
•   OPTIONS:
      ­I <directory>          Add directory to include search path
      ­additional­dep­target <value>
                              Additional targets to show up in dependencies output
      ­allow­rs­prefix        Allow user­defined function prefixed with 'rs'
      ­bitcode­storage <value>
                              <value> should be 'ar' or 'jc'
      ­emit­asm               Emit target assembly files
      ­emit­bc                Build ASTs then convert to LLVM, emit .bc file
      ­emit­llvm              Build ASTs then convert to LLVM, emit .ll file
      ­emit­nothing           Build ASTs then convert to LLVM, but emit nothing
      ­help                   Print this help text
      ­java­reflection­package­name <value>
                              Specify the package name that reflected Java files belong to
      ­java­reflection­path­base <directory>
                              Base directory for output reflected Java files
                                                                                             32
測試 SDK 內建範例 RenderScript
android­sdk­linux_x86/platform­tools$ ./llvm­rs­cc 
  ../samples/android­11/ 
RenderScript/HelloWorld/src/com/android/rs/helloworld/helloworld.rs 
  ­I ../platforms/android­11/renderscript/include 
  ­I ../platforms/android­11/renderscript/clang­include
                                   // helloworld.rs
                                   // helloworld.rs
                                   // This is invoked automatically
                                   // This is invoked automatically
                                   // when the script is created
                                   // when the script is created
                                   void init() {
                                   void init() {
                                       gTouchX = 50.0f;
                                       gTouchX = 50.0f;
                                       gTouchY = 50.0f;
                                       gTouchY = 50.0f;
                                   }
                                   }

llvm­dis < helloworld.bc

@gTouchX = common global i32 0, align 4
@gTouchX = common global i32 0, align 4
@gTouchY = common global i32 0, align 4
@gTouchY = common global i32 0, align 4

define void @init() nounwind {
define void @init() nounwind {
  store i32 50, i32* @gTouchX, align 4
  store i32 50, i32* @gTouchX, align 4
  store i32 50, i32* @gTouchY, align 4
  store i32 50, i32* @gTouchY, align 4
  ret void                                                              33
  ret void
}
}
LLVM 給予無限可能

C/C++/       libClang      AST
Obj-C


           BitCode


            LibLLVM
            Optimizer

                 BitCode



Arch.td      libLLVM       xxx.s
          CodeGenerator
提供 IDE 的模組化
                                   有了 AST 後,即可針對
                 靜態編譯解析器
可用許多程式語言                           語言特性,做出特定的應用
撰寫 BitCode 生成
器 ( 前端編譯器 )
      C/C++/           libClang
,如 PerlObj-C
        module                            AST


                    BitCode
      其他語言                         系統優化處理
                      LibLLVM
                      Optimizer         作為其他語言的
                                        Source-to-source
 特定的後端架構。                               轉換器
 可以是硬體或軟體                            其他語言
                         BitCode


     Arch.td              LibLLVM        xxx.s
                        CodeGenerator
可增添其他模組,如
Polyhedral optimization           針對後端硬體的 Selection DAG
Xcode                     OpenCL Compiler
OpenCL →
Haskell →
Clay → C/C++/              libClang                  AST
        Obj-C
Crack →
                                          StrengthReduction
                        BitCode           Profile-gen/use
       其他語言
                                          AliasAnalysis
                          LibLLVM
                          Optimizer                →       JavaScript
 FPGA;
                                                   →       Java ByteCode
 GPGPU                                         其他語言
                                BitCode            →       CLI
                                                   →       PTX

      Arch.td             LibLLVM              regaloc=Pazzle|Graph
                                                     xxx.s
                        CodeGenerator          ObjectCodeEmitter
                Polly
將 LLVM 應用在非編譯器領域
LLVM 力:
「不是為了取悅硬體而寫編譯器,而為自己寫編譯器」
 • LLVM + Gallium3D: Mixing a Compiler With a
   Graphics Framework
   • http://people.freedesktop.org/~marcheu/fosdem09-g3dllvm.pdf


 • Runtime Code Generation for Huffman Decoders
    • “The speedup improvement is 23.2% at
      average and ranges from 32.2% to 14.2%.”
     http://solar.cslab.ece.ntua.gr/~kkourt/papers/huff-jit-report.pdf


 • A method for JIT’ing algorithms and data
   structures with LLVM
    • “For small AVL Trees (with less than ~3.000
      nodes), we can get an average performance
      of 26% over traditional method”
   • http://pyevolve.sourceforge.net/wordpress/?p=914
程式語言的變遷
(Low-Level 觀點 )
程式語言的變遷 ( 低階觀點 )
       • 職業無貴賤,程式語言是提出來解決人類面臨的
         問題之用             System Bus

                                       DMA        CPU              DSP

CPU       DMA
          DSP      Memory

                                      Memory
Interconnection network (BUS)                      Bridge
                                     controller
 DSP      Dedicated I/O
             IP
                                Peripherals

                                                  Peripheral Bus
               Programming Language
Indirection
 “All problems in computer
 science can be solved by
 another level of indirection."
      ~ Butler Lampson, 1972 ~
• UNIX v6 (1976) 提供以 C 語言重寫的作業系統
• 需求驅使的發展模式
  • 數學 / 工程 → Lisp → Lisp machine (?)
  • 軟體工程 → Smalltalk
  • 網際網路 → Java
遊戲產業驅使 Programming Language
      1972 Pong ( 硬體 )

      1980 Zork ( 高階直譯語言 )


      1993 DOOM (C)

      1998 Unreal (C++, Java-style scripting)


      2005-6 Xbox 360, PlayStation 3
      with 6-8 hardware threads

      2009 Next console generation.
      Unification of the CPU, GPU.
      Massive multi-core, data parallelism, etc.
今日的 Indirection 以 VM 形式存在
Charles Oliver Nutter (JRuby)
    “Building a Multilanguage VM” (2009)
    • Today, it is silly for a compiler to target actual hardware
       • Much more effective to target a VM
       • Writing a native compiler is lots more work!
    • Languages need runtime support
       • C runtime is tiny and portable (and wimpy)
       • More sophisticated language runtimes need
          • Memory management
          • Security
          • Reflection
          • Concurrency control
          • Libraries
          • Tools (debuggers, profilers, etc)
    • Many of these features are baked into VMs
JVM vs. Java Language vs. Ruby
              Java language        Ruby language


                    Checked exceptions     Open classes
                    Generics               Dynamic typing
                    Enums                  'eval'
JVM 特徵              Overloading            Closures
                    Constructor chaining   Mixins
                    Program analysis       Rich set of literals
                    Primitive types+ops    Primitive types+ops
Primitive types+ops
                    Object model           Object model
Object model
                    Memory model           Memory model
Memory model
                    Dynamic linking        Dynamic linking
Dynamic linking
                    Access control         Access control
Access control
                    GC                     GC
GC
                    Unicode                Unicode
Unicode                                                        45
在 JVM 上實做 Ruby 語言 (JRuby)
       • 好處:
         • 利用既有 JVM 在平台優化的效能與彈性
         • 存取豐富的 Java 資源
       • 難處:
         • Dynamic typing 讓已有優化技術變得難以發揮
         • JRuby 必須維護自己的 type system
            • Reflection overhead
         • 無法以有效率且健全的方式來實做 Ruby
           ”eval”
The Da Vinci Machine Project
The Da Vinci Machine Project
http://openjdk.java.net/projects/mlvm/
http://openjdk.java.net/projects/mlvm/   46
OpenJDK Multi-language VM
OpenJDK Multi-language VM
在 LLVM 上實做 Ruby 語言
• 開放實做:
  • MacRuby : http://www.macruby.org/
  • Rubinius : http://rubini.us/
• 若充分對應到 LLVM 的設計,應可發揮若干效能
  的改善與 runtime support
  • Out-source'd JIT Runtime
  • Why MacRuby Matters (Present & Future)
   http://programmingzen.com/2009/03/29/why-macruby-matters/




                                                               47
48
http://programmingzen.com/images/macruby-large-chart.png
LLVM 與程式語言實做
•   LLVM 在 bitcode 層面即考慮到動態語言的需求
•   VMKit: Java, .Net
•   允許多個階段的優化 : profiler, offline optimizing
•   提供 Accurate Garbage Collection
•   在移動裝置上的 JIT compiler
     • [RenderScript] Android 3.0: 實做 code
       cache ,試圖降低編譯的成本
     • 目前 LLVM 的效能仍無法趕上若干特製的
       VM 。案例: IcedTea/Shark, Dalvik

                                         49
Build Programming Language
     Runtime with LLVM 實例
Brainfuck
• Brainfuck 是種極為精簡的程式語言,由 Urban
  Müller 發展。當初的目標為提出一種簡單的、可
  用最小的編譯器來實現、符合 Turing complete
  的程式
• Brainfuck 僅有八個指令,其中兩個是 I/O 動作




                             51
Brainfuck
• 對應到 C 語言:若 char *p 指向記憶體區塊的
  話, Brainfuck 語言的八個指令可對照為以下:
• Brainfuck      C
  >              ++p;
  <              ­­p;
  +              ++*p;
  ­              ­­*p;
  .              putchar(*p);
  ,              *p = getchar();
  [              while (*p) {
  ]              }               52
Brainfuck
• Brainfuck 語言
  +++++[­]          Brainfuck   C

• 等價於 C 語言          >           ++p;
                    <           ­­p;
  *p+=5;            +           ++*p;
  while(*p != 0){   ­           ­­*p;
                    .           putchar(*p);
      *p­­;         ,           *p = getchar();
  }                 [           while (*p) {
                    ]           }




                                               53
#include <stdio.h>
#include <stdio.h>
void foo(char c) { putchar(c); }
void foo(char c) { putchar(c); }


define void @foo(i8 signext %c) nounwind {
define void @foo(i8 signext %c) nounwind {
  %1 = alloca i8, align 1                         ; <i8*> [#uses=2]
  %1 = alloca i8, align 1                         ; <i8*> [#uses=2]
  store i8 %c, i8* %1
  store i8 %c, i8* %1
  %2 = load i8* %1                                ; <i8> [#uses=1]
  %2 = load i8* %1                                ; <i8> [#uses=1]
  %3 = sext i8 %2 to i32                          ; <i32> [#uses=1]
  %3 = sext i8 %2 to i32                          ; <i32> [#uses=1]
  %4 = call i32 @putchar(i32 %3)                  ; <i32> [#uses=0]
  %4 = call i32 @putchar(i32 %3)                  ; <i32> [#uses=0]
  ret void
  ret void
}
}

declare i32 @putchar(i32)
declare i32 @putchar(i32)


   // declare i32 @putchar(i32)
   Function* putchar = cast<Function>(
       module­>getOrInsertFunction(
           "putchar", voidType, cellType, NULL));
   putchar­>setCallingConv(CallingConv::C);


                                                                 54
                         呼叫底層系統 libc 的 putchar 函式
Function* makeFunc(Module* module,
                   const char* source,
                   int tapeSize = 400) {
  ...
  // declare i32 @getchar()
  Function* getchar = cast<Function>(
     module­>getOrInsertFunction("getchar", cellType, NULL));
  getchar­>setCallingConv(CallingConv::C);
  
  // declare i32 @putchar(i32)
  Function* putchar = cast<Function>(
     module­>getOrInsertFunction("putchar",
      voidType, cellType, NULL));
  putchar­>setCallingConv(CallingConv::C);

  // Contruct void main(char* tape)
  Function* main = cast<Function>(
     module­>getOrInsertFunction(“main", voidType, NULL));
  main­>setCallingConv(CallingConv::C);
  ...
                                                           55
               http://0xlab.org/~jserv/llvm/bf-llvm.cpp
Function* makeFunc(Module* module,
                   const char* source,
                   int tapeSize = 400) {
  ...
  Value* zero = ConstantInt::get(cellType, 0);
  Value* one = ConstantInt::get(cellType, 1);
  Value* minOne = ConstantInt::get(cellType, ­1);
  ...
                    在 LLVM IR 中,預先若干定義的常數
                    zero = 0, one =1, minOne = -1
  BasicBlock* block =
      BasicBlock::Create(getGlobalContext(), "code", main);
  std::stack<bfLoopInfo> loops;
  IRBuilder<> codeIR(block);
  Value *head = codeIR.CreateAlloca(cellType, 
      ConstantInt::get(indexType, tapeSize));
  Value *it = head;                             建立 LLVM IR
  for (int i = 0; i < tapeSize; i++) {
    codeIR.CreateStore(zero, it);
    it = codeIR.CreateGEP(it, one);                       56
  }
Function* makeFunc(Module* module,
                   const char* source,
                   int tapeSize = 400) {
  ...
  while(*source) {
    IRBuilder<> builder(block); 將 brainfuck 轉成 LLVM IR
    switch(*source++) {
      case '>':
        head = builder.CreateGEP(head, one);
        break;
      case '<':
        head = builder.CreateGEP(head, minOne);
        break;
      case '+': {
        Value *headValue = builder.CreateLoad(head);
        Value *result =
            builder.CreateAdd(headValue, one);
        builder.CreateStore(result, head);
        break;
      }                                           57
      ...
Function* makeFunc(Module* module,
                   const char* source,
                   int tapeSize = 400) {
      ...
      case '­': {
        Value *headValue = builder.CreateLoad(head);
        Value *result =
             builder.CreateSub(headValue, one);
        builder.CreateStore(result, head);
        break;
      }
      case '.': {
        Value* output = builder.CreateLoad(head);
        builder.CreateCall(putchar, output);
        break;
      }                     稍早準備的 putchar 函式
      ...


                                                 58
Function* makeFunc(Module* module,
                   const char* source,
                   int tapeSize = 400) {
  ...
  // Close the function
  IRBuilder<> builder(block);
  builder.CreateRetVoid();
  return main;
}

int main(int argc, char* argv[]) {
  ...
  // Setup a module and engine for JIT­ing
  std::string error;
  InitializeNativeTarget();
  Module* module = new Module("bfcode", getGlobalContext());
  ExecutionEngine *engine = EngineBuilder(module)
    .setErrorStr(&error)
    .setOptLevel(CodeGenOpt::Aggressive)
    .create();                                              59
                  開啟進階優化的 ExecutionEngine (JIT)
Function *makeFunc(Module *module,
                   const char *source,
                   int tapeSize = 400) {
  ...
}

int main(int argc, char* argv[]) {
  ...
  // Compile the Brainfuck to IR
  std::cout << "Parsing..." << std::flush;
  Function* func = makeFunc(module, source.c_str());

  // Run optimization passes
  std::cout << "Optimizing..." << std::flush;
  FunctionPassManager pm(module);
  pm.add(new TargetData(
      *(engine­>getTargetData())));
  pm.add(createVerifierPass());
  pm.run(*func);
  ...                                            60
                       讓 LLVM 串起整個編譯器架構
int main(int argc, char* argv[]) {
  ...
  // Compile
  std::cout << "Compiling..." << std::flush;
  void (*bf)() = (void (*)())
      engine­>getPointerToFunction(func);
  std::cout << " done" << std::endl;
 
  // and run!               讓 function pointer 指向經由 JIT
  bf();                     編譯過的機械碼

  return 0;
}




                                                     61
架構於 LLVM 的程式語言實做 (1)
• Unladen Swallow (Google): faster Python
 $ ./perf.py -r -b call_simple --args "-j always," 
            ../q2/python ../q3/python
  • Min: 1.618273 -> 0.908331: 78.16% faster
  • Avg: 1.632256 -> 0.924890: 76.48% faster
    http://code.google.com/p/unladen-swallow

• GHC/Haskell's LLVM codegen
  • 3x faster in some cases
    http://donsbot.wordpress.com/2010/02/21/
    smoking-fast-haskell-code-using-ghcs-new-llvm-codegen/

• LLVM-Lua : JIT/static Lua compiler
  • http://code.google.com/p/llvm-lua/
                                                             62
架構於 LLVM 的程式語言實做 (2)
• IcedTea Version of Sun's OpenJDK (RedHat)
   • Zero: processor-independent layer that allows
     OpenJDK to build and run using any processor
   • Shark: Zero's JIT compiler: uses LLVM to provide
     native code generation without introducing
     processor-dependent code.
     http://icedtea.classpath.org
• Emscripten
   • LLVM-to-JavaScript compiler
   • It takes LLVM bitcode and compiles that into
     JavaScript, which can be run on the web (or
     anywhere else JavaScript can run).
     http://code.google.com/p/emscripten/
                                                    63
http://0xlab.org

Contenu connexe

Tendances

LLVM Register Allocation (2nd Version)
LLVM Register Allocation (2nd Version)LLVM Register Allocation (2nd Version)
LLVM Register Allocation (2nd Version)Wang Hsiangkai
 
LLVM Backend Porting
LLVM Backend PortingLLVM Backend Porting
LLVM Backend PortingShiva Chen
 
FISL XIV - The ELF File Format and the Linux Loader
FISL XIV - The ELF File Format and the Linux LoaderFISL XIV - The ELF File Format and the Linux Loader
FISL XIV - The ELF File Format and the Linux LoaderJohn Tortugo
 
How to write a TableGen backend
How to write a TableGen backendHow to write a TableGen backend
How to write a TableGen backendMin-Yih Hsu
 
Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이 왜 이리 힘드나요? (Lock-free에서 Transactional Memory까지)
Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이  왜 이리 힘드나요?  (Lock-free에서 Transactional Memory까지)Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이  왜 이리 힘드나요?  (Lock-free에서 Transactional Memory까지)
Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이 왜 이리 힘드나요? (Lock-free에서 Transactional Memory까지)내훈 정
 
Zynq + Vivado HLS入門
Zynq + Vivado HLS入門Zynq + Vivado HLS入門
Zynq + Vivado HLS入門narusugimoto
 
NDC11_슈퍼클래스
NDC11_슈퍼클래스NDC11_슈퍼클래스
NDC11_슈퍼클래스noerror
 
Altera SDK for OpenCL解体新書 : ホストとデバイスの関係
Altera SDK for OpenCL解体新書 : ホストとデバイスの関係Altera SDK for OpenCL解体新書 : ホストとデバイスの関係
Altera SDK for OpenCL解体新書 : ホストとデバイスの関係Mr. Vengineer
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)Brendan Gregg
 
第 1 回 Jetson ユーザー勉強会
第 1 回 Jetson ユーザー勉強会第 1 回 Jetson ユーザー勉強会
第 1 回 Jetson ユーザー勉強会NVIDIA Japan
 
Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android BenchmarksKoan-Sin Tan
 
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍흥배 최
 
잘 알려지지 않은 숨은 진주, Winsock API - WSAPoll, Fast Loopback
잘 알려지지 않은 숨은 진주, Winsock API - WSAPoll, Fast Loopback잘 알려지지 않은 숨은 진주, Winsock API - WSAPoll, Fast Loopback
잘 알려지지 않은 숨은 진주, Winsock API - WSAPoll, Fast Loopback흥배 최
 

Tendances (20)

LLVM Register Allocation (2nd Version)
LLVM Register Allocation (2nd Version)LLVM Register Allocation (2nd Version)
LLVM Register Allocation (2nd Version)
 
LLVM Backend Porting
LLVM Backend PortingLLVM Backend Porting
LLVM Backend Porting
 
Andes open cl for RISC-V
Andes open cl for RISC-VAndes open cl for RISC-V
Andes open cl for RISC-V
 
TMUX Rocks!
TMUX Rocks!TMUX Rocks!
TMUX Rocks!
 
FISL XIV - The ELF File Format and the Linux Loader
FISL XIV - The ELF File Format and the Linux LoaderFISL XIV - The ELF File Format and the Linux Loader
FISL XIV - The ELF File Format and the Linux Loader
 
Learn C Programming Language by Using GDB
Learn C Programming Language by Using GDBLearn C Programming Language by Using GDB
Learn C Programming Language by Using GDB
 
How to write a TableGen backend
How to write a TableGen backendHow to write a TableGen backend
How to write a TableGen backend
 
Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이 왜 이리 힘드나요? (Lock-free에서 Transactional Memory까지)
Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이  왜 이리 힘드나요?  (Lock-free에서 Transactional Memory까지)Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이  왜 이리 힘드나요?  (Lock-free에서 Transactional Memory까지)
Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이 왜 이리 힘드나요? (Lock-free에서 Transactional Memory까지)
 
Android Virtualization: Opportunity and Organization
Android Virtualization: Opportunity and OrganizationAndroid Virtualization: Opportunity and Organization
Android Virtualization: Opportunity and Organization
 
Zynq + Vivado HLS入門
Zynq + Vivado HLS入門Zynq + Vivado HLS入門
Zynq + Vivado HLS入門
 
NDC11_슈퍼클래스
NDC11_슈퍼클래스NDC11_슈퍼클래스
NDC11_슈퍼클래스
 
Vim Rocks!
Vim Rocks!Vim Rocks!
Vim Rocks!
 
Ndc12 2
Ndc12 2Ndc12 2
Ndc12 2
 
Altera SDK for OpenCL解体新書 : ホストとデバイスの関係
Altera SDK for OpenCL解体新書 : ホストとデバイスの関係Altera SDK for OpenCL解体新書 : ホストとデバイスの関係
Altera SDK for OpenCL解体新書 : ホストとデバイスの関係
 
Dpdk performance
Dpdk performanceDpdk performance
Dpdk performance
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
 
第 1 回 Jetson ユーザー勉強会
第 1 回 Jetson ユーザー勉強会第 1 回 Jetson ユーザー勉強会
第 1 回 Jetson ユーザー勉強会
 
Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android Benchmarks
 
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
 
잘 알려지지 않은 숨은 진주, Winsock API - WSAPoll, Fast Loopback
잘 알려지지 않은 숨은 진주, Winsock API - WSAPoll, Fast Loopback잘 알려지지 않은 숨은 진주, Winsock API - WSAPoll, Fast Loopback
잘 알려지지 않은 숨은 진주, Winsock API - WSAPoll, Fast Loopback
 

En vedette

Accelerating or Complicating PHP execution by LLVM Compiler Infrastructure
Accelerating or Complicating PHP execution by LLVM Compiler Infrastructure Accelerating or Complicating PHP execution by LLVM Compiler Infrastructure
Accelerating or Complicating PHP execution by LLVM Compiler Infrastructure National Cheng Kung University
 
LLVM Optimizations for PGAS Programs -Case Study: LLVM Wide Optimization in C...
LLVM Optimizations for PGAS Programs -Case Study: LLVM Wide Optimization in C...LLVM Optimizations for PGAS Programs -Case Study: LLVM Wide Optimization in C...
LLVM Optimizations for PGAS Programs -Case Study: LLVM Wide Optimization in C...Akihiro Hayashi
 
Phpcompilerinternals 090824022750-phpapp02
Phpcompilerinternals 090824022750-phpapp02Phpcompilerinternals 090824022750-phpapp02
Phpcompilerinternals 090824022750-phpapp02philipo
 
PHP, Under The Hood - DPC
PHP, Under The Hood - DPCPHP, Under The Hood - DPC
PHP, Under The Hood - DPCAnthony Ferrara
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life CycleXinchen Hui
 
Php Extensions for Dummies
Php Extensions for DummiesPhp Extensions for Dummies
Php Extensions for DummiesElizabeth Smith
 
Under the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT CompilerUnder the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT CompilerMark Stoodley
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?Ravi Raj
 
JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013Vladimir Ivanov
 
淺談編譯器最佳化技術
淺談編譯器最佳化技術淺談編譯器最佳化技術
淺談編譯器最佳化技術Kito Cheng
 
About Tokens and Lexemes
About Tokens and LexemesAbout Tokens and Lexemes
About Tokens and LexemesBen Scholzen
 
JVM JIT compilation overview by Vladimir Ivanov
JVM JIT compilation overview by Vladimir IvanovJVM JIT compilation overview by Vladimir Ivanov
JVM JIT compilation overview by Vladimir IvanovZeroTurnaround
 

En vedette (19)

Accelerating or Complicating PHP execution by LLVM Compiler Infrastructure
Accelerating or Complicating PHP execution by LLVM Compiler Infrastructure Accelerating or Complicating PHP execution by LLVM Compiler Infrastructure
Accelerating or Complicating PHP execution by LLVM Compiler Infrastructure
 
LLVM Optimizations for PGAS Programs -Case Study: LLVM Wide Optimization in C...
LLVM Optimizations for PGAS Programs -Case Study: LLVM Wide Optimization in C...LLVM Optimizations for PGAS Programs -Case Study: LLVM Wide Optimization in C...
LLVM Optimizations for PGAS Programs -Case Study: LLVM Wide Optimization in C...
 
Phpcompilerinternals 090824022750-phpapp02
Phpcompilerinternals 090824022750-phpapp02Phpcompilerinternals 090824022750-phpapp02
Phpcompilerinternals 090824022750-phpapp02
 
How PHP works
How PHP works How PHP works
How PHP works
 
PHP Internals
PHP InternalsPHP Internals
PHP Internals
 
PHP, Under The Hood - DPC
PHP, Under The Hood - DPCPHP, Under The Hood - DPC
PHP, Under The Hood - DPC
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life Cycle
 
Php Extensions for Dummies
Php Extensions for DummiesPhp Extensions for Dummies
Php Extensions for Dummies
 
Under the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT CompilerUnder the Hood of the Testarossa JIT Compiler
Under the Hood of the Testarossa JIT Compiler
 
PHP 7 new engine
PHP 7 new enginePHP 7 new engine
PHP 7 new engine
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?
 
JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013
 
淺談編譯器最佳化技術
淺談編譯器最佳化技術淺談編譯器最佳化技術
淺談編譯器最佳化技術
 
About Tokens and Lexemes
About Tokens and LexemesAbout Tokens and Lexemes
About Tokens and Lexemes
 
JVM JIT compilation overview by Vladimir Ivanov
JVM JIT compilation overview by Vladimir IvanovJVM JIT compilation overview by Vladimir Ivanov
JVM JIT compilation overview by Vladimir Ivanov
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
 
Recognition-of-tokens
Recognition-of-tokensRecognition-of-tokens
Recognition-of-tokens
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
 

Similaire à Build Programming Language Runtime with LLVM

Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivRon Perlmuter
 
Isomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornIsomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornMaxime Najim
 
The Netflix API Platform for Server-Side Scripting
The Netflix API Platform for Server-Side ScriptingThe Netflix API Platform for Server-Side Scripting
The Netflix API Platform for Server-Side ScriptingKatharina Probst
 
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog CcFlex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog CcFrançois Le Droff
 
Tech talk with lampro mellon an open source solution for accelerating verific...
Tech talk with lampro mellon an open source solution for accelerating verific...Tech talk with lampro mellon an open source solution for accelerating verific...
Tech talk with lampro mellon an open source solution for accelerating verific...RISC-V International
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVMJung Kim
 
POCO C++ Libraries Intro and Overview
POCO C++ Libraries Intro and OverviewPOCO C++ Libraries Intro and Overview
POCO C++ Libraries Intro and OverviewGünter Obiltschnig
 
Learn OpenStack from trystack.cn ——Folsom in practice
Learn OpenStack from trystack.cn  ——Folsom in practiceLearn OpenStack from trystack.cn  ——Folsom in practice
Learn OpenStack from trystack.cn ——Folsom in practiceOpenCity Community
 
(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?Steve Poole
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVMJohn Lee
 
Mastering Chaos - A Netflix Guide to Microservices
Mastering Chaos - A Netflix Guide to MicroservicesMastering Chaos - A Netflix Guide to Microservices
Mastering Chaos - A Netflix Guide to MicroservicesJosh Evans
 
Introdot Netc Sharp En
Introdot Netc Sharp EnIntrodot Netc Sharp En
Introdot Netc Sharp EnGregory Renard
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsSerge Stinckwich
 
QConSF2016-JoshEvans-MasteringChaosANetflixGuidetoMicroservices-compressed.pdf
QConSF2016-JoshEvans-MasteringChaosANetflixGuidetoMicroservices-compressed.pdfQConSF2016-JoshEvans-MasteringChaosANetflixGuidetoMicroservices-compressed.pdf
QConSF2016-JoshEvans-MasteringChaosANetflixGuidetoMicroservices-compressed.pdfSimranjyotSuri
 
From nothing to production in 1 hour
From nothing to production in 1 hourFrom nothing to production in 1 hour
From nothing to production in 1 hourRoy Braam
 

Similaire à Build Programming Language Runtime with LLVM (20)

Android Optimization: Myth and Reality
Android Optimization: Myth and RealityAndroid Optimization: Myth and Reality
Android Optimization: Myth and Reality
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
 
Isomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornIsomorphic JavaScript with Nashorn
Isomorphic JavaScript with Nashorn
 
The Netflix API Platform for Server-Side Scripting
The Netflix API Platform for Server-Side ScriptingThe Netflix API Platform for Server-Side Scripting
The Netflix API Platform for Server-Side Scripting
 
Os Lattner
Os LattnerOs Lattner
Os Lattner
 
olibc: Another C Library optimized for Embedded Linux
olibc: Another C Library optimized for Embedded Linuxolibc: Another C Library optimized for Embedded Linux
olibc: Another C Library optimized for Embedded Linux
 
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog CcFlex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
 
Tech talk with lampro mellon an open source solution for accelerating verific...
Tech talk with lampro mellon an open source solution for accelerating verific...Tech talk with lampro mellon an open source solution for accelerating verific...
Tech talk with lampro mellon an open source solution for accelerating verific...
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
 
POCO C++ Libraries Intro and Overview
POCO C++ Libraries Intro and OverviewPOCO C++ Libraries Intro and Overview
POCO C++ Libraries Intro and Overview
 
.Net Core
.Net Core.Net Core
.Net Core
 
Learn OpenStack from trystack.cn ——Folsom in practice
Learn OpenStack from trystack.cn  ——Folsom in practiceLearn OpenStack from trystack.cn  ——Folsom in practice
Learn OpenStack from trystack.cn ——Folsom in practice
 
(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVM
 
Mastering Chaos - A Netflix Guide to Microservices
Mastering Chaos - A Netflix Guide to MicroservicesMastering Chaos - A Netflix Guide to Microservices
Mastering Chaos - A Netflix Guide to Microservices
 
Introdot Netc Sharp En
Introdot Netc Sharp EnIntrodot Netc Sharp En
Introdot Netc Sharp En
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systems
 
Cont0519
Cont0519Cont0519
Cont0519
 
QConSF2016-JoshEvans-MasteringChaosANetflixGuidetoMicroservices-compressed.pdf
QConSF2016-JoshEvans-MasteringChaosANetflixGuidetoMicroservices-compressed.pdfQConSF2016-JoshEvans-MasteringChaosANetflixGuidetoMicroservices-compressed.pdf
QConSF2016-JoshEvans-MasteringChaosANetflixGuidetoMicroservices-compressed.pdf
 
From nothing to production in 1 hour
From nothing to production in 1 hourFrom nothing to production in 1 hour
From nothing to production in 1 hour
 

Plus de National Cheng Kung University

PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimeNational Cheng Kung University
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明National Cheng Kung University
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明National Cheng Kung University
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明National Cheng Kung University
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsNational Cheng Kung University
 
Lecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationLecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationNational Cheng Kung University
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學National Cheng Kung University
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsNational Cheng Kung University
 

Plus de National Cheng Kung University (20)

PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtime
 
2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
 
Construct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoTConstruct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoT
 
The Internals of "Hello World" Program
The Internals of "Hello World" ProgramThe Internals of "Hello World" Program
The Internals of "Hello World" Program
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
 
Virtual Machine Constructions for Dummies
Virtual Machine Constructions for DummiesVirtual Machine Constructions for Dummies
Virtual Machine Constructions for Dummies
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
 
從線上售票看作業系統設計議題
從線上售票看作業系統設計議題從線上售票看作業系統設計議題
從線上售票看作業系統設計議題
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
 
Xvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisorXvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisor
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Implement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVMImplement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVM
 
Priority Inversion on Mars
Priority Inversion on MarsPriority Inversion on Mars
Priority Inversion on Mars
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM Boards
 
Lecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationLecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and Implementation
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
 
Open Source from Legend, Business, to Ecosystem
Open Source from Legend, Business, to EcosystemOpen Source from Legend, Business, to Ecosystem
Open Source from Legend, Business, to Ecosystem
 

Dernier

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Dernier (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

Build Programming Language Runtime with LLVM