研究生: |
陳鵬升 PENG-SHENG CHEN |
---|---|
論文名稱: |
先進硬體架構之機率化指標分析之研究 Foundations of Probabilistic Points-to Analysis for Advanced Architecture |
指導教授: |
李政崑
Jenq Kuen Lee |
口試委員: | |
學位類別: |
博士 Doctor |
系所名稱: |
電機資訊學院 - 資訊工程學系 Computer Science |
論文出版年: | 2005 |
畢業學年度: | 93 |
語文別: | 英文 |
論文頁數: | 93 |
中文關鍵詞: | 編譯器 、指標分析 、推測式多執行緒 、相依性分析 、機率 |
外文關鍵詞: | compiler, points-to analysis, speculative multithreading, dependence analysis, probability |
相關次數: | 點閱:3 下載:0 |
分享至: |
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
在執行最佳化與平行化以開發先進硬體架構之特色的同時,編譯器為了提升程式執行的效能,需要量化地評估各種轉換後的效益。假如指標別名(alias)關係發生的機率很高或很低,則一些有用的最佳化與平行化的方法將可以被應用。例如,假如發生的機率很低,編譯器將可轉換程式去完成推測式資料存取、或將每個loop iteration在推測式多執行緒(speculative multithreading)架構下執行、或避免產生特殊的程式碼。因此,對於編譯器而言,整合能夠量化指標關係的指標分析方法是非常重要的。然而,傳統的機率分析技巧並沒有提供量化的資訊,本論文提出一機率化指標分析的方法來計算程式中每個指標關係發生的機率。我們所提出的方法包含了elimination algorithm與 iterative algorithm。我們同時也實作了一編譯器原型來完成跨程序的機率化指標分析,實驗結果顯示我們所提出的方法可以精確的估計指標關係的機率,對於實驗中所測試的效能評估程式,我們得到平均約4.61%的誤差。
除此之外,我們同時也將此機率化指標分析的資訊應用在推測式多執行緒架構上的編譯器最佳化之研究,推測式多執行緒(SpMT)架構可以開發無法在靜態分析上所獲得的程式平行度。在這種架構下,程式效能的增加主要來自於推測式的執行緒同時執行,然而,假如執行緒之間有高度相依性,則程式的效能反而會降低,這是由於執行緒推測錯誤將啟動回復機制,而回復機制會造成程式執行上很大的負擔,因此,在推測式多執行緒的架構下,如何量化相依性的關係,並依照此資訊,當相依性關係大於某個值時,就關閉推測式多執行緒的執行方式是非常重要的。本論文,我們亦提出了量化loop iteration間相依性關係的方法,此資訊可以用來決定是否應該使用推測式多執行緒來執行loop iteration。這部分的技術包含兩個階段,首先是利用機率化的指標分析計算指標關係的機率,接著利用此資訊進一步計算loop iteration間的相依性之機率。實驗結果顯示我們所提出的方法將正確的指導編譯器是否應該使用推測式的機制,對於推測式多執行緒架構,在效能上有顯著的改進。
When performing aggressive optimizations and parallelization to exploit features of advanced architectures, optimizing and parallelizing compilers need to quantitatively assess the profitability of any transformations in order to achieve high performance. Useful optimizations and parallelization can be performed if it is known that certain points-to relationships would hold with high or low probabilities. For instance, if the probabilities are low, a compiler could transform programs to perform data speculation or partition iterations into threads in speculative multithreading, or it would avoid conducting code specialization. Consequently, it is essential for compilers to incorporate pointer analysis techniques that can estimate the possibility for every points-to relationship that it would hold during the execution. However, conventional pointer analysis techniques do not provide such quantitative descriptions and thus hinder compilers from more aggressive optimizations, such as thread partitioning in speculative multithreading, data speculations, code specialization, etc.
This thesis addresses this issue by proposing a probabilistic points-to analysis (PPA) technique to compute the probability of every points-to relationship at each program point. Based on the foundation of data-flow analysis, an elimination algorithm and an iterative algorithm were developed respective to handle and solve the related problems of probabilistic interprocedural points-to analysis. A prototype compiler has been implemented upon the SUIF system to perform the interprocedural probabilistic points-to analysis. Experimental results show this technique can estimate the probabilities of points-to relationships in benchmark programs with reasonable small
errors, about 4.61% in average.
In additions, we present an application of adopting probabilistic points-to information into compiler optimizations for speculative multithreading architecture.
Speculative multithreading (SpMT) architecture can exploit thread-level parallelism that cannot be identified statically. Speedup can be obtained by speculatively executing threads in parallel that are extracted from a sequential program. However, performance degradation might happen if the threads are highly dependent, since a
recovery mechanism will be activated when a speculative thread executes incorrectly and such a recovery action usually incurs a very high penalty. Therefore, it is essential for SpMT to quantify the degree of dependences and to turn off speculation if the degree of dependences passes certain thresholds. We propose a technique that quantitatively computes dependences between loop iterations and such information can be used to determine if loop iterations can be executed in parallel by speculative threads. This technique can be broken into two steps. First probabilistic points-to analysis is performed to estimate the probabilities of points-to relationships in case there are pointer references in programs, and then the degree of dependences between loop iterations is computed quantitatively. Experimental results show compiler-directed
thread-level speculation based on the information gathered by this technique can achieve significant performance improvement on SpMT.
[1] Haitham Akkary and Michael A. Driscol. A dynamic multithreading processor. In Proceedings of the 31st annual ACM/IEEE international symposium on Microarchitecture,
pages 226{236, 1998.
[2] Lars Ole Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, May 1994.
ftp://ftp.diku.dk/diku/semantics/papers/D-203.dvi.Z.
[3] Thomas Ball, Peter Mataga, and Mooly Sagiv. Edge profiling versus path profiling: the showdown. In Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on
Principles of programming languages, pages 134{148. ACM Press, 1998.
[4] Utpal Banerjee. Dependence testing in ordinary programs. Master's thesis, Department of Computer Science, University of Illinois, Urbana-Champaign, IL, November 1976.
[5] Utpal Banerjee. Dependence analysis for supercomputing. The Kluwer international
series in engineering and computer science. Parallel processing and fifth generation
computing. Kluwer Academic, Boston, MA, USA, 1988.
[6] Christian Bauer, Alexander Frink, and Richard Krechel. Introduction to the GiNaC framework for symbolic computation within the C++ programming language. Journal
of Symbolic Computation, 33:1{12, 2002.
[7] Alex Berson, Stephen Smith, and Kurt Thearling. Building Data Mining Applications for CRM. McGraw-Hill, 1999.
[8] Michael Burke, Paul Carini, Jong-Deok Choi, and Michael Hind. Flow-insensitive interprocedural alias analysis in the presence of pointers. In Proceedings of the 8th In-
ternational Workshop on Languages and Compilers for Parallel Computing, Columbus, Ohio, August 1995.
[9] M. C. Carlisle and A. Rogers. Software caching and computation migration in olden. In Proceedings of ACM SIGPLAN Conference on Principles and Practice of Parallel
Programming, pages 29{39, July 1995.
[10] Weng-Long Chang, Chih-Ping Chu, and Jesse Wu. The generalized lambda test. In IPPS/SPDP, pages 181{186, 1998.
[11] Peng-Sheng Chen, Ming-Yu Hung, Yuan-Shin Hwang, Roy Dz-Ching Ju, and Jenq Kuen Lee. Compiler support for speculative multithreading architecture with probabilistic points-to analysis. In Proceedings of ACM SIGPLAN Conference on Principles and Practice of Parallel Programming, pages 25{36, June 2003.
[12] Jong-Deok Choi, Michael Burke, and Paul Carini. E±cient flow-sensitive interprocedural computation of pointer-induced aliases and side eRects. In Proceedings of the
20th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 232{245. ACM Press, 1993.
[13] Burger D. and T. Austin. The SimpleScalar Tool Set, Version 3.0. Unversity of Wisconsin Madison Computer Science Department.
[14] Manuvir Das. Uni‾cation-based pointer analysis with directional assignments. In Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (PLDI-00), volume 35.5 of ACM Sigplan Notices, pages 35{46, N.Y., June 18{21 2000. ACM Press.
[15] Alain Deutsch. Interprocedural May-Alias analysis for pointers: Beyond k-limiting. SIGPLAN Notices, 29(6):230{241, June 1994. Proceedings of the ACM SIGPLAN '94 Conference on Programming Language Design and Implementation.
[16] Maryam Emami, Rakesh Ghiya, and Laurie J. Hendren. Context-sensitive interprocedural Points-to analysis in the presence of function pointers. SIGPLAN Notices,
29(6):242{256, June 1994. Proceedings of the ACM SIGPLAN '94 Conference on Programming Language Design and Implementation.
[17] Freddy Gabbay and Avi Mendelson. Can program profiling support value prediction? In Proceedings of the 30th annual ACM/IEEE international symposium on Microarchitecture, pages 270{280, 1997.
[18] Gina GoR, Ken Kennedy, and Chau-Wen Tseng. Practical dependence testing. In PLDI'91: Proceedings of the ACM SIGPLAN 1991 conference on Programming language design and implementation, pages 15{29, New York, NY, USA, 1991. ACM Press.
[19] Mary W. Hall and Ken Kennedy. Eficient call graph analysis. ACM Letters on Programming Languages and Systems, 1(3):227{242, September 1992.
[20] Lance Hammond, Ben Hubbert, Michael Siu, Manohar Prabhu, Mike Chen, and Kunle Olukotun. The stanford hydra cmp. IEEE MICRO Magazine, March-April 2000.
[21] M.S. Hecht. Flow Analysis of Computer Programs. Elsevier North-Holland, 1977.
[22] Joseph Hummel, Laurie J. Hendren, and Alexandru Nicolau. A general data dependence test for dynamic, pointer-based data structures. In PLDI '94: Proceedings of the ACM SIGPLAN 1994 conference on Programming language design and implementation, pages 218{229, New York, NY, USA, 1994. ACM Press.
[23] Intel Corporation. IA-64 Application Developer's Architecture Guide, 1999.
[24] R. D.C. Ju, J.-F. Collard, and K. Oukbir. Probabilistic memory disambiguation and its application to data speculation. In Proceedings of the 3rd Workshop on Interaction between Compilers and Computer Architecture, October 1998.
[25] Brian W. Kernighan and Dennis M. Ritchie. The C programming language, Second Edition. Prentice Hall, 1988.
[26] Venkata Krishnan and Josep Torrellas. A chip- multiprocessor architecture with speculative multithreading. IEEE Transactions on Computers, 48(9):866{880, 1999.
[27] William Landi and Barbara G. Ryder. A safe approximate algorithm for interprocedural pointer aliasing. SIGPLAN Notices, 27(7):235{248, July 1992. Proceedings of the
ACM SIGPLAN '92 Conference on Programming Language Design and Implementation.
[28] William Landi, Barbara G. Ryder, and Sean Zhang. Interprocedural side eRect analysis with pointer aliasing. SIGPLAN Notices, 28(6):56{67, June 1993. Proceedings of the
ACM SIGPLAN '93 Conference on Programming Language Design and Implementation.
[29] Jenq Kuen Lee, Dan Ho, and Y. C. Chuang. Data distribution analysis and optimization for pointer-based distributed programs. In Proceedings of the 26th International Conference on Parallel Processing (ICPP), pages 56{63, Bloomingdale, IL USA, August 1997. IEEE Computer Society.
[30] Zhiyuan Li, Pen-Chung Yew, and Chuan-Qi Zhu. An eficient data dependence analysis for parallelizing compilers. IEEE Transactions on Parallel and Distributed Systems,
1(1):26{34, 1990.
[31] Dror E. Maydan, John L. Hennessy, and Monica S. Lam. E±cient and exact data dependence analysis. In PLDI '91: Proceedings of the ACM SIGPLAN 1991 conference on Programming language design and implementation, pages 1{14, New York, NY, USA, 1991. ACM Press.
[32] Steven S. Muchnick. Advanced Compiler Design & Implementation. Morgen Kaufmann, 1997.
[33] R. Muth, S. Watterson, and S. Debray. Code specialization based on value profiles. In Proceedings of the 7th International Static Analysis Symposium, pages 340{359, 2000.
[34] JeRrey Oplinger, David Heine, Shih-Wei Liao, Basem A. Nayfeh, Monica S. Lam, and Kunle Olukotun. Software and hardware for exploiting speculative parallelism with a
multiprocessor. Technical Report CSL-TR-97-715, Stanford University, February 1997.
[35] Constantine D. Polychronopoulos. Parallel Programming and Compilers. Kluwer Academic Publishers, 1988.
[36] William Pugh. The omega test: a fast and practical integer programming algorithm for dependence analysis. In Supercomputing '91: Proceedings of the 1991 ACM/IEEE
conference on Supercomputing, pages 4{13, New York, NY, USA, 1991. ACM Press.
[37] William Pugh and David Wonnacott. Eliminating false data dependences using the omega test. In PLDI '92: Proceedings of the ACM SIGPLAN 1992 conference on
Programming language design and implementation, pages 140{151, New York, NY, USA, 1992. ACM Press.
[38] G. Ramalingam. Data flow frequency analysis. In Proceedings of the ACM SIGPLAN'96 conference on Programming language design and implementation, pages 267{277. ACM Press, 1996.
[39] C. V. Ramamoorthy. Analysis of computational systems: Discrete markov analysis of computer programs. In Proceedings of the 1965 20th national conference, pages
386{392, Cleveland, Ohio, 1965.
[40] Thomas Reps, Susan Horwitz, and Mooly Sagiv. Precise interprocedural dataflow analysis via graph reachability. In Conference Record of POPL '95: 22nd ACM SIGPLAN-
SIGACT Symposium on Principles of Programming Languages, pages 49{61, San Francisco, California, January 1995.
[41] Erik Ruf. Context-insensitive alias analysis reconsidered. SIGPLAN Notices, 30(6):13{22, June 1995. Proceedings of the ACM SIGPLAN '95 Conference on Programming Language Design and Implementation.
[42] Radu Rugina and Martin Rinard. Pointer analysis for multithreaded programs. In Proceedings of the ACM SIGPLAN '99 conference on Programming language designand implementation, pages 77{90. ACM Press, 1999.
[43] B. G. Ryder and M. C. Paull. Elimination algorithms for data flow analysis. ACM Computing Surveys, 18(3):277{316, September 1986.
[44] Marc Shapiro and Susan Horwitz. Fast and accurate flow-insensitive points-to analysis. In Conference Record of POPL '97: 24nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 1{14, Paris, France, January 1997.
[45] Michael D. Smith. The SUIF Machine Library. Division of of Engineering and Applied Science, Harvard University, March 1998.
[46] Gurindar S. Sohi, Scott E. Breach, and T. N. Vijaykumar. Multiscalar processors. In Proceedings of the 22nd annual international symposium on Computer architecture, pages 414{425, 1995.
[47] Gurindar S. Sohi, Scott E. Breach, and T. N. Vijaykumar. Multiscalar processors. In 25 Years ISCA: Retrospectives and Reprints, pages 521{532, 1998.
[48] Bjarne Steensgaard. Points-to analysis in almost linear time. In Conference Record of POPL '96: 23nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming
Languages, pages 32{41, St. Petersburg Beach, Florida, January 1996.
[49] J. Greggory SteRan, Christopher B. Colohan, Antonia Zhai, and Todd C. Mowry. A scalable approach to thread-level speculation. In The 27th Annual International
Symposium on Computer Architecture, pages 1{12, 2000.
[50] Bjarne Stroustrup. The C++ programming language. Addison-Wesley, 1991.
[51] The Stanford SUIF Compiler Group. The SUIF Library. Stanford University, 1995.
[52] Jenn-Yuan Tsai, Jian Huang, ChristoRer Amlo, David J. Lilja, and Pen-Chung Yew. The superthreaded processor architecture. IEEE Transactions on Computers, 48(9):881{902, 1999.
[53] Jenn-Yuan Tsai, Zhenzhen Jiang, and Pen-Chung Yew. Compiler techniques for the superthreaded architectures. International Journal of Parallel Programming, 27(1):1{
19, 1999.
[54] Tim A.Wagner, Vance Maverick, Susan L. Graham, and Michael A. Harrison. Accurate static estimators for program optimization. In Proceedings of the ACM SIGPLAN '94
conference on Programming language design and implementation, pages 85{96. ACM Press, 1994.
[55] Robert P. Wilson and Monica S. Lam. E±cient context-sensitive pointer analysis for c programs. In Proceedings of the conference on Programming language design and implementation, pages 1{12. ACM Press, 1995.
[56] Michael E. Wolf and Monica S. Lam. A data locality optimizing algorithm. In PLDI'91: Proceedings of the ACM SIGPLAN 1991 conference on Programming language design and implementation, pages 30{44, New York, NY, USA, 1991. ACM Press.
[57] Tilman Wolf and Mark Franklin. Commbench - a telecommunications benchmark for
network processors. In IEEE International Symposium on Performance Analysis of Systems and Software, Austin, TX, April 2000.
[58] Michael Wolfe. Optimizing for Supercompilers for Supercomputers. MIT Press, 1990.
[59] Michael Wolfe. High Performance Compilers for Parallel Computing. Addison-Wesley Longman Publishing Co., 1995.
[60] Michael E. Wolfe and Chau-Wen Tseng. The power test for data dependence. IEEE Transactions on Parallel and Distributed Systems, 3(5):591{601, 1992.
[61] Suan Hsi Yong, Susan Horwitz, and Thomas Reps. Pointer analysis for programs with structures and casting. SIGPLAN Notices, 34(5):91{103, May 1999. Proceedings of the ACM SIGPLAN '99 Conference on Programming Language Design and Implementation.
[62] Hans Zima and Barbara Chapman. Supercompilers for Parallel and Vector Computers. ACM Press, 1990.