sjc@key.COM (Steve Correll) (10/24/90)
In article <1990Oct11.223224.26604@rice.edu>, preston@titan.rice.edu (Preston Briggs) writes: > In article <AGLEW.90Oct11144920@dwarfs.crhc.uiuc.edu> aglew@crhc.uiuc.edu (Andy Glew) writes: > >Heterogenous register file > > Few compilers have been developed that can take advantage of a > > truly heterogenous register file, one in which, for example, the > > divide unit writes to registers D1..D2, the add unit writes to > > registers A1..A16, the shift unit writes to registers S1..S4 -- > > even though such hardware conceivably has a cycle time advantage > > over homogenous registers, even on VLIW machines where data can > > easily be moved to generic registers when necessary. > > DIFFICULTY: hard. > At first glance, the problem seems susceptable to coloring. > Perhaps I'm missing something. Besides making the coloring algorithm more complicated (and slower), a heterogeneous register file may play havoc with a compiler's phase structure. Given a typical modern compiler with separate phases for machine-independent optimization, register allocation, and machine-dependent instruction selection, heterogeny means that one phase often wants to know what later phases are going to do. A classic example (even with a _homogeneous_ register file) is common subexpression elimination: if it's performed as a machine-independent optimization prior to instruction selection, the optimizer must take it on faith that it will not, by increasing the lifetime of a value in a register, force a spill to memory which more than offsets the savings. The more you partition the register file into groups of special-purpose registers, the more often you will find yourself wishing that the machine- independent global optimizer could know in advance the register allocation which will happen later on. Consider a design which gives the divider, shifter, and subtracter different destination registers: whether strength reduction is beneficial in a particular expression may depend on which set of registers will be used up during allocation. This is not to say that compilers haven't been made to deal with certain kinds of heterogeny successfully. -- sjc@key.com or ...{sun,pyramid}!pacbell!key!sjc Steve Correll