Fast greedy weighted fusion

  • Authors:
  • Ken Kennedy

  • Affiliations:
  • Center for High Performance Software, Rice University

  • Venue:
  • Proceedings of the 14th international conference on Supercomputing
  • Year:
  • 2000

Quantified Score

Hi-index 0.01

Visualization

Abstract

Loop fusion is important to optimizing compilers because it is an important tool in managing the memory hierarchy. By fusing loops that use the same data elements, we can reduce the 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 unreasonably 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 for this problem.