Abstract. 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 prehminary experimental results.
I n t r o d u c t i o n a n d M o t i v a t i o nThis paper focuses on detecting three common patterns for parallel computations that use recursive data structures: (1) function-call parallelism including parallel recursive calls on tree-like structures; (2) forall parallelism for loops traversing arrays of list/tree-like structures; and (3) foreach parallelism for loops traversing list/tree-like structures, which is similar to doacross parallelism.In order to safely detect these patterns of parallelism in C programs, one must deal with dependences due to scalars, dependences due to pointers to stackallocated objects (stack-directed pointers), and dependences due to pointers to heap-allocated objects (heap-directed pointers). Thus, our approach uses the results of the family of pointer analyses that have been implemented in the McCAT optimizing/parallelizing C compiler: points-to analysis [l], connection analysis [2] and shape analysis [3]. Points-to analysis is used to detect dependences due to scalars and stack-directed pointers, while connection and shape analysis are used to detect dependences due to heap-directed pointers.The main focus of this paper is not the pointer analyses themselves, but rather how we can use the results of the analyses to detect parallelism. The remainder of the paper is structured as follows. In Section 2 we introduce the three parallelism patterns in more detail. In Section 3 we describe the overall setting of our approach, and present the rules to detect function call parallelism. * This research supported in part by NSERC and FCAR.