透過您的圖書館登入
IP:18.117.142.248
  • 學位論文

內建於行動裝置之高效能編譯器

LLVM MC Compiler on Android

指導教授 : 廖世偉

摘要


LLVM是一種的新的編譯器架構,透過良好的設計方法和架構,LLVM包含許多高度模組化和可重複使用的元件,透過這些元件,開發者可以快速地在LLVM的架構中,實做出各種程式語言的前端以及支援不同平台的後端。LLVM已發展為龐大的開放原始碼計畫,並且包含多個子計畫,LLVM Machine Code為其子計畫之一,簡稱為MC。MC Compiler即為藉由MC計畫所開發出的編譯器。 LLVM MC透過更好的架構設計,讓LLVM後端擁有更好的模組化特性,增加可重複使用的元件,減少重複的程式碼。利用這些元件,可以有效率地開發特定平台上的後端相關工具。透過LLVM MC的架構和元件,這篇論文在Android內部實做了MC Compiler。藉由MC Compiler,將可解決Android目前所面臨的許多問題。 開發Android應用程式的方式主要有三種,分別是Java、C/C++、RenderScript。對於效能要求較高的應用程式,Java並不適合。在此情況下,大部分的開發者會使用C/C++來進行產品的開發。在使用C/C++進行開發的情況下,雖然獲得了效能上的增加,但程式的跨平台特性將會受到限制,已編譯為機器碼的檔案,將無法在某些平台上正確執行。透過整合MC Compiler將可以解決此問題。透過在裝置端進行編譯,應用程式可以確保跨平台的特性,同時可以徹底發揮硬體的效能,減少開發廠商的成本。 MC Compiler的使用,也同時為RenderScript帶來改進。RenderScript是Android中的高效能繪圖系統,開發者透過撰寫rs程式檔,可以獲得優於Java以及C/C++的執行速度。目前在RenderScript的架構下,後端是使用動態即時編譯。動態編譯的架構並沒有提供良好的除錯機制,除錯工具的缺乏造成了開發上的不易。這篇論文中,使用MC Compiler作為RenderScript的後端,在初次執行的過程,產生ELF格式的物件檔,同時在此物件檔中包含Dwarf格式的除錯資訊,藉由Dwarf格式的除錯資訊,將可提供開發者一套良好的除錯機制。

關鍵字

編譯器 Android LLVM NDK RenderScript

並列摘要


LLVM is an open source compiler infrastructure with well modular and reusable components, it provides target-independent optimizations, and code generations for various CPUs, using LLVM bitcode file format as target-independent intermediate representation. Building components of a new compiler with LLVM components takes advantages of LLVM infrastructure. LLVM Machine Code subproject, abbreviated as LLVM MC, is a subproject of LLVM. It solves problems in the realm of assembly、disassembly、object file format handing, and the area which CPU-instruction level tools work in. MC Compiler is a compiler implemented with the components developed in MC subproject. This thesis presents the architecture which integrates MC Compiler into Android, using MC Compiler to improve the performance and portability of the applications developed by C/C++. Additionally, RenderScript is a high-performance subsystem for 3D graphic rendering in Android. Integrating MC Compiler gives a useful debugging method for Android RenderScript developers, and running RenderScript applications without re-compilation on each execution.

並列關鍵字

LLVM MC Compiler Android RenderScript

參考文獻


[5] B.Sc. Dominic Fandrey. Clang/LLVM Maturity Report, Dominic Fandrey, Proceedings of the Summer 2010 Research Seminar, Computer Science Dept., University of Applied Sciences Karlsruhe, June 2010.
[2] C.L attner and V. Adve. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In Proceedings of the 2004 International Symposium on Code Generation and Optimization (CGO’04);Palo Alto, California”, pages 75–84. ACM Press, 2004.
[13] Dwarf Debugging Standard Website. http://www.dwarfstd.org/
[1] C. Lattner, Introduction to the LLVM Compiler Infrastructure, presented at the 2006 Itanium Conference and Expo, San Jose, California, April 2006.MC.
[3] C. Lattner. LLVM: An Infrastructure for Multi-Stage Optimization. Master’s thesis, Computer Science Dept., University of Illinois at Urbana-Champaign,Urbana, IL, Dec 2002. See http://llvm.cs.uiuc.edu

延伸閱讀