Back to search

McGill University

Putting pointer analysis to work

Abstract

dc:description.abstract

Pointer analysis has recently been a subject of active research. The focus of most techniques is on: (1) estimating the targets for stack-directed pointers, (2) computing relationships between heap-directed pointers, or (3) developing faster or more space-efficient algorithms. However, little attention has been paid to actually using the results of pointer analysis for compiler optimizations. This thesis addresses the problem of how to apply pointer analysis information to a wide variety of compiler applications. That is, once the pointer relationships are computed, what can we do with this information? How do we put pointer analysis to work? We have used the pointer analyses implemented in the framework of the McCAT C compiler as the basis of our study. These analyses include, points-to analysis for stack-directed pointers, and connection and shape analyses for heap-directed pointers. We demonstrate that the fundamental problem is that one must be able to compare the memory locations read/written via pointer indirections, at different programs points, and one must also be able to summarize the effect of pointer references over regions in the program. It is straightforward to compute read/write sets for indirections involving stack-directed pointers using points-to information. However, for heap-directed pointers we show that one needs to introduce the notion of anchor handles into the connection analysis and then compute read/write sets to the heap with respect to these anchor handles. Based on the read/write sets we show how to extend traditional optimizations like common subexpression elimination and loop-invariant removal to include pointer references. In the same vein, we propose a novel optimization called location-invariant removal. We also demonstrate the use of our information on more advanced techniques such as array dependence testing and program understanding. We have implemented our techniques in the McCAT C compiler, and we demonstrate examples of applying our methods on a set of pointer-intensive C benchmarks, as well as present concrete empirical data on the improvements achieved. We also present techniques to use pointer analysis information for detecting parallelism in C programs with recursive data structures. In addition to the read/write sets, we use shape analysis information and data structure access paths for dependence testing. The dependence tests are specifically tailored for detecting three parallelism patterns that frequently arise in C programs. These patterns include, function calls that access disjoint sub-pieces of tree-like data structures, pointer-chasing loops that traverse list-Eke data structures, and array-based loops which operate on arrays of pointers pointing to disjoint data structures. To identify loop parallelism, we introduce special tests for identifying loop-carried dependences in the context of recursive data structures. We have implemented the tests in the framework of the McCAT C compiler, and present experimental results for a set of C benchmark programs to evaluate their effectiveness.

Degree

thesis:*
Name thesis:degree_name
Doctor of Philosophy
Grantor dc:publisher
McGill University
Year dc:date.issued
1998

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Ghiya, Rakesh
Advisor dc:contributor.advisor
  • Hendren, Laurie (Supervisor)

Subjects

dc:subject × 1

Rights

dc:rights
Statement dc:rights
  • All items in eScholarship@McGill are protected by copyright with all rights reserved unless otherwise indicated.
Language dc:language.iso
en

Identifiers

dc:identifier.*
OCLC
894575206
Dc Identifier Other
hyrax:6h440v389

Chain of custody

source
Harvested from
McGill University
Base URL
mcgill.scholaris.ca/server/oai/request
Last updated
2026-11-27
Source record
OAI-PMH GetRecord
related terms
citation

Ghiya, Rakesh. Putting pointer analysis to work. McGill University, 1998. https://doi.org/10.82308/38005