Array contraction is an optimization that transforms array variables into scalar variables within a loop. While the opposite transformation, scalar expansion, is used for enabling parallelism (with a penalty in memory size), array contraction is used to save memory by removing temporary arrays and to increase locality. Several heuristics have already been proposed to perform array contraction through loop fusion and/or loop shifting. But so far, the complexity of the problem was unknown, and no exact approach was available. In this paper, we prove two NP-complete results that characterize precisely the problem and we give a practical integer linear programming formulation to solve the problem exactly.
Citation:
Alain Darte, Guillaume Huard, "New Results on Array Contraction," asap, pp.359, 13th IEEE International Conference on Application-Specific Systems, Architectures and Processors (ASAP'02), 2002