Compiler and register allocation method
First Claim
1. A computer-readable medium embodying a computer-executable compiler, which converts into a machine language the source code of a program written in a programming language and optimizes said program, comprising:
- a directed acyclic graph DAG analysis unit for constructing and analyzing a DAG for an instruction in a program to be processed;
an interference graph construction unit for employing the analysis results obtained by said DAG analysis unit to construct an interference graph representing the probability that an interference will occur between variables used by said instruction, wherein said interference graph construction unit determines a phase arrangement order for nodes of said DAG, so that said execution interval for said program is minimized, and when the intervals are overlapped where the variables among said instructions in said phase arrangement order are present, said interference between said variables is reflected in said interference graph; and
a graph identifier for allocating registers for said instruction using said interference graph that is constructed by said interference graph construction unit,wherein, when the overall time for executing said program is extended unless predetermined multiple instructions are executed in parallel, said interference graph construction unit assumes that an interference has occurred among variables used by said multiple instructions, and constructs said interference graph.
1 Assignment
0 Petitions
Accused Products
Abstract
A computer, computer compiler and method for reducing the number of interferences between variables during graph coloring while maintaining the possibility that the instructions will be executed in parallel. A compiler, which converts into a machine language the source code of a program written in a programming language and optimizes the program includes: a directed acyclic graph DAG analysis unit 11 for constructing and analyzing a DAG for an instruction in a program to be processed; an interference graph construction unit 12 for employing the analysis results to construct an interference graph representing the probability that an interference will occur between variables used by the instructions; and a graph coloring unit 13 for allocating registers for the instruction based on the interference graph that is constructed.
12 Citations
13 Claims
-
1. A computer-readable medium embodying a computer-executable compiler, which converts into a machine language the source code of a program written in a programming language and optimizes said program, comprising:
-
a directed acyclic graph DAG analysis unit for constructing and analyzing a DAG for an instruction in a program to be processed; an interference graph construction unit for employing the analysis results obtained by said DAG analysis unit to construct an interference graph representing the probability that an interference will occur between variables used by said instruction, wherein said interference graph construction unit determines a phase arrangement order for nodes of said DAG, so that said execution interval for said program is minimized, and when the intervals are overlapped where the variables among said instructions in said phase arrangement order are present, said interference between said variables is reflected in said interference graph; and a graph identifier for allocating registers for said instruction using said interference graph that is constructed by said interference graph construction unit, wherein, when the overall time for executing said program is extended unless predetermined multiple instructions are executed in parallel, said interference graph construction unit assumes that an interference has occurred among variables used by said multiple instructions, and constructs said interference graph. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer that includes a compiler, for compiling source code for an input program, comprising:
-
a directed acyclic graph DAG analysis unit, for constructing and analyzing a DAG for an instruction extracted from said program; an interference graph construction unit, for employing the analysis results obtained by said DAG analysis unit to construct, with the condition that the overall execution time of said program will not be extended, an interference graph that is required to ensure the parallel execution of said program and that represents interferences between variables used by instructions in said program, wherein said interference graph construction unit determines a phase arrangement order for nodes of said DAG, so that said execution interval for said program is minimized, and when the intervals are overlapped where the variables among said instructions in said phase arrangement order are present, said interference between said variables is reflected in said interference graph; and a register allocation unit for allocating registers to said instruction using said interference graph that is prepared by said interference graph construction unit. - View Dependent Claims (7)
-
-
8. A register allocation method, which for the performance of optimization to improve programming efficiency employs graph coloring to allocate registers to instructions in a program, comprising the steps of:
-
constructing and analyzing a directed acyclic graph DAG for each of said instructions based on said program; employing as a reference the longest non-parallel instruction queue in said DAG, and constructing an interference graph that assumes that an interference has occurred among variables used by said multiple instructions, based on the DAG analysis results, when said instruction queue is extended, unless predetermined multiple instructions are executed in parallel, wherein said constructing determines a phase arrangement order for nodes of said DAG, so that said execution interval for said program is minimized, and when the intervals are overlapped where the variables among said instructions in said phase arrangement order are present, said interference between said variables is reflected in said interference graph; and allocating registers for said instructions using said obtained interference graph. - View Dependent Claims (9, 10, 11, 12)
-
-
13. A program transmission apparatus comprising:
-
storage means for storing a program for permitting a computer to perform a process for constructing and analyzing a directed acyclic graph DAG for each of said instructions based on said program, a process for employing as a reference the longest non-parallel instruction queue in said DAG, and constructing an interference graph that assumes that an interference has occurred among variables used by said multiple instructions, based on the DAG analysis results, when said instruction queue is extended, unless predetermined multiple instructions are executed in parallel, wherein said interference graph constructing determines a phase arrangement order for nodes of said DAG, so that said execution interval for said program is minimized, and when the intervals are overlapped where the variables among said instructions in said phase arrangement order are present, said interference between said variables is reflected in said interference graph, and a process for allocating registers for said instructions using said obtained interference graph; and transmission means for reading said program from said storage means and transmitting said program.
-
Specification