Performance of generic array programs crucially relies on program specialization wrt. shape information. Traditionally, this is done in a rather adhoc fashion by propagating all shape information that is available. When striving for a compositional programming style that adheres good software engeneering principles this approach turns out to be insufficient. Static value information needs to be propagated as well which introduces all the well known problems of partial evaluation in general. In this paper, we propose a static analysis that identifies to what extent specialization needs to be employed in order to achieve a certain level of shape information. This narrows the scope of specialization far enough to make specialization for shape information feasible despite a compositional programming style. Some examples to this effect are presented.
Clemens Grelck, Sven-Bodo Scholz, Alexander V. Sha