Patent ID: 7747992

Claim:
A method comprising: identifying branch data associated with a plurality of machine accessible instructions; identifying a plurality of basic blocks associated with the branch data; searching for a set of edges comprising a subset of the plurality of basic blocks, wherein each edge in the set of edges obtained by searching shares either a source basic block or a destination basic block with another edge in the set of edges; generating a set of partial layouts from the subset of the plurality of basic blocks included in the set of edges; generating a substantial layout using a particular partial layout selected from the set of partial layouts based on a cost metric comprising an accumulation of individual costs determined for each pair of adjacent basic blocks in a particular sequential ordering of the plurality of basic blocks included in the particular partial layout, wherein the individual cost for each pair of adjacent basic blocks is determined using a first cost metric when the pair of adjacent basic blocks is connected in the particular partial layout and a second cost metric when the pair of adjacent basic blocks is not connected in the particular partial layout; and determining a plurality of modified machine accessible instructions based on the substantial layout.