The FLINT Project

Research

People

Publications

Software

Support

Links

Internal

Unrolling Lists

Last modified: Tue Mar 14 19:31:54 2000 GMT.

Authors

Zhong Shao
John H. Reppy
Andrew Appel

Abstract

Lists are ubiquitous in functional programs, thus supporting lists efficiently is a major concern to compiler writers for functional languages. Lists are normally represented as linked cons cells, with each cons cell containing a car (the data) and a cdr (the link); this is inefficient in the use of space, because 50% of the storage is used for links. Loops and recursions on lists are slow on modern machines because of the long chains of control dependences (in checking for nil) and data dependences (in fetching cdr fields).

We present a data structure for ``unrolled lists,'' where each cell has several data items (car fields) and one link (cdr). This reduces the memory used for links, and it significantly shortens the length of control-dependence and data-dependence chains in operations on lists.

We further present an efficient compile-time analysis that transforms programs written for ``ordinary'' lists into programs on unrolled lists. The use of our new representation requires no change to existing programs.

We sketch the proof of soundness of our analysis---which is based on refinement types---and present some preliminary measurements of our technique.

Published

In Proc. 1994 ACM Conf. on Lisp and Functional Programming, Orlando, FL, page 185-195, June 1994. ©1994 ACM.

Text

Gzipped Postscript [161k]
PDF
BibTeX Entry

Copyright © 1996-2024 The FLINT Group <flint at cs dot yale dot edu>
Yale University Department of Computer Science
Validate this page
colophon