IP Library Granted Patent US 7,086,045
Granted Patent B2
US 7,086,045 · App. 10/037,901 · Granted Aug 1, 2006

Heuristic to improve register allocation using pass degree

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,086,045
App. No.
10/037,901
Granted
Aug 1, 2006
Kind
B2
Abstract

A method includes adding direction to interference edges of a register interference graph and choosing a node of the register interference graph to spill based upon a pass degree of the node. By using the pass degree, the node that caused the greatest interference with allocation of the variables to the physical registers is preferentially chosen to be spilled.

Claims (61)

1. A method comprising:

adding direction to interference edges of a register interference graph, wherein each interference edge extends between two nodes of said register interference graph, said adding direction comprising:

for each node of each interference edge, determining whether a variable associated with said node was live when an other variable associated with the other node of said two nodes was defined or used;

wherein upon a determination that said variable associated with said node was live when said other variable associated with said other node was defined or used, said first node is a primary node; and

defining an interference edge adjacent a primary node as a pass edge;

defining a pass degree of each node as the number of pass edges of said node; and

choosing a node of said register interference graph to spill based upon said pass degree of said node.

2. The method of claim 1 further comprising building said register interference graph.

3. The method of claim 1 wherein said register interference graph comprises:

a first node;

a second node; and

an interference edge between said first node and said second node, said first node being a primary node.

4. The method of claim 3 wherein said second node is a secondary node.

5. The method of claim 4 wherein said interference edge consists of a uni-directional interference edge.

6. The method of claim 4 wherein an end of said interference edge adjacent said first node comprises a pass edge and wherein an end of said interference edge adjacent said second node comprises a non-pass edge.

7. The method of claim 3 wherein said second node is a primary node.

8. The method of claim 7 wherein said interference edge consists of a bi-directional interference edge.

9. The method of claim 7 wherein an end of said interference edge adjacent said first node comprises a pass edge and wherein an end of said interference edge adjacent said second node comprises a pass edge.

10. The method of claim 3 wherein a first variable associated with said first node is live when a second variable associated with said second node is defined or used.

11. A method comprising:

building a register interference graph comprising defining an interference edge between a first node and a second node;

wherein upon a determination that a first variable associated with said first node is live when a second variable associate with said second node is defined or used, said first node is a primary node;

defining an end of said interference edge adjacent said first node as a pass edge;

defining a pass degree of said first node as a number of pass edges of said first node; and

using said pass degree when choosing to spill a node from said register interference graph.

12. A system comprising:

a processor; and

a memory having a method of allocating a set of variables to a set of physical registers using selective spilling stored therein, wherein upon execution of said method, said method comprises:

building a register interference graph comprising defining an interference edge between a first node and a second node;

wherein upon a determination that a first variable associated with said first node is live when a second variable associate with said second node is defined or used, said first node is a primary node;

defining an end of said interference edge adjacent said first node as a pass edge;

defining a pass degree of said first node as a number of pass edges of said first node; and

using said pass degree when choosing to spill a node from said register interference graph.

13. A computer program product having a method of allocating a set of variables to a set of physical registers using selective spilling stored therein, wherein upon execution of said method, said method comprises:

adding direction to interference edges of a register interference graph, wherein each interference edge extends between two nodes of said register interference graph, said adding direction comprising:

for each node of each interference edge, determining whether a variable associated with said node was live when an other variable associated with the other node of said two nodes was defined or used;

wherein upon a determination that said variable associated with said node was live when said other variable associated with said other node was defined or used, said first node is a primary node; and

defining an interference edge adjacent a primary node as a pass edge;

defining a pass degree of each node as the number of pass edges of said node; and

choosing a node of said register interference graph to spill based upon said pass degree of said node.

14. The computer program product of claim 13 wherein said method further comprises building said register interference graph.

15. The computer program product of claim 13 wherein said register interference graph comprises:

a first node;

a second node; and

an interference edge between said first node and said second node, said first node being a primary node.

16. The computer program product of claim 15 wherein said second node is a secondary node.

17. The computer program product of claim 16 wherein said interference edge consists of a uni-directional interference edge.

18. The computer program product of claim 16 wherein an end of said interference edge adjacent said first node comprises a pass edge and wherein an end of said interference edge adjacent said second node comprises a non-pass edge.

19. The computer program product of claim 15 wherein said second node is a primary node.

20. The computer program product of claim 19 wherein said interference edge consists of a bi-directional interference edge.

21. The computer program product of claim 19 wherein an end of said interference edge adjacent said first node comprises a pass edge and wherein an end of said interference edge adjacent said second node comprises a pass edge.

22. The computer program product of claim 15 wherein a first variable associated with said first node is live when a second variable associated with said second node is defined or used.

23. A computer system comprising:

means for adding direction to interference edges of a register interference graph, wherein each interference edge extends between two nodes of said register interference graph, said means for adding direction comprising:

for each node of each interference edge, a means for determining whether a variable associated with said node was live when an other variable associated with the other node of said two nodes was defined or used;

wherein upon a determination that said variable associated with said node was live when said other variable associated with said other node was defined or used, said first node is a primary node; and

a means for defining an interference edge adjacent a primary node as a pass edge;

a means for defining a pass degree of each node as the number of pass edges of said node; and

means for choosing a node of said register interference graph to spill based upon said pass degree of said node.

24. The computer system of claim 23 further comprising means for building said register interference graph.

25. The computer system of claim 23 further comprising means for spilling said node.

Assignments (1)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037302/0579 →