A new, simpler linear-time dominators algorithm

被引:28
作者
Buchsbaum, AL [1 ]
Kaplan, H [1 ]
Rogers, A [1 ]
Westbrook, JR [1 ]
机构
[1] AT&T Labs, Shannon Lab, Florham Park, NJ 07932 USA
来源
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS | 1998年 / 20卷 / 06期
关键词
compilers; dominators; flowgraphs; microtrees; path compression;
D O I
10.1145/295656.295663
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We present a new linear-time algorithm to find the immediate dominators of all vertices in a flowgraph. Our algorithm is simpler than previous linear-time algorithms: rather than employ complicated data structures, we combine the use of microtrees and memoization with new observations on a restricted class of path compressions. We have implemented our algorithm, and we report experimental results that-show that the constant factors are low. Compared to the standard, slightly superlinear algorithm of Lengauer and Tarjan, which has much less overhead, our algorithm runs 10-20% slower on real flowgraphs of reasonable size and only a few percent slower on very large flowgraphs.
引用
收藏
页码:1265 / 1296
页数:32
相关论文
共 29 条
[1]  
Aho Alfred V., 2007, COMPILERS PRINCIPLES
[2]  
ALSTRUP S, 1997, DOMINATORS LINEAR TI
[3]  
[Anonymous], P 7 SIAM C PAR PROC
[4]  
[Anonymous], FINITE STATE LANGUAG
[5]  
[Anonymous], THEORY PARSING TRANS
[6]  
Appel Andrew W, 2004, Modern Compiler Implementation in {C
[7]  
Buchsbaum A. L., 1998, Proceedings of the Thirtieth Annual ACM Symposium on Theory of Computing, P279, DOI 10.1145/276698.276764
[8]   DATA-STRUCTURAL BOOTSTRAPPING, LINEAR PATH COMPRESSION, AND CATENABLE HEAP-ORDERED DOUBLE-ENDED QUEUES [J].
BUCHSBAUM, AL ;
SUNDAR, R ;
TARJAN, RE .
SIAM JOURNAL ON COMPUTING, 1995, 24 (06) :1190-1206
[9]  
Cormen T.H., 1991, MIT ELECT ENG COMPUT
[10]   EFFICIENTLY COMPUTING STATIC SINGLE ASSIGNMENT FORM AND THE CONTROL DEPENDENCE GRAPH [J].
CYTRON, R ;
FERRANTE, J ;
ROSEN, BK ;
WEGMAN, MN ;
ZADECK, FK .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1991, 13 (04) :451-490