skip to main content
article
Free Access

Abstract description of pointer data structures: an approach for improving the analysis and optimization of imperative programs

Published:01 September 1992Publication History
Skip Abstract Section

Abstract

Even though impressive progress has been made in the area of optimizing and parallelizing array-based programs, the application of similar techniques to programs using pointer data structures has remained difficult. Unlike arrays which have a small number of well-defined properties, pointers can be used to implement a wide variety of structures which exhibit a much larger set of properties. The diversity of these structures implies that programs with pointer data structures cannot be effectively analyzed by traditional optimizing and parallelizing compilers.

In this paper we present a new approach that leads to the improved analysis and transformation of programs with recursively defined pointer data structures. Our approach is based on a mechanism for the Abstract Description of Data Structures (ADDS). ADDS is a simple extension to existing imperative languages that allows the programmer to explicitly describe the important properties of a large class of data structures. These abstract descriptions may be used by the compiler to achieve more accurate program analysis in the presence of pointers, which in turn enables and improves the application of numerous optimizing and parallelizing transformations. We present ADDS by describing various data structures; we discuss how such descriptions can be used to improve analysis and debugging; and we supply three important transformations enabled by ADDS.

References

  1. 1 AHO, A. V., SETHI, R., AND ULLMAN, J. D. Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading, Mass., 1987.]] Google ScholarGoogle Scholar
  2. 2 AIKEN, A., AND NICOLAU, A. Optimal loop para}lelization. In Proceedings of the SIGPLAN 1988 Conference on Programming Language Design and implementation (June 1988). ACM, New York, 308-317.]] Google ScholarGoogle Scholar
  3. 3 AIKEN, A., AND NICOLAU, A. Perfect pipelining: A new loop paralletization technique. In Proceedings of the 1988 European Symposium on Programming. Lecture Notes in Computer Science, vot. 300. Springer-Verlag, New York, 1988.]] Google ScholarGoogle Scholar
  4. 4 ALLEN, J. Dependence analysis for subscripted variables and its applications to program transformations. Ph.D. thesis, Rice Univ., Houston, Tex., 1983.]] Google ScholarGoogle Scholar
  5. 5 ALLEN, R., AND KENNEDY, K. Automatic translation of FORTRAN programs to vector form. ACM Trans. Programm. Lang. Syst. 9, 4 (Oct. 1987).]] Google ScholarGoogle Scholar
  6. 6 APPEL, A.W. All efficient program for many-body simulation. SIAM J. Sci. Stat. Comput. 6, 1 (1985), 85-103.]]Google ScholarGoogle Scholar
  7. 7 BAKER, H. Unify and conquer (garbage, updating, aliasing,...) in functional languages. In Proceedings of the '90 ACM Conference on LISP and Functwnal Programming (June 1990). ACM, New York.]] Google ScholarGoogle Scholar
  8. 8 BANERJEE, U. Dependence Analysis for Supercomputing. Kluwer, 1988.]] Google ScholarGoogle Scholar
  9. 9 BANERJEE, U. Speedup of ordinary programs. Ph.D. thesis, Dept. of Computer Science Rep. 79-989, Univ. of Illinois at Urbana-Champaign, Urbana, Ill., 1979.]] Google ScholarGoogle Scholar
  10. 10 BARNES, J., AND HUT, P. A hierarchical O(N log N) force-calculation algorithm. Nature 324 (Dec. 4, 1986), 446-449. Can be obtained from J. Barnes at the University of Hawaii.]]Google ScholarGoogle Scholar
  11. 11 BURKE, M., AND CYTRON, R. Interprocedural dependence analysis and parallelization. In Proceedings of the SIGPLAN '86 Symposzum on Compiler Construction. ACM SIGPLAN Not. 21, 7 (July 1986), 162-175.]] Google ScholarGoogle Scholar
  12. 12 CHASE, D. R., WEOMAN, M., AND ZADEK, F. K. Analysis of pointers and structures. In Proceedings of the SIGPLAN '90 Conference on Programming Language Design and Implementation (1990). ACM, New York, 296-310.]] Google ScholarGoogle Scholar
  13. 13 CONVEX COMPUTER CORPORATION. CONVEX C and FORTRAN Language Reference Manuals. Convex Computer Corp., 1990.]] Google ScholarGoogle Scholar
  14. 14 DEUTSCH, A. A storeless model of aliasing and its abstractions using finite representations of right-regular equivalence relations. In Proceedings of the IEEE '92 International Conference on Computer Languages (Apr. 1992). IEEE, New York.]]Google ScholarGoogle Scholar
  15. 15 DEUTSCH, A. On determining lifetime and aliasing of dynamically allocated data in higherorder functional specifications. In Proceedings of the ACM 17th Symposium on Principles of Programming Languages (1990). ACM, New York, 157-168.]] Google ScholarGoogle Scholar
  16. 16 DONGARRA, J. J., AND HINDS, A. R. Unrolling loops in FORTRAN. Softw.-Pract. Exper. 9 (1979), 219-226.]]Google ScholarGoogle Scholar
  17. 17 EBCIOGLU, K., AND NAKATANI, T. A new compilation technique for parallelizing loops with unpredictable branches on a VLIW architecture. In Proceedings of the 2nd Workshop on Programming Languages and Compilers for Parallel Computing. Research Monographs in Parallel and Distributed Computing. The MIT Press, Cambridge, Mass., 1989.]] Google ScholarGoogle Scholar
  18. 18 GAO, G. R., WONG, Y. B., AND NING, Q. A Petri-Net model for fine-grain loop scheduling. In Proceedings of the SIGPLAN 1991 Conference on Programming Language Design and implementation (June 1991). ACM, New York, 204-218.]] Google ScholarGoogle Scholar
  19. 19 GUARNA, V. A., JR., GANNON, D., GAUR, Y., AND JABLONOWSK!, D. Faust: An environment for programming parallel scientific applications. In Supercomputing '88 (1988).]] Google ScholarGoogle Scholar
  20. 20 HARRISON, W. a., III The interprocedural analysis and automatic parallelization of Scheme programs. Lisp Symb. Comput. 2, 3/4 (1989), 179-396.]]Google ScholarGoogle Scholar
  21. 21 HARRISON, W. L., III, AND AMMARGUELLAT, Z. A program's eye view of Miprac. in Proceedrags of the 5th Workshop on Languages and Compilers for Parallel Computing (Aug. 1992). Also Yale Tech. Rep. YALEU/DCS/RR-915, Yale Univ., New Haven, Conn.]] Google ScholarGoogle Scholar
  22. 22 HENDREN, L.J. Parallelizing programs with recursive data structures. Ph.D. thesis, Tech. Rep. TR 90-1114, Cornell Univ., Ithaca, N.Y., 1990.]] Google ScholarGoogle Scholar
  23. 23 HENDREN, L. J., AND GAO, G.R. Designing programming languages for analyzability: A fresh look at pointer data structures. In Proceedings of the 4th IEEE International Conference on Computer Languages (Apr. 1992). IEEE, New York.]]Google ScholarGoogle Scholar
  24. 24 HENDREN, L. J., AND NICOLAU, A. Parallelizing programs with recursive data structures. IEEE Trans. Parall. Distrib. Comput. 1, 1 (Jan. 1990), 35-47.]] Google ScholarGoogle Scholar
  25. 25 HENDREN, L. J., HUMMEL, J., AND NICOLAU, A. Abstractions for recursive pointer data structures: Improving the analysis and transformation of imperative programs. In Proceedings of the SIGPLAN '92 Conference on Programming Language Design and Implementation (June 1992). ACM, New York, 249-260.]] Google ScholarGoogle Scholar
  26. 26 HORWITZ, S., PFEIFFER, P., AND REPS, T. Dependence analysis for pointer variables. In Proceedings of the SIGPLAN '89 Conference on Programming Language Design and Implementation (June 1989). ACM, New York, 28-40.]] Google ScholarGoogle Scholar
  27. 27 HUELSBERGEN, L., AND LARUS, J. Dynamic program parallelization. In Proceedings of the '92 ACM Conference on LISP and Functional Programming (June 1992). ACM, New York, 311-323.]] Google ScholarGoogle Scholar
  28. 28 HUMMEL, J., HENDREN, L. J., AND NICOLAU, A. Applying an abstract data structure description approach to parallelizing scientific pointer programs. In Proceedings of the 21st Annual International Conference on Parallel Processing, Volume H (Aug. 1992). 100-104.]]Google ScholarGoogle Scholar
  29. 29 INOUE, K., SEKI, H., AND YAGI, H. Analysis of functional programs to detect run-time garbage cells. ACM Trans. Program. Lang. Syst. 10, 4 (Oct. 1988), 555-578.]] Google ScholarGoogle Scholar
  30. 30 JONES, N. D., AND MUCHNICK, S. S. Program Flow Analysis, Theory and Applications. rentice-Hall, Englewood Cliffs, N.J., 1981, 102-131.]] Google ScholarGoogle Scholar
  31. 31 I~NNEDY, K. Foreword. In Supercompilers for Parallel and Vector Computers, ACM Press, New York, 1990.]]Google ScholarGoogle Scholar
  32. 32 KLAPPHOLZ, D., KALLIS, A. D., AND gANG, X. Refined C: An update. In Languages and Compilers for Parallel Computing. The MIT Press, Cambridge, Mass., 1990. 331-357.]] Google ScholarGoogle Scholar
  33. 33 KUCK, D., BUDNIK, P., CHEN, S., LAWRIE, D., TOWLE, R., STREBENDT, R., DAVIS, E., HAN, J., KRASKA, P., AND MURAOKA, Y. Measurements of parallelism in ordinary FORTRAN programs. Computer 7, 1 (Jan. 1974), 37-46.]]Google ScholarGoogle Scholar
  34. 34 LAM, M. Software pipelining: An effective scheduling technique for VLIW machines. In Proceedings of the SIGPLAN 1988 Conference on Programming Language Design and Implementation (June 1988). ACM, New York, 318-328.]] Google ScholarGoogle Scholar
  35. 35 LANDI, W., AND RYDER, B. A safe approximation algorithm for interprocedural pointer aliasing. In Proceedings of the SIGPLAN '92 Conference on Programming Language Design and Implementation (June 1992). ACM, New York, 235-248.]] Google ScholarGoogle Scholar
  36. 36 LARUS, J.R. Restructuring symbolic programs for concurrent execution on multiprocessors. Ph.D. thesis, Univ. of California, Berkeley, 1989.]] Google ScholarGoogle Scholar
  37. 37 LARUS, J. R., AND HILFINGER, P. N. Detecting conflicts between structure accesses. In Proceedings of the SIGPLAN '88 Conference on Programming Language Design and Implementation (June 1988). ACM, New York, 21-34.]] Google ScholarGoogle Scholar
  38. 38 LUCASSEN, J. M., AND GIFFORD, D.K. Polymorphic effect systems. In Proceedings of the 15th ACM Symposium on Principles of Programming Languages (1988). ACM, New York, 47-57.]] Google ScholarGoogle Scholar
  39. 39 PADUA, D. A., AND WOLFE, M. J. Advanced compiler optimization for supercomputers. Commun. ACM 29, 12 (Dec. 1986).]] Google ScholarGoogle Scholar
  40. 40 PUGH, W. Skip lists: A probabilistic alternative to balanced trees. Commun. ACM 33, 6 (June 1990), 668-676.]] Google ScholarGoogle Scholar
  41. 41 RAU, B. R., AND GLAESER, C. D. Efficient code generation for horizontal architectures: Compiler techniques and architectural support. In Proceedings of the 9th Symposium on Computer Architecture (Apr. 1982).]] Google ScholarGoogle Scholar
  42. 42 RUGGIERI, C., AND MURTAGH, T. P. Lifetime analysis of dynamically allocated objects. In Proceedings of the 15th ACM Symposium on Principles of Programming Languages (1988). ACM, New York, 285-293.]] Google ScholarGoogle Scholar
  43. 43 SAMET, H. The Design and Analysis of Spatial Data Structures. Addison-Wesley, Reading, Mass., 1990.]] Google ScholarGoogle Scholar
  44. 44 S~TODGRASS, R. The Interface Description Language: Definition and Use. Computer Science Press, 1989.]] Google ScholarGoogle Scholar
  45. 45 SOLWORTH, J.A. The PARSEQ project: An interim report. In Languages and Compilers for Parallel Computing, The MIT Press, Cambridge, Mass., 1990, 490-510.]] Google ScholarGoogle Scholar
  46. 46 WANG, E., AND HILFINGER, P. Analysis of recursive types in LISP-like languages. In Proceedings of the '92 ACM Conference on LISP and Functional Programming (June 1992). ACM, New York, 216-225.]] Google ScholarGoogle Scholar
  47. 47 WOLFE, M.J. Optimizing supercompilers for supercomputers. Ph.D. thesis, Univ. of Illinois at Urbana-Champaign, Urbana, Ill., 1982.]] Google ScholarGoogle Scholar
  48. 48 ZIMA, g., AND CHAPMAN, B. Supercompilers for Parallel and Vector Computers. ACM Press, New York, 1990.]] Google ScholarGoogle Scholar
  49. 49 ZIMA, H., BAST, H-J., AND GERNDT, M. Superb: A tool for semi-automatic MIMD/SIMD parallelization. Parall. Comput. 6 (1988), 1-18.]]Google ScholarGoogle Scholar

