×

Method for optimizing computer code to provide more efficient execution on computers having cache memories

  • US 5,212,794 A
  • Filed: 06/01/1990
  • Issued: 05/18/1993
  • Est. Priority Date: 06/01/1990
  • Status: Expired due to Term
First Claim
Patent Images

1. A method for operating a digital computer, including a memory for the storage of computer instructions and data, to convert a first computer program to a second computer program, said first computer program comprising a set of basic blocks of computer code arranged in a first linear order and said second computer program comprising a second set of basic blocks in a second linear order, each basic block of said second set of basic blocks being derived from one of said basic blocks of said first set of basic blocks, said method comprising the steps of:

  • (a) determining the frequency with which each basic block of said first set of basic blocks transfers control to each other basic block of said first set of basic blocks when said first computer program is executed with test data;

    (b) providing an indicator for each pair of said basic blocks of said first set of basic blocks having a determined transfer frequency greater than zero, each said indicator having a first state and a second state, each said indicator being initialized to said first state;

    (c) determining which pair of basic blocks of said first set of basic blocks for which said indicator corresponding to said pair is in said first state has the largest transfer frequency and setting said indicator corresponding to said pair to said second state;

    (d) combining a pair of chains of said first set of basic blocks to form a new chain which replaces said pair of chains if a source basic block for said pair of chains is the tail of one of said chains and a target basic block is the head of the other of said chains, said source basic block and target basic block being said pair of basic blocks determined in step (c);

    (e) repeating steps (c) and (d) until all said indicators are in said second state; and

    (f) arranging said chains in a linear order to generate said second computer program.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×