IP Library Granted Patent US 8,453,135
Granted Patent B2
US 8,453,135 · App. 12/722,506 · Granted May 28, 2013

Computation reuse for loops with irregular accesses

Inventor: Abderrazek Zaafrani (Round Rock, TX)
Assignee: Freescale Semiconductor, Inc.
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,453,135
App. No.
12/722,506
Granted
May 28, 2013
Kind
B2
Abstract

A compiler selects a nested loop within software code that includes an outer loop and an inner loop. The outer loop includes an outer induction variable and the inner loop includes an inner induction variable. The compiler identifies a computation included in the nested loop that generates an irregular array access, which includes an expression of both the outer induction variable and the inner induction variable. Next, the compiler identifies a redundant calculation for the computation based upon the outer induction variable and the inner induction variable, and generates a temporary variable to correspond with the redundant calculation. The compiler replaces the computation with the temporary variable in the nested loop and, in turn, compiles the nested loop with the included temporary variable.

Claims (89)

1. A computer-implemented method comprising:

selecting a nested loop within software code that includes an outer loop and an inner loop, the outer loop including an outer induction variable and the inner loop including an inner induction variable;

identifying, by one or more processors, a computation included in the nested loop that generates an irregular array access, wherein the irregular array access includes an expression of both the outer induction variable and the inner induction variable;

identifying, by one or more of the processors, a redundant calculation for the computation based upon the outer induction variable and the inner induction variable;

generating, by one or more of the processors, a temporary variable that corresponds to the identified redundant calculation;

replacing, by one or more of the processors, the computation with the temporary variable in the nested loop; and

compiling the nested loop that includes the temporary variable.

2. The method of claim 1 further comprising:

identifying a first operand and a second operand included in the computation; and

determining that the computation is reusable based upon:

detecting that the first operand generates the irregular array access; and

detecting that the second operand is loop invariant with respect to the outer loop and the inner loop.

3. The method of claim 1 further comprising:

identifying a first operand and a second operand included in the computation; and

determining that the computation is reusable based upon:

detecting that the first operand generates the irregular array access; and

detecting that the second operand generates a subsequent irregular array access having similar array access coefficients as the first operand.

4. The method of claim 1 further comprising:

identifying a first operand and a second operand included in the computation; and

determining that the computation is legal based upon:

determining that the first operand and the second operand fail to be a dependence target; and

determining that an outer variable range corresponding to the outer induction variable and an inner variable range corresponding to the inner induction variable are finite.

5. The method of claim 1 further comprising:

computing a reuse factor for the computation, wherein the reuse factor includes a non-optimized calculations quantity compared with an optimized calculations quantity; and

determining that reusing the redundant calculation is profitable based upon comparing the reuse factor with a reuse threshold.

6. The method of claim 1 further comprising:

including a temporary variable computation in the software code, the temporary variable computation residing external to the nested loop and generating a computation result for the temporary variable; and

compiling the software code with the included temporary variable computation.

7. The method of claim 1 wherein the nested loop resides within an n-nested loop.

8. A system comprising:

one or more processors;

a memory accessible by at least one of the processors;

a set of instructions stored in the memory and executed by at least one of the processors in order to perform actions of:

selecting a nested loop within software code that includes an outer loop and an inner loop, the outer loop including an outer induction variable and the inner loop including an inner induction variable;

identifying a computation included in the nested loop that generates an irregular array access, wherein the irregular array access includes an expression of both the outer induction variable and the inner induction variable;

identifying a redundant calculation for the computation based upon the outer induction variable and the inner induction variable;

generating a temporary variable that corresponds to the identified redundant calculation;

replacing the computation with the temporary variable in the nested loop; and

compiling the nested loop that includes the temporary variable.

9. The system of claim 8 wherein the set of instructions when executed by one or more of the processors further performs actions of:

identifying a first operand and a second operand included in the computation; and

determining that the computation is reusable based upon:

detecting that the first operand generates the irregular array access; and

detecting that the second operand is loop invariant with respect to the outer loop and the inner loop.

