Fast runtime scheme for removing dead code across linked fragments
First Claim
Patent Images
1. A method for removing dead code in code fragments of a program, comprising:
- processing a first code fragment and storing first information generated during this processing indicative of whether an instruction for assigning a register in a first code fragment is possibly live;
processing a second code fragment and storing second information generated during this processing indicative of register usage;
at a time when the first and second code fragments are to be linked, determining, by use of the first and second stored information, if an instruction in the first code fragment that assigns a register is a dead instruction; and
responsive to determination that an instruction is a dead instruction, eliminating the dead instruction.
2 Assignments
0 Petitions
Accused Products
Abstract
A link-time optimization scheme is capable of removing from dead code from code fragments in a program which arise after the linking of code fragments. The scheme may be applied runtime to fragments which are linked in a caching dynamic translator or applied when linking fragments subsequent to the compilation of object code. The removal of dead code may be facilitated by the use of epilogs corresponding to exits from a fragment and prologs corresponding to entries into a fragment.
74 Citations
20 Claims
-
1. A method for removing dead code in code fragments of a program, comprising:
-
processing a first code fragment and storing first information generated during this processing indicative of whether an instruction for assigning a register in a first code fragment is possibly live;
processing a second code fragment and storing second information generated during this processing indicative of register usage;
at a time when the first and second code fragments are to be linked, determining, by use of the first and second stored information, if an instruction in the first code fragment that assigns a register is a dead instruction; and
responsive to determination that an instruction is a dead instruction, eliminating the dead instruction. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A computer readable comprising instructions for removing dead code in code fragments of a program, the instructions configured to:
-
process a first code fragment and store first information generated during this processing indicative of whether an instruction for assigning a register in a first code fragment is possibly live;
process a second code fragment and store second information generated during this processing indicative of register usage;
at a time when the first and second code fragments are to be linked, determine, by use of the first and second stored information, if an instruction in the first code fragment that assigns a register is a dead instruction; and
responsive to determination that an instruction is a dead instruction, eliminate the dead instruction. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19, 20)
-
Specification