Fast greedy weighted fusion

Authors
Citation
K. Kennedy, Fast greedy weighted fusion, INT J P PRO, 29(5), 2001, pp. 463-491
Citations number
19
Categorie Soggetti
Computer Science & Engineering
Journal title
INTERNATIONAL JOURNAL OF PARALLEL PROGRAMMING
ISSN journal
08857458 → ACNP
Volume
29
Issue
5
Year of publication
2001
Pages
463 - 491
Database
ISI
SICI code
0885-7458(200110)29:5<463:FGWF>2.0.ZU;2-1
Abstract
Loop fusion is an important compiler strategy for managing memory hierarchy . By fusing loops that use the same data elements, a compiler can reduce th e distance between accesses to the same datum and avoid costly cache misses . Unfortunately the problem of optimal loop fusion for reuse has been shown to be NP-hard, so compilers must resort to heuristics to avoid unreasonabl y long compile times. Greedy strategies are often excellent heuristics that produce high-quality solutions quickly. We present an algorithm for greedy weighted fusion, in which the heaviest edge (the one with the most reuse) is selected for possible fusion on each step. The algorithm is shown to be fast in the sense that it takes O(V(E+V)) time, which is arguably optimal f or producing the greedy solution. In addition, this algorithm has the advan tage that it requires only O(E) edge reweighting operations after fusions. This means that it is suitable for use on the problem of enhancing cache re use, for which the ideal reweighting operation is much more complex than ad dition. If each reweighting operation requires no more than O(V) time, the time bound of the overall fusion process remains at O(V(E+V)).