IP Library Granted Patent US 8,966,463
Granted Patent B2
US 8,966,463 · App. 13/306,055 · Granted Feb 24, 2015

Eliminating redundant function calls

Inventors: Patrick W. Sathyanathan (Bellevue, WA); Ten Tzen (Sammamish, WA)
Assignee: Microsoft Technology Licensing, LLC
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 8,966,463
App. No.
13/306,055
Granted
Feb 24, 2015
Kind
B2
Abstract

A computer-implemented method for removing redundant function calls in a computer program includes identifying a first set of equivalent function calls appearing in the computer program. For each of the equivalent function calls, the method identifies whether the function call is partially available or partially anticipable. When a function call is identified as being partially anticipable, a result of the function call is stored in a temporary variable. When a function call is identified as being partially available, the function call is removed and replaced with use of the temporary variable.

Claims (41)

1. A computer-implemented method for removing redundant function calls in a computer program, comprising:

identifying a first set of equivalent function calls appearing in the computer program;

for each of the equivalent function calls, identifying whether the function call is partially available or partially anticipable, wherein a function call is identified as partially available if the function call was computed previously along at least one path to the function call, wherein a function call is identified as partially anticipable if the function call is re-computed later along at least one path away from the function call;

when a function call is identified as being partially anticipable, storing a result of the function call in a temporary variable;

when a function call is identified as being partially available, removing the function call and replacing the function call with use of the temporary variable; and

wherein the method is performed by at least one processor.

2. The computer-implemented method of claim 1 , and further comprising:

performing an inter-procedural analysis of the computer program to identify the set of equivalent function calls.

3. The computer-implemented method of claim 1 , and further comprising:

performing an inter-procedural analysis of the computer program to identify whether each function call is partially available or partially anticipable.

4. The computer-implemented method of claim 1 , wherein the method is performed on cast helper function calls in the computer program.

5. The computer-implemented method of claim 4 , wherein the cast helper function calls are automatically inserted into the computer program by a compiler front-end.

6. The computer-implemented method of claim 1 , wherein the method is performed by a compiler back-end.

7. The computer-implemented method of claim 1 , and further comprising:

performing a value numbering analysis to identify the first set of equivalent function calls.

8. The computer-implemented method of claim 1 , and further comprising:

generating a call graph for the computer program;

storing summary information in the call graph, wherein the summary information identifies whether function calls are partially available or partially anticipable.

9. The computer-implemented method of claim 1 , and further comprising:

identifying non-redundant call sites to allocate temporary variables and produce values to store in the temporary variables.

10. The computer-implemented method of claim 9 , and further comprising:

identifying redundant call sites that consume the values stored in the temporary variables.

11. The computer-implemented method of claim 10 , and further comprising:

passing information regarding the temporary variables as a call function argument to at least one of the redundant call sites.

12. A computer-readable storage medium storing computer-executable instructions that when executed by at least one processor cause the at least one processor to perform a method of removing redundant function calls in a computer program, the method comprising: identifying equivalent function calls appearing in the computer program; for each of the equivalent function calls, identifying whether the function call is partially available or partially anticipable, wherein a function call is identified as partially anticipable if the function call is re-computed later along at least one path away from the function call, wherein a function call is identified as partially available if the function call was computed previously along at least one path to the given the function call;

when a function call is identified as being partially anticipable, storing a result of the function call in a temporary variable; and when a function call is identified as being partially available, removing the function call and replacing the function call with use of the temporary variable; and

wherein the computer-readable storage medium does not include a propagation medium.

13. The computer-readable storage medium of claim 12 , wherein the method further comprises:

performing an inter-procedural analysis of the computer program to identify the equivalent function calls.

14. The computer-readable storage medium of claim 12 , wherein the method further comprises:

performing an inter-procedural analysis of the computer program to identify whether each function call is partially available or partially anticipable.

15. The computer-readable storage medium of claim 12 , wherein the method is performed on cast helper function calls in the computer program.

16. The computer-readable storage medium of claim 15 , wherein the cast helper function calls are automatically inserted into the computer program by a compiler front-end, and wherein the method is performed by a compiler back-end.

17. The computer-readable storage medium of claim 12 , wherein the method further comprises:

performing a value numbering analysis to identify the first set of equivalent function calls.

18. A computer-implemented method for removing redundant function calls in a computer program, comprising:

performing an inter-procedural analysis to identify equivalent function calls within procedures and across procedures in the computer program, wherein the equivalent function calls have been automatically inserted into the computer program by a compiler front-end;

for each of the equivalent function calls, identifying whether the function call is partially available or partially anticipable, wherein a function call is identified as partially available if the function call was computed previously along at least one path to the function call, and the function call is identified as partially anticipable if the function call is re-computed later along at least one path away from the function call;

when a function call is identified as being partially anticipable, storing a result of the function call in a temporary variable;

when a function call is identified as being partially available, removing the function call and replacing the function call with use of the temporary variable; and

wherein the method is performed by at least one processor.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 9, 2014
From: MICROSOFT CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 034544/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 29, 2011
From: SATHYANATHAN, PATRICK W.; TZEN, TEN
To: MICROSOFT CORPORATION
Reel/Frame 027292/0886 →
Continuity (1)
Related Publication 20130139136A1 · May 30, 2013