Index Terms

  1. Abstract description of pointer data structures: an approach for improving the analysis and optimization of imperative programs

              Recommendations

              Reviews

              Benjamin Rayborn Seyfarth

              The authors discuss the inherent difficulties in optimizing programs with pointer data structures and present a mechanism for augmenting the syntax for pointer variable declarations with useful descriptive information. The primary problem addressed is pointer aliasing: it is difficult or impossible for a compiler to determine whether two pointer variables might point to the same address. The underlying data structure might be a circularly linked list or an arbitrary graph in which more than one pointer might point to any node. Knowledge of pointer aliasing is critical to correct optimization. The authors propose that the “intent” of a pointer be specified when declaring a pointer variable. For instance, a pointer for a one-way linked list might be declared as “uniquely forward along X,” to indicate that the list would have no cycles and that each node has a unique pointer. The X part of the declaration is a “dimension” that can be used to help organize more complex structures, such as binary trees with some pointers going down the tree and some going up. This paper presents a useful concept for consideration during language design. The added description of pointer variables would help make a program more readable and could be critical for correct optimization. Anyone interested in language design and compiler optimization will be interested in this paper.

              Access critical reviews of Computing literature here

              Become a reviewer for Computing Reviews.

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              • Published in

                cover image ACM Letters on Programming Languages and Systems
                ACM Letters on Programming Languages and Systems  Volume 1, Issue 3
                Sept. 1992
                104 pages
                ISSN:1057-4514
                EISSN:1557-7384
                DOI:10.1145/151640
                Issue’s Table of Contents

                Copyright © 1992 ACM

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 1 September 1992
                Published in loplas Volume 1, Issue 3

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • article

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!