10. The system of claim 8 wherein the set of instructions when executed by one or more of the processors further performs actions of:

identifying a first operand and a second operand included in the computation; and

determining that the computation is reusable based upon:

detecting that the first operand generates the irregular array access; and

detecting that the second operand generates a subsequent irregular array access having similar array access coefficients as the first operand.

11. The system of claim 8 wherein the set of instructions when executed by one or more of the processors further performs actions of:

identifying a first operand and a second operand included in the computation; and

determining that the computation is legal based upon:

determining that the first operand and the second operand fail to be a dependence target; and

determining that an outer variable range corresponding to the outer induction variable and an inner variable range corresponding to the inner induction variable are finite.

12. The system of claim 8 wherein the set of instructions when executed by one or more of the processors further performs actions of:

computing a reuse factor for the computation, wherein the reuse factor includes a non-optimized calculations quantity compared with an optimized calculations quantity; and

determining that reusing the redundant calculation is profitable based upon comparing the reuse factor with a reuse threshold.

13. The system of claim 8 wherein the set of instructions when executed by one or more of the processors further performs actions of:

including a temporary variable computation in the software code, the temporary variable computation residing external to the nested loop and generating a computation result for the temporary variable; and

compiling the software code with the included temporary variable computation.

14. The system of claim 8 wherein the nested loop resides within an n-nested loop.

15. A computer program product stored in a computer readable storage medium, comprising functional descriptive material that, when executed by an information handling system, causes the information handling system to perform actions that include:

selecting a nested loop within software code that includes an outer loop and an inner loop, the outer loop including an outer induction variable and the inner loop including an inner induction variable;

identifying a computation included in the nested loop that generates an irregular array access, wherein the irregular array access includes an expression of both the outer induction variable and the inner induction variable;

identifying a redundant calculation for the computation based upon the outer induction variable and the inner induction variable;

generating a temporary variable that corresponds to the identified redundant calculation;

replacing the computation with the temporary variable in the nested loop; and

compiling the nested loop that includes the temporary variable.

16. The computer program product of claim 15 comprising functional descriptive material that, when executed by the information handling system, causes the information handling system to further performs actions of:

identifying a first operand and a second operand included in the computation; and

determining that the computation is reusable based upon:

detecting that the first operand generates the irregular array access; and

detecting that the second operand is loop invariant with respect to the outer loop and the inner loop.

17. The computer program product of claim 15 comprising functional descriptive material that, when executed by the information handling system, causes the information handling system to further performs actions of:

identifying a first operand and a second operand included in the computation; and

determining that the computation is reusable based upon:

detecting that the first operand generates the irregular array access; and

detecting that the second operand generates a subsequent irregular array access having similar array access coefficients as the first operand.

18. The computer program product of claim 15 comprising functional descriptive material that, when executed by the information handling system, causes the information handling system to further performs actions of:

identifying a first operand and a second operand included in the computation; and

determining that the computation is legal based upon:

determining that the first operand and the second operand fail to be a dependence target; and

determining that an outer variable range corresponding to the outer induction variable and an inner variable range corresponding to the inner induction variable are finite.

19. The computer program product of claim 15 comprising functional descriptive material that, when executed by the information handling system, causes the information handling system to further performs actions of:

computing a reuse factor for the computation, wherein the reuse factor includes a non-optimized calculations quantity compared with an optimized calculations quantity; and

determining that reusing the redundant calculation is profitable based upon comparing the reuse factor with a reuse threshold.

20. The computer program product of claim 15 comprising functional descriptive material that, when executed by the information handling system, causes the information handling system to further performs actions of:

including a temporary variable computation in the software code, the temporary variable computation residing external to the nested loop and generating a computation result for the temporary variable; and

compiling the software code with the included temporary variable computation.

