Polyhedral Transformations of Explicitly Parallel Programs
Prasanth Chatarasi, Jun Shirako, Vivek Sarkar · 2015
The polyhedral model is a powerful algebraic framework that has enabled significant advances to analyses and transformations of sequential affine (sub)programs, relative to traditional AST-based approaches. However, given the rapid growth of parallel software, there is a need for increased experiences with using polyhedral frameworks for analysis and transformations of explicitly parallel programs. An interesting side effect of supporting explicitly parallel programs is that doing so can also enable analysis and transformation of programs with unanalyzable data accesses within a polyhedral framework, since explicit parallelism can often mitigate the imprecision that accompanies unanalyzable data accesses arising from a variety of sources, including unrestricted pointer aliasing, unknown function calls, and certain classes of non-affine constructs. In this paper, we address the problem of extending polyhedral frameworks to enable analysis and transformation of programs that contain both explicit parallelism and unanalyzable data accesses. A summary of our approach is as follows. As in past work, we first enable conservative dependence analysis of a given region of code; for simplicity, we use an approach based on dummy variables that can work with any polyhedral tool that supports access functions. After obtaining conservative dependences, we use the Fourier-Motzkin elimination method to remove all dummy variables. Next, we identify happens-before relations from the explicitly parallel constructs, and subtract their complement from the conservative dependences. The resulting set of dependences can then be passed on to a polyhedral transformation tool, such as PLuTo, to enable transformation of explicitly-parallel programs with unanalyzable data accesses. To motivate our approach, we studied 18 explicitly-parallel OpenMP benchmarks from the Rodinia benchmark suite, and found that these benchmarks use six classes of non-affine constructs that are commonly found in parallel scientific applications:1) Non-affine subscript expressions, 2) Indirect array subscripts, 3) Use of structs, 4) Calls to user-defined functions, 5) Non-affine loop bounds, and 6) Non-affineif