Detecting Parallelism in C Programs with Recursive Darta Structures

In this paper we present techniques to detect three common patterns of parallelism in C programs that use recursive data structures. These patterns include, function calls that access disjoint sub-pieces of tree-like data structures, pointer-chasing loops that traverse list-like data structures, and array-based loops which operate on an array of pointers pointing to disjoint data structures. We design dependence tests using a family of three existing pointer analyses, namely points-to, connection and shape analyses, with special emphasis on shape analysis. To identify loop parallelism, we introduce special tests for detecting loop-carried dependences in the context of recursive data structures. We have implemented the tests in the framework of our McCAT C compiler, and we present some preliminary experimental results.

[1]  Guang R. Gao,et al.  Compiling C for the EARTH multithreaded architecture , 1996, Proceedings of the 1996 Conference on Parallel Architectures and Compilation Technique.

[2]  James R. Larus,et al.  Detecting conflicts between structure accesses , 1988, PLDI '88.

[3]  Laurie J. Hendren,et al.  Is it a tree, a DAG, or a cyclic graph? A shape analysis for heap-directed pointers in C , 1996, POPL '96.

[4]  Guang R. Gao,et al.  Heap analysis and optimizations for threaded programs , 1997, Proceedings 1997 International Conference on Parallel Architectures and Compilation Techniques.

[5]  Alexandru Nicolau,et al.  A general data dependence test for dynamic, pointer-based data structures , 1994, PLDI '94.

[6]  Laurie J. Hendren,et al.  Connection Analysis: A Practical Interprocedural Heap Analysis for C , 1996, International Journal of Parallel Programming.

[7]  Alexandru Nicolau,et al.  Parallelizing Programs with Recursive Data Structures , 1989, IEEE Trans. Parallel Distributed Syst..

[8]  Phil Pfeiffer,et al.  Dependence analysis for pointer variables , 1989, PLDI '89.

[9]  Laurie J. Hendren,et al.  Putting pointer analysis to work , 1998, POPL '98.

[10]  Vincent A. Guarna,et al.  A Technique for Analyzing Pointer and Structure References In Parallel Restructuring Compilers , 1988, ICPP.

[11]  Laurie J. Hendren,et al.  Context-sensitive interprocedural points-to analysis in the presence of function pointers , 1994, PLDI '94.