Abstract
Modern compilers employ sophisticated instruction scheduling techniques to shorten the number of cycles taken to execute the instruction stream. In addition to correctness, the instruction scheduler must also ensure that hardware resources are not oversubscribed in any cycle. For a contemporary processor implementation with multiple pipelines and complex resource usage restrictions, this is not an easy task. The complexity involved in reasoning about such resource hazards is one of the primary factors that constrain the instruction scheduler from performing certain kinds of transformations that can result in improved schedules. We extend a technique for detecting pipeline resource hazards based on finite state automata, to support the efficient implementation of such transformations that are essential for aggressive instruction scheduling beyond basic blocks. Although similar code transformations can be supported by other schemes such as reservation tables, our scheme is superior in terms of space and time. A global instruction scheduler using these techniques was implemented in the KSR compiler.
Similar content being viewed by others
References
J. C. Dehnert, and R.A. Towl, Compiling for the Cydra-5,J. Supercomputing,7:181–227 (May 1993).
J. A. Fisher, Trace Scheduling: A Technique for Global Microcode Compaction,IEEE Trans. Computers,C-30(7):478–490 (July 1981).
P. G. Lowney, S. M. Freudenberger, T. J. Karzes, W. D. Lichtenstein, R. P. Nix, J. S. O’Donnel, and J. C. Ruttenberg, The Multiflow Trace Scheduling Compiler,J. Supercomputing,7:51–142 (1993).
A. E. Eichenberger, and E. S. Davidson, A Reduced Multipipeline Machine Description that Preserves Scheduling Constraints,ACM SIGPLAN Conf. Progr. Lang. Design and Implementation (PLDI), Philadelphia (May 1996).
J. C. Gyllenhaal, W. W. Hwu, and B. R. Rau, Optimization of Machine Descriptions for Efficient Use. In The 29th Annual IEEE/ACM International Symposium on Microarchitecture, Paris, December 1996.
E. S. Davidson, L. E. Shar, A. T. Thomas, and J. H. Patel, Effective Control for Pipelined Computers,Spring COMPCON-75 Digest of papers. IEEE Computer Society (February, 1975).
T. Muller, Employing Finite Automata for Resource Scheduling,26th Ann. Int. Symp. Microarchitecture, Austin (December 1993).
T. A. Proebsting, and C. W. Fraser, Detecting Pipeline Hazards Quickly,21st ACM SIGPLAN-SIGACT Symp. Principles of Progr. Lang. (January 1994).
J. E. Hopcroft, and J. D. Ullman,Introduction to Automata Theory, Languages and Computation, Addison-Wesley (1979).
J. Hartmanis and R. Stearns, “Partitions and the Substitution Property,”Algebraic Structure Theory of Sequential Machines Chapter 2, Prentice-Hall (1966).
R. Lo, S. Chan, F. Chow, and S.-M. Liu, Improving Resource Utilization of the MIPS R8000 via Post-Scheduling Global Instruction Distribution,27th Ann. Symp. Microarchitecture, San Jose. (December 1994).
P.-C. Wu, F.-J. Wang, and K.-R. Young, Scanning Regular Languages by Dual Finite Automata,ACM Sigplan Notices,27(4):12–16 (April 1992).
DecChip™ 21064 Microprocessor Hardware Reference Manual EC-N0079-72, Digital Equipment Corporation, Maynard, Massachusetts.
G. Kane, and J. Heinrich,MIPS RISC Architecture, Prentice Hall, 1992.
B. R. Rau, M. S. Schlansker, and P. P. Tirumalai, Code Generation Schemas for Modulo Scheduled Loops,25th Ann. Int. Symp. Microarchitecture (December 1992).
Author information
Authors and Affiliations
Additional information
This work was begun while the authors were at Kendall Square Research (KSR).
Rights and permissions
About this article
Cite this article
Bala, V., Rubin, N. Efficient instruction scheduling using finite state automata. Int J Parallel Prog 25, 53–82 (1997). https://doi.org/10.1007/BF02700047
Issue Date:
DOI: https://doi.org/10.1007/BF02700047