Generating sequential code from parallel code
Jeanne Ferrante, Mary E. Mace, Barbara B. Simons · ACM International Conference on Supercomputing (ICS) · 1988
We consider the problem of generating sequential code for parallel programs written in a language which contains a FORALL operator, predicates and statements. This problem can arise when compiling for a multiprocessor where each processor is sequential, and in the vectorization of sequential programs. We present a necessary and sufficient condition for determining if extra guard variables or duplicate code must be inserted when generating a correct sequential program from a given, well-structured parallel program. We also have an efficient method for checking whether this condition occurs in the parallel program. This method gives rise to an algorithm for generating sequential code from parallel code which inserts guard variables (or duplicate code) only when determined by our necessary and sufficient condition. Given the choice to insert duplicate code, an exponential blow-up in size may result. We suggest some simple heuristics to limit such blow-up. We also show that in a restricted case, the minimal size sequential code can be efficiently generated. However, we show that a problem closely related to finding the minimal size sequential code (or equivalently, the minimum number of guards to be inserted) in NP-Complete. We conjecture that this problem in the general case is indeed NP-Complete.
Cited by 25 works. doi:10.1145/55364.55421 Open-access PDF
Authors
References
- Compilers: Principles, Techniques, and Tools
- Principles of Compiler Design
- The program dependence graph and its use in optimization
- Dependence graphs and compiler optimizations
- Principles of Compiler Design (Addison-Wesley series in computer science and information processing)
- A Fast and Usually Linear Algorithm for Global Flow Analysis
- Conversion of control dependence to data dependence
- Integrating noninterfering versions of programs
- Integrating non-intering versions of programs
- The program dependence graph and its use in optimization