Note on dependency depth: Dependency depth is defined as the number of dependent
instructions that need to execute sequentially.
Consider this example:
for (i=0; i<1000; i++) result[i] = sqrtf(arrayOne[i]) + sqrtf(arrayTwo[i]);In each iteration of the outermost loop, there exists a chain of dependent instructions that need to execute sequentially. These are:
ilp32
This feature is a measure of the Instruction Level Parallelism available in a region of code.
ilp32 looks at the number of independent iterations of a loop that fit in a window of 32 instructions.
Classifying ilp32:
ilp32 can be classified into low, medium or high as follows:
For a loop with < 32 instructions in each iteration,
Bucket | Condition |
---|---|
Low | The number of operations in each iteration of the loop is <6
OR
The dependency depth is more than 10.
|
Medium |
The number of operations in each iteration of the outermost loop is >=6 & <=10
& the dependency depth is about 5.
OR
The dependency depth is between 5 & 10.
|
High | The number of operations in each iteration of the outermost loop is >10 & the dependency depth is about 5. |
Example 1:
Consider the following code:
for (i=0; i<1000; i++) result[i] = sqrtf(arrayOne[i]) + sqrtf(arrayTwo[i]);The number of operations in this loop is about 12.
Example 2:
Consider another example:
for (i=0; i<1000; i++){ for (j=0; j<50; j++){ var1 += arrayOne[i]*smallArray[j]; } result[i] = var1; }The number of operations in each iteration of the innermost loop is about 5. Therefore, the total number of operations due to the innermost loop is: