Minimizing register usage penalty at procedure calls

  • Authors:
  • F. C. Chow

  • Affiliations:
  • MIPS Computer Systems, Inc., Sunnyvale, CA

  • Venue:
  • PLDI '88 Proceedings of the ACM SIGPLAN 1988 conference on Programming Language design and Implementation
  • Year:
  • 1988

Quantified Score

Hi-index 0.00

Visualization

Abstract

Inter-procedural register allocation can minimize the register usage penalty at procedure calls by reducing the saving and restoring of registers at procedure boundaries. A one-pass inter-procedural register allocation scheme based on processing the procedures in a depth-first traversal of the call graph is presented. This scheme can be overlaid on top of intra-procedural register allocation via a simple extension to the priority-based coloring algorithm. Using two different usage conventions for the registers, the scheme can distribute register saves/restores throughout the call graph even in the presence of recursion, indirect calls or separate compilation. A natural and efficient way to pass parameters emerges from this scheme. A separate technique uses data flow analysis to optimize the placement of the save/restore code for registers within individual procedures. The techniques described have been implemented in a production compiler suite. Measurements of the effects of these techniques on a set of practical programs are presented and the results analysed.