Partial redundancy elimination with a fixed number of temporaries
First Claim
1. A method comprising:
- in a single pass through a program code divided into a plurality of basic blocks, identifying, by one or more processors, for each basic block, a set of local data values that includes;
a temporary memory location identifier, a register identifier of a set of registers, and a basic block identifier of the basic block;
for each basic block of the set of basic blocks, determining, by one or more processors, global register status values for the registers identified in the basic block, wherein the global register status values indicate whether a register is available, partially available, anticipatable, or partially anticipatable, and wherein the global register status values are determined based on machine operations on the identified registers across the plurality of basic blocks;
removing, by one or more processors, based on the determined global register status values meeting a first set of requirements, a first load of the temporary memory location into a second register, from a first basic block out of the plurality of basic blocks;
on a first edge from a second basic block out of the plurality of basic blocks to the first basic block, adding, by one or more processors, based on the determined global register status values meeting a second set of requirements, a second load of the temporary memory location into the second register; and
on a second edge from the first basic block to the second basic block, performing, by one or more processors, based on the determined global register status values meeting a third set of requirements, a register move, wherein the first register is moved into the second register.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for partial redundancy elimination with a fixed number of temporaries includes determining local data values of program code that describe a temporary memory location, a set of registers, and a set of basic blocks. The method determines global data values of the program code based on the determined local data values of the program code. The method removes a first load of the temporary memory location in a first basic block in the program code. The method adds a second load on a first edge from a second basic block out of the set of basic blocks to a third basic block out of the set of basic blocks in the program code. The method performs a register move on a second edge from the third basic block to the second basic block in the program code.
-
Citations
7 Claims
-
1. A method comprising:
-
in a single pass through a program code divided into a plurality of basic blocks, identifying, by one or more processors, for each basic block, a set of local data values that includes;
a temporary memory location identifier, a register identifier of a set of registers, and a basic block identifier of the basic block;for each basic block of the set of basic blocks, determining, by one or more processors, global register status values for the registers identified in the basic block, wherein the global register status values indicate whether a register is available, partially available, anticipatable, or partially anticipatable, and wherein the global register status values are determined based on machine operations on the identified registers across the plurality of basic blocks; removing, by one or more processors, based on the determined global register status values meeting a first set of requirements, a first load of the temporary memory location into a second register, from a first basic block out of the plurality of basic blocks; on a first edge from a second basic block out of the plurality of basic blocks to the first basic block, adding, by one or more processors, based on the determined global register status values meeting a second set of requirements, a second load of the temporary memory location into the second register; and on a second edge from the first basic block to the second basic block, performing, by one or more processors, based on the determined global register status values meeting a third set of requirements, a register move, wherein the first register is moved into the second register. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
Specification