Assignments (24)
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 11759915 AND REPLACE IT WITH APPLICATION 11759935 PREVIOUSLY RECORDED ON REEL 040925 FRAME 0001. ASSIGNOR(S) HEREBY CONFIRMS THE RELEASE OF SECURITY INTEREST. Recorded Feb 17, 2020
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP, B.V. F/K/A FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 052917/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 11759915 AND REPLACE IT WITH APPLICATION 11759935 PREVIOUSLY RECORDED ON REEL 040928 FRAME 0001. ASSIGNOR(S) HEREBY CONFIRMS THE RELEASE OF SECURITY INTEREST. Recorded Jan 17, 2020
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 052915/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 11759915 AND REPLACE IT WITH APPLICATION 11759935 PREVIOUSLY RECORDED ON REEL 037486 FRAME 0517. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS. Recorded Dec 10, 2019
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 053547/0421 →
RELEASE OF SECURITY INTEREST Recorded Sep 10, 2019
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 050744/0097 →
CORRECTIVE ASSIGNMENT TO CORRECT THE TO CORRECT THE APPLICATION NO. FROM 13,883,290 TO 13,833,290 PREVIOUSLY RECORDED ON REEL 041703 FRAME 0536. ASSIGNOR(S) HEREBY CONFIRMS THE THE ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS.. Recorded Feb 20, 2019
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: SHENZHEN XINGUODU TECHNOLOGY CO., LTD.
Reel/Frame 048734/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE NATURE OF CONVEYANCE PREVIOUSLY RECORDED AT REEL: 040632 FRAME: 0001. ASSIGNOR(S) HEREBY CONFIRMS THE MERGER AND CHANGE OF NAME. Recorded Sep 21, 2017
From: FREESCALE SEMICONDUCTOR INC.
To: NXP USA, INC.
Reel/Frame 044209/0047 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE PATENTS 8108266 AND 8062324 AND REPLACE THEM WITH 6108266 AND 8060324 PREVIOUSLY RECORDED ON REEL 037518 FRAME 0292. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS. Recorded Feb 1, 2017
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 041703/0536 →
CHANGE OF NAME Recorded Nov 8, 2016
From: FREESCALE SEMICONDUCTOR, INC.
To: NXP USA, INC.
Reel/Frame 040632/0001 →
RELEASE OF SECURITY INTEREST Recorded Nov 7, 2016
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 040928/0001 →
RELEASE OF SECURITY INTEREST Recorded Sep 21, 2016
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP, B.V., F/K/A FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 040925/0001 →
SUPPLEMENT TO THE SECURITY AGREEMENT Recorded Jun 16, 2016
From: FREESCALE SEMICONDUCTOR, INC.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 039138/0001 →
ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS Recorded Jan 13, 2016
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 037518/0292 →
ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS Recorded Jan 12, 2016
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 037486/0517 →
PATENT RELEASE Recorded Dec 21, 2015
From: CITIBANK, N.A., AS COLLATERAL AGENT
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 037356/0027 →
PATENT RELEASE Recorded Dec 21, 2015
From: CITIBANK, N.A., AS COLLATERAL AGENT
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 037357/0120 →
PATENT RELEASE Recorded Dec 21, 2015
From: CITIBANK, N.A., AS COLLATERAL AGENT
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 037356/0866 →
PATENT RELEASE Recorded Dec 21, 2015
From: CITIBANK, N.A., AS COLLATERAL AGENT
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 037357/0194 →
SECURITY AGREEMENT Recorded Nov 6, 2013
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 031591/0266 →
SECURITY AGREEMENT Recorded Jun 18, 2013
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 030633/0424 →
SECURITY AGREEMENT Recorded Sep 3, 2010
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS COLLATERAL AGENT
Reel/Frame 024933/0340 →
SECURITY AGREEMENT Recorded Sep 3, 2010
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 024933/0316 →
SECURITY AGREEMENT Recorded Sep 1, 2010
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 024915/0777 →
SECURITY AGREEMENT Recorded Sep 1, 2010
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS COLLATERAL AGENT
Reel/Frame 024915/0759 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 11, 2010
From: ZAAFRANI, ABDERRAZEK
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 024069/0834 →
Continuity (1)
Related Publication 20110225573A1 · Sep 15, 2011