|
Abstract : |
Most conventional compilers fail to allocate array elements to registers because standard data- ow analysis treats arrays like scalars, making it impossible to analyze the denitions and uses of individual array elements. This deciency is particularly troublesome for oating-point registers, which are most often used as temporary repositories for subscripted variables. This paper presents a source-to-source transformation, called scalar replacement, that nds opportunities for reuse of subscripted variables and replaces the references involved by references to temporary scalar variables. The scalar replaced variables are more likely to be assigned to registers by the coloringbased register allocators found in most compilers than are their unreplaced counterparts. The algorithm presented here extends previous techniques for scalar replacement by allowing the presence of forward conditional control ow within loop bodies through the mapping of partial redundancy elimination to scalar replacement. Finally, experimental results show that scalar replacement is extremely eective. On kernels, integer-factor improvements over code generated by a good optimizing compiler of conventional design are possible., |