Functional unit switching for the allocation of registers
First Claim
1. In a computer system, a method of minimizing registers spills when allocating a first set of registers to be used during the execution of a set of computer instructions, wherein the first set of registers is associated with a first functional unit, the method comprising the steps of:
- detecting whether a first subset of computer instructions from said set of computer instructions may be executed by a second functional unit, said first subset of computer instructions specifying the use of one or more registers from said first set of registers; and
if detecting that said first subset of computer instructions may be executed by said second functional unit, then performing the steps of;
generating a second subset of computer instructions, wherein said second subset of computer instructions specifies the use of a second subset of registers associated with said second functional unit, andreplacing said first subset of computer instructions with said second subset of computer instructions.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus for allocating registers when compiling code is provided. In response to determining there are insufficient registers associated with a first functional unit of a processor to allocate to a region of code, instructions associated with the region designated for execution on a first functional of processor that may be executed by second functional unit are detected. Those instructions generated for execution on the first functional unit are replaced with the instructions executed on the second functional unit.
33 Citations
20 Claims
-
1. In a computer system, a method of minimizing registers spills when allocating a first set of registers to be used during the execution of a set of computer instructions, wherein the first set of registers is associated with a first functional unit, the method comprising the steps of:
-
detecting whether a first subset of computer instructions from said set of computer instructions may be executed by a second functional unit, said first subset of computer instructions specifying the use of one or more registers from said first set of registers; and if detecting that said first subset of computer instructions may be executed by said second functional unit, then performing the steps of; generating a second subset of computer instructions, wherein said second subset of computer instructions specifies the use of a second subset of registers associated with said second functional unit, and replacing said first subset of computer instructions with said second subset of computer instructions. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer program embodied in a computer-readable medium for minimizing register spills when allocating a first set of registers associated with a first functional unit to be used during the execution of a set of computer instructions, said computer program comprising:
-
a first code segment for detecting whether a first subset of computer instructions may be executed by a second functional unit, said first subset of computer instructions specifying the use of one or more registers from said first set of registers; and a second code segment for generating a second subset of computer instructions when detecting that said first subset of computer instructions may be executed by said second functional unit, wherein said second subset of computer instructions specifies the use of a second subset of registers associated with said second functional unit. a third code segment for replacing said first subset of computer instructions with said second subset of computer instructions in response to generating said second subset of computer instructions. - View Dependent Claims (9, 10, 11, 12)
-
-
13. A computer system comprising:
-
a memory; a processor coupled to said memory; a compiler stored in said memory for execution by said processor; said compiler adapted to allocate a first set of registers to be used during the execution of a set of computer instructions, wherein said first set of registers is associated with a first functional unit; said compiler adapted to detect whether a first subset of computer instructions may be executed by a second functional unit, said first subset of computer instructions specifying the use of one or more registers from said first set of registers; and said compiler adapted to respond to detecting that said first subset of computer instructions may be executed by said second functional unit, by; generating a second subset of computer instructions, wherein said second subset of computer instructions specified the use of one or more registers from a second subset of registers associated with said second functional unit, and replacing said first subset of computer instructions with said second subset of computer instructions. - View Dependent Claims (14, 15, 16)
-
-
17. A computer data signal embodied in a carrier wave and representing a computer program for minimizing register spills when allocating a first set of registers associated with a first functional unit to be used during the execution of a set of computer instructions, said computer program comprising:
-
a first code segment for detecting whether a first subset of computer instructions may be executed by a second functional unit, said first subset of computer instructions specifying the use of one or more registers from said first set of registers; and a second code segment for generating a second subset of computer instructions when detecting that said first subset of computer instructions may be executed by said second functional unit, wherein said second subset of computer instructions specifies the use of a second subset of registers associated with said second functional unit; a third code segment for replacing said first subset of computer instructions with said second subset of computer instructions in response to generating said second subset of computer instructions. - View Dependent Claims (18, 19, 20)
-
Specification