×

Register allocation by decomposing, re-connecting and coloring hierarchical program regions

  • US 5,418,958 A
  • Filed: 07/15/1992
  • Issued: 05/23/1995
  • Est. Priority Date: 07/15/1992
  • Status: Expired due to Term
First Claim
Patent Images

1. In a computer system comprising a CPU and a plurality of registers coupled to said CPU for executing a high Level language compiler and program routines compiled by said compiler, a method for said compiler to allocate registers for a program routine during code generation while compiling said program routine, said method comprising the steps of:

  • a) decomposing said program routine into regions, said regions comprising non-overlapping basic blocks of said program routine, said regions having three distinct types, a Subsume type, a Join type and a Merge type, said Subsume type regions being regions comprising inner and outer loops of said program routine, said Join type regions being regions comprising parts of conditional statements of said program routine, said Merge type regions being regions comprising a selected one of (i) parts of a basic block, and (ii) independent loops, of said program routine;

    b) constructing interference graphs of said regions individually, said interference graphs comprising nodes representing variables and edges connecting said nodes representing conflicts between said nodes, two nodes are connected by an edge if the two variables represented by nodes cannot simultaneously share a register at some point in the program routine;

    c) coloring the interference graphs of said regionsd) connecting said colored interference graphs of said regions, each pair of said interference graphs being connected at colored nodes that are live over region boundaries of said regions; and

    e) repeating steps (c) and (d) until a composite interference graph representing the entire routine is connected and coloredf) allocating registers to colored nodes of said composite interference graph.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×