Kennedy, KenMcKinley, Kathryn S.2017-08-022017-08-021994-01-01Kennedy, Ken and McKinley, Kathryn S.. "Typed Fusion with Applications to Parallel and Sequential Code Generation." (1994) https://hdl.handle.net/1911/96439.https://hdl.handle.net/1911/96439Loop fusion is a program transformation that merges multiple loops into one and is an effective optimization both for increasing the granularity of parallel loops and for improving data locality. This paper introduces typed fusion, a formulation of loop fusion which captures the fusion and distribution problems encountered in sequential and parallel program optimization. Typed fusion is more general and applicable than previous work. We present a fast algorithm for a typed fusion on a graph G = (N; E), where nodes represent loops, edges represent dependence constraints between loops and each loop is assigned one of T distinct types. Only nodes of the same type may fuse. Only nodes of the same type may be fused. The asymptotic time bound for this algorithm is O((N + E)T). The fastest previous algorithm considered only one or two types, but was still O(NE) [KM93]. When T > 2 and there is no reason to prefer fusing one type over another, we prove the problem of finding a fusion with the fewest resultant loops to be NP-hard. Using typed fusion, we present fusion and distribution algorithms that improve data locality and a parallel code generation algorithm that incorporates compound transformations. We also give evidence of the effectiveness of this algorithm in practice.16 ppengYou are granted permission for the noncommercial reproduction, distribution, display, and performance of this technical report in any format, but this permission is only for a period of forty-five (45) days from the most recent time that you verified that this technical report is still available from the Computer Science Department of Rice University under terms that include this permission. All other rights are reserved by the author(s).Typed Fusion with Applications to Parallel and Sequential Code GenerationTechnical reportTR94-221