陳少傑Chen, Sao-Jie臺灣大學:電子工程學研究所陳鴻奎Chen, Hong-KueiHong-KueiChen2010-07-142018-07-102010-07-142018-07-102008U0001-3007200814512600http://ntur.lib.ntu.edu.tw//handle/246246/189111當多核處理器(chip multiprocessor)變成處理器的主流時,如何使得程式在多核處理器上能夠更有效率的執行的研究問題顯得更為重要。不幸的是,傳統編譯器注重單核處理器以及循序的執行方式缺乏攫取程式平行的能力。本論文將發展一個可輔助平行化剖析的編譯器前端架構,這個架構提出三個不同的觀點的資訊對平行能力的攫取很大的幫助,這三個觀點分別是:靜態觀點(static view),動態觀點(dynamic view),機率觀點(probabilistic view)。態觀點使用程式相依圖(program dependence graph)及中間碼(intermediate representation)於我們的架構以求得程式碼與程式碼之間是否存在可平行執行的關係。動態觀點使用粗糙剖析器(coarse-grained profiler)收集程式執行過程的資訊,其中包含程式熱點(program hot spots)和記憶體存取與時間的關係。機率觀點使用Valgrind剖析器收集快取記憶體失誤比率(cache miss rate)。這些剖析的資訊可以幫助發展應用於多核處理器的嵌入式系統使之更有效率。Embedded systems on multi-core are nearly ubiquitous today such as handheld mobile phones and game consoles. When developing embedded systems on multi-cores, we need a profiler to analyze an application and find out whether it can be executed in parallel or which part of it can be executed in parallel, which will help a designer to decide how to use system resources well. In the Thesis, we developed a compiler front-end framework for parallelism profiling. Our proposed framework can extract the information on whether one application can be executed in parallel or not. These information are contributive to developing embedded systems on a multi-core environment.ABSTRACT iIST OF FIGURES vIST OF TABLES viiHAPTER 1. INTRODUCTION 1.1 Motivation 1.2 Objectives 2.3 Thesis Organization 2HAPTER 2. PRELIMINARIES 3.1 Overview of a Traditional Compiler 3.1.1 Lexical Analysis 5.1.2 Syntax Analysis 6.1.3 Abstract Syntax 8.1.4 Semantic Analysis 8.1.5 Symbol-Table Management 9.1.6 Intermediate Representation 10.1.7 Code Optimization 11.1.8 Code Generation 13.2 Overview of Profiling 14HAPTER 3. RELATED WORK 17.1 Related Compiler and Compiler Front-End 17.1.1 GNU Compiler Collection 17 .1.2 LANCE Compiler ………………....... 19.1.3 Edison Design Group 21.2 Related Intermediate Representation 21.2.1 Control and Data Flow Graph 21.2.2 Hierarchical Task Graph 23 .2.3 Program Dependence Graph 25.3 Related Profilers 26.3.1 GNU Profilers: Gcov and Gprof 26.3.2 Valgrind Profiler 29.3.3 Micro-Profiler 30HAPTER 4. COMPILER FRONT-END FRAMEWORK FOR PARALLELISM PROFILING 33.1 Compiler Front-End Framework 33.1.1 Scanner and Parser 34.1.2 Abstract Syntax Tree 35.1.3 Symbol-Table Management 36.1.4 Three Address Code Generator 39.1.5 Control and Data Flow Graph Generator and Program Dependence Graph Generator 42.2 Coarse-Grained Profiling 49.2.1 Keep Information of Program Structures 51.2.2 Identify Programs Hot Spots and Categorization 51.2.3 Explore Program Semantics for Parallelism 55.2.4 Explore Program Semantics for Hardware/Software Co-design 57HAPTER 5. VALIDATION METHODOLOGY AND RESULTS 59.1 Background 59.2 Validation Methodology and Results 60HAPTER 6. CONCLUSION AND FUTURE WORK 63.1 Conclusion 63.2 Future Work 63EFERENCE 651416001 bytesapplication/pdfen-US編譯器前端平行化粗顆粒剖析多核compilerfront-endparallelismcoarse-grained profilingmulti-core可輔助平行化剖析之編譯器前端架構Compiler Front-End Framework for Parallelism Profilingthesishttp://ntur.lib.ntu.edu.tw/bitstream/246246/189111/1/ntu-97-R95943154-1.